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

> X API TypeScript SDK の NewsClient クラスのリファレンス。 X API v2 の news エンドポイントのメソッド、パラメーター、戻り値の型。

news 操作向けのクライアント

このクライアントは X API の news エンドポイントと対話するためのメソッドを提供します。認証、リクエストの整形、news に関連するすべての操作のレスポンス解析を扱います。

## コンストラクター

### コンストラクター

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

新しい news クライアントインスタンスを作成します

#### パラメーター

| 名前       | 型                                                     | 説明                      |
| :------- | :---------------------------------------------------- | :---------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | メインの X API クライアントインスタンス |

#### 戻り値

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

#### 定義場所

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

## メソッド

### get

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

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

#### パラメーター

| 名前        | 型                                                          | 説明                        |
| :-------- | :--------------------------------------------------------- | :------------------------ |
| `id`      | `string`                                                   | The ID of the news story. |
| `options` | `GetOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                         |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[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)>

#### パラメーター

| 名前         | 型            |
| :--------- | :----------- |
| `id`       | `string`     |
| `options?` | `GetOptions` |

#### 戻り値

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

#### 定義場所

[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
次の一覧を取得します: News stories matching the specified search query.

#### パラメーター

| 名前        | 型                                                             | 説明                |
| :-------- | :------------------------------------------------------------ | :---------------- |
| `query`   | `string`                                                      | The search query. |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                 |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[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)>

#### パラメーター

| 名前         | 型               |
| :--------- | :-------------- |
| `query`    | `string`        |
| `options?` | `SearchOptions` |

#### 戻り値

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

#### 定義場所

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