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

> Reference for the NewsClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 news endpoints.

Cliente para operaciones de news

This client provides methods for interacting with the news endpoints
of the X API. It handles authentication, request formatting, and response
parsing for all news related operations.

## Constructores

### constructor

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

Creates a new news client instance

#### Parámetros

| Nombre   | Tipo                                                  | Descripción                    |
| :------- | :---------------------------------------------------- | :----------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | The main X API client instance |

#### Devuelve

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

#### Definido en

[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

| Nombre    | Tipo                                                       | Descripción               |
| :-------- | :--------------------------------------------------------- | :------------------------ |
| `id`      | `string`                                                   | The ID of the news story. |
| `options` | `GetOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                         |

#### Devuelve

`Promise`\<`Response`>

Promise resolving to the API response, or raw Response if requestOptions.raw is true

#### Definido en

[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

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

#### Devuelve

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

#### Definido en

[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

| Nombre    | Tipo                                                          | Descripción       |
| :-------- | :------------------------------------------------------------ | :---------------- |
| `query`   | `string`                                                      | The search query. |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                 |

#### Devuelve

`Promise`\<`Response`>

Promise resolving to the API response, or raw Response if requestOptions.raw is true

#### Definido en

[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

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

#### Devuelve

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

#### Definido en

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