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

# NewsClient

> X API SDK の news Python パッケージのリファレンス。 X API v2 の news エンドポイント向けのクライアントと Pydantic モデルをまとめています。

## サブモジュール

* [xdk.news.client module](/xdks/python/reference/xdk.news.client)
  * [`NewsClient`](/xdks/python/reference/xdk.news.client#xdk.news.client.NewsClient)
    * [`NewsClient.__init__()`](/xdks/python/reference/xdk.news.client#xdk.news.client.NewsClient.__init__)
    * [`NewsClient.get()`](/xdks/python/reference/xdk.news.client#xdk.news.client.NewsClient.get)
    * [`NewsClient.search()`](/xdks/python/reference/xdk.news.client#xdk.news.client.NewsClient.search)
* [xdk.news.models module](/xdks/python/reference/xdk.news.models)
  * [`GetResponse`](/xdks/python/reference/xdk.news.models#xdk.news.models.GetResponse)
    * [`GetResponse.model_config`](/xdks/python/reference/xdk.news.models#xdk.news.models.GetResponse.model_config)
  * [`SearchResponse`](/xdks/python/reference/xdk.news.models#xdk.news.models.SearchResponse)
    * [`SearchResponse.model_config`](/xdks/python/reference/xdk.news.models#xdk.news.models.SearchResponse.model_config)

## モジュールの内容

このモジュールは、X API の news エンドポイントへのアクセスを提供します
news-related のすべての機能の主要なエントリポイントとして機能します。

### `class xdk.news.NewsClient`

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

#### パラメーター

<ParamField path="path.client" type="Client" />

### `__init__`

#### パラメーター

<ParamField path="path.client" type="Client" />

### `get`

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

#### パラメーター

<ParamField path="path.id" type="Any">
  The ID of the news story.
</ParamField>

<ParamField path="path.news_fields" type="List or None" default="None">
  A comma separated list of News fields to display.
</ParamField>

#### 戻り値

`GetResponse` - Response data

### `search`

Search News
次の一覧を取得します: News stories matching the specified search query.

#### パラメーター

<ParamField path="path.query" type="str">
  The search query.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  The number of results to return.
</ParamField>

<ParamField path="path.max_age_hours" type="int or None" default="None">
  The maximum age of the News story to search for.
</ParamField>

<ParamField path="path.news_fields" type="List or None" default="None">
  A comma separated list of News fields to display.
</ParamField>

#### 戻り値

`SearchResponse` - Response data
