Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions doc/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ This is a comprehensive guide of all methods available for the Twitter API v2 on
- [Search spaces](#search-spaces)
- [Space buyers](#space-buyers)
- [Space tweets](#space-tweets)
- [Communities](#communities)
- [Community by id](#community-by-id)
- [Search communities](#search-communities)
- [Direct messages (DMs)](#direct-messages-dms)
- [Fetch direct message events (without filter)](#fetch-direct-message-events-without-filter)
- [Fetch direct message events by participant id](#fetch-direct-message-events-by-participant-id)
Expand Down Expand Up @@ -1534,6 +1537,52 @@ const { data: tweets } = await client.v2.spaceTweets('space-id')
// tweets is a TweetV2[]
```

## Communities

### Community by id

Returns a variety of information about a single Community specified by ID.

**Method**: `.community()`

**Endpoint**: `communities/:id`

**Right level**: `Read-only`

**Arguments**:
- `communityId: string`
- `options?: CommunityByIDV2Params`

**Returns**: `CommunityV2Result`

**Example**
```ts
const { data: community } = await client.v2.community('12345', {
expansions: ['creator_id'],
});
```

### Search communities

Search for Communities based on keywords.

**Method**: `.searchCommunities()`

**Endpoint**: `communities/search`

**Right level**: `Read-only`

**Arguments**:
- `query: string`
- `options?: CommunitySearchV2Params`

**Returns**: `CommunitiesV2Result`

**Example**
```ts
const { data: communities } = await client.v2.searchCommunities('typescript');
```

## Direct messages (DMs)

### Fetch direct message events (without filter)
Expand Down