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

# NewsClient

ニュース関連の操作用 Client

この Client は、X API のニュース関連エンドポイントを操作するためのメソッドを提供します。ニュース関連のあらゆる操作について、認証、リクエストのフォーマット、およびレスポンスの解析を行います。

<div id="constructors">
  ## コンストラクタ
</div>

<div id="constructor">
  ### constructor
</div>

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

新しい `NewsClient` インスタンスを作成します

#### パラメーター

| Name     | Type                                                     | Description              |
| :------- | :------------------------------------------------------- | :----------------------- |
| `client` | [`Client`](/ja/xdks/typescript/reference/classes/Client) | X API のメイン Client インスタンス |

#### 戻り値

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

<div id="defined-in">
  #### 定義場所
</div>

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

<div id="methods">
  ## メソッド
</div>

<div id="get">
  ### get
</div>

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

ID でニュース記事を取得します\
指定した ID のニュース記事を取得します。

#### パラメータ

| Name      | Type                                                       | Description |
| :-------- | :--------------------------------------------------------- | :---------- |
| `id`      | `string`                                                   | ニュース記事の ID。 |
| `options` | `GetOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -           |

<div id="returns">
  #### Returns
</div>

`Promise`\<`Response`>

API レスポンス (requestOptions.raw が true の場合は生の Response) で解決される Promise

#### 定義元

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

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

#### パラメーター

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

#### 戻り値

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

#### 定義元

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

***

<div id="search">
  ### search
</div>

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

ニュースを検索します\
指定した検索クエリに一致するニュース記事の一覧を取得します。

<div id="parameters">
  #### Parameters
</div>

| Name      | Type                                                          | Description |
| :-------- | :------------------------------------------------------------ | :---------- |
| `query`   | `string`                                                      | 検索クエリ文字列。   |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -           |

<div id="returns">
  #### Returns
</div>

`Promise`\<`Response`>

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

<div id="defined-in">
  #### 定義場所
</div>

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

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

#### パラメーター

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

#### 戻り値

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

#### 定義元

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