> ## 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.

# NewsClient

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

Client para operações de news

Este client fornece métodos para interagir com os endpoints news
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 news.

## Construtores

### constructor

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

Cria uma nova instância do client news

#### Parâmetros

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

#### Retorna

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

#### Definido em

[news/client.ts:96](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/news/client.ts#L96)

## Métodos

### get

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

Get news stories by ID
Retrieves news story by its ID.

#### Parâmetros

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

#### Retorna

`Promise`\<`Response`>

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

#### Definido em

[news/client.ts:141](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/news/client.ts#L141)

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

#### Parâmetros

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

#### Retorna

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

#### Definido em

[news/client.ts:154](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/news/client.ts#L154)

***

### search

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

Search News
Retrieves a list of News stories matching the specified search query.

#### Parâmetros

| Nome      | Tipo                                                          | Descrição         |
| :-------- | :------------------------------------------------------------ | :---------------- |
| `query`   | `string`                                                      | The search query. |
| `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

[news/client.ts:288](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/news/client.ts#L288)

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

#### Parâmetros

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

#### Retorna

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

#### Definido em

[news/client.ts:301](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/news/client.ts#L301)
