Skip to main content
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 Creates a new trends client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

TrendsClient

Defined in

trends/client.ts:90

Methods

getByWoeid

getByWoeid(woeid, options): Promise<Response> Get Trends by WOEID Retrieves trending topics for a specific location identified by its WOEID.

Parameters

NameTypeDescription
woeidnumberThe WOEID of the place to lookup a trend for.
optionsGetByWoeidOptions & { 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 getByWoeid(woeid, options?): Promise<Get2TrendsByWoeidWoeidResponse>

Parameters

NameType
woeidnumber
options?GetByWoeidOptions

Returns

Promise<Get2TrendsByWoeidWoeidResponse>

Defined in

trends/client.ts:148

getPersonalized

getPersonalized(options): Promise<Response> Get personalized Trends Retrieves personalized trending topics for the authenticated user.

Parameters

NameType
optionsGetPersonalizedOptions & { 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 getPersonalized(options?): Promise<Get2UsersPersonalizedTrendsResponse>

Parameters

NameType
options?GetPersonalizedOptions

Returns

Promise<Get2UsersPersonalizedTrendsResponse>

Defined in

trends/client.ts:294