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

# TrendsClient

> Reference for the TrendsClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 trends endpoints.

Client for trends operations

This client provides methods for interacting with the trends endpoints
of the X API. It handles authentication, request formatting, and response
parsing for all trends related operations.

zed]\(/xdks/typescript/reference/classes/TrendsClient#getpersonalized)

## Constructors

### constructor

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

Creates a new trends client instance

#### Parameters

| Name     | Type                                                  | Description                    |
| :------- | :---------------------------------------------------- | :----------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | The main X API client instance |

#### Returns

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

#### Defined in

[trends/client.ts:90](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/trends/client.ts#L90)

## Methods

### getByWoeid

▸ **getByWoeid**(`woeid`, `options`): `Promise`\<`Response`>

Get Trends by WOEID
Retrieves trending topics for a specific location identified by its WOEID.

#### Parameters

| Name      | Type                                                              | Description                                   |
| :-------- | :---------------------------------------------------------------- | :-------------------------------------------- |
| `woeid`   | `number`                                                          | The WOEID of the place to lookup a trend for. |
| `options` | `GetByWoeidOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                             |

#### Returns

`Promise`\<`Response`>

Promise resolving to the API response, or raw Response if requestOptions.raw is true

#### Defined in

[trends/client.ts:135](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/trends/client.ts#L135)

▸ **getByWoeid**(`woeid`, `options?`): `Promise`\<[`Get2TrendsByWoeidWoeidResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2TrendsByWoeidWoeidResponse)>

#### Parameters

| Name       | Type                |
| :--------- | :------------------ |
| `woeid`    | `number`            |
| `options?` | `GetByWoeidOptions` |

#### Returns

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

#### Defined in

[trends/client.ts:148](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/trends/client.ts#L148)

***

### getPersonalized

▸ **getPersonalized**(`options`): `Promise`\<`Response`>

Get personalized Trends
Retrieves personalized trending topics for the authenticated user.

#### Parameters

| Name      | Type                                                                   |
| :-------- | :--------------------------------------------------------------------- |
| `options` | `GetPersonalizedOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### Returns

`Promise`\<`Response`>

Promise resolving to the API response, or raw Response if requestOptions.raw is true

#### Defined in

[trends/client.ts:285](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/trends/client.ts#L285)

▸ **getPersonalized**(`options?`): `Promise`\<[`Get2UsersPersonalizedTrendsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2UsersPersonalizedTrendsResponse)>

#### Parameters

| Name       | Type                     |
| :--------- | :----------------------- |
| `options?` | `GetPersonalizedOptions` |

#### Returns

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

#### Defined in

[trends/client.ts:294](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/trends/client.ts#L294)
