Constructors
constructor
• new NewsClient(client): NewsClient
Creates a new news client instance
Parameters
| Name | Type | Description |
|---|---|---|
client | Client | The main X API client instance |
Returns
NewsClient
Defined in
news/client.ts:96Methods
get
▸ get(id, options): Promise<Response>
Get news stories by ID
Retrieves news story by its ID.
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the news story. |
options | GetOptions & { requestOptions: { raw: true } } | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
news/client.ts:141 ▸ get(id, options?): Promise<Get2NewsIdResponse>
Parameters
| Name | Type |
|---|---|
id | string |
options? | GetOptions |
Returns
Promise<Get2NewsIdResponse>
Defined in
news/client.ts:154search
▸ search(query, options): Promise<Response>
Search News
Retrieves a list of News stories matching the specified search query.
Parameters
| Name | Type | Description |
|---|---|---|
query | string | The search query. |
options | SearchOptions & { requestOptions: { raw: true } } | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
news/client.ts:288 ▸ search(query, options?): Promise<Get2NewsSearchResponse>
Parameters
| Name | Type |
|---|---|
query | string |
options? | SearchOptions |
Returns
Promise<Get2NewsSearchResponse>