> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CommunitiesClient

> Referência para a classe CommunitiesClient no SDK TypeScript da X API. Métodos, parâmetros e tipos de retorno para os endpoints communities da X API v2.

Client para operações de communities

Este client fornece métodos para interagir com os endpoints communities
da X API. Ele cuida da autenticação, formatação de requisição e análise
de resposta para todas as operações relacionadas a communities.

## Construtores

### constructor

• **new CommunitiesClient**(`client`): [`CommunitiesClient`](/xdks/typescript/reference/classes/CommunitiesClient)

Cria uma nova instância do client communities

#### Parâmetros

| Nome     | Tipo                                                  | Descrição                                |
| :------- | :---------------------------------------------------- | :--------------------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | A instância principal do client da X API |

#### Retorna

[`CommunitiesClient`](/xdks/typescript/reference/classes/CommunitiesClient)

#### Definido em

[communities/client.ts:102](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L102)

## Métodos

### search

▸ **search**(`query`, `options`): `Promise`\<`Response`>

Search Communities
Retrieves a list of Communities matching the specified search query.

#### Parâmetros

| Nome      | Tipo                                                          | Descrição                    |
| :-------- | :------------------------------------------------------------ | :--------------------------- |
| `query`   | `string`                                                      | Query to search communities. |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                            |

#### Retorna

`Promise`\<`Response`>

Promise que resolve para a resposta da API, ou Response bruto se requestOptions.raw for true

#### Definido em

[communities/client.ts:147](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L147)

▸ **search**(`query`, `options?`): `Promise`\<[`Get2CommunitiesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### Parâmetros

| Nome       | Tipo            |
| :--------- | :-------------- |
| `query`    | `string`        |
| `options?` | `SearchOptions` |

#### Retorna

`Promise`\<[`Get2CommunitiesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### Definido em

[communities/client.ts:160](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L160)

***

### getById

▸ **getById**(`id`, `options`): `Promise`\<`Response`>

Get Community by ID
Retrieves details of a specific Community by its ID.

#### Parâmetros

| Nome      | Tipo                                                           | Descrição                |
| :-------- | :------------------------------------------------------------- | :----------------------- |
| `id`      | `string`                                                       | The ID of the Community. |
| `options` | `GetByIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                        |

#### Retorna

`Promise`\<`Response`>

Promise que resolve para a resposta da API, ou Response bruto se requestOptions.raw for true

#### Definido em

[communities/client.ts:352](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L352)

▸ **getById**(`id`, `options?`): `Promise`\<[`Get2CommunitiesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

#### Parâmetros

| Nome       | Tipo             |
| :--------- | :--------------- |
| `id`       | `string`         |
| `options?` | `GetByIdOptions` |

#### Retorna

`Promise`\<[`Get2CommunitiesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

#### Definido em

[communities/client.ts:365](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L365)
