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

> Methods for X API v2 News endpoints.

Access **News** endpoints via `client.News` (`NewsClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`GetAsync`](#getasync) | `GET /2/news/{id}` | Standard | Get News Stories by ID |
| [`SearchAsync`](#searchasync) | `GET /2/news/search` | Standard | Search News |

## `GetAsync`

GET `/2/news/{id}`

**Get News Stories by ID**

Retrieves news story by its ID.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});

var response = await client.News.GetAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**Optional parameters (NewsClient.GetOptions — 1)**

**options.NewsFields** `List\<string\>`

A comma separated list of News fields to display.

**Returns:** `Task<GetNewsResponse>`

***

## `SearchAsync`

GET `/2/news/search`

**Search News**

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

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});

var response = await client.News.SearchAsync("from:XDevelopers");
Console.WriteLine(response);
```

### Parameters

**query** `string` *required*

`query` (query parameter).

**Optional parameters (NewsClient.SearchOptions — 3)**

**options.MaxResults** `int`

`max_results` (query parameter).

**options.MaxAgeHours** `int`

`max_age_hours` (query parameter).

**options.NewsFields** `List\<string\>`

A comma separated list of News fields to display.

**Returns:** `Task<SearchNewsResponse>`

***
