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

> Methods for X API v2 Trends endpoints.

Access **Trends** endpoints via `client.Trends` (`TrendsClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`GetByWoeidAsync`](#getbywoeidasync) | `GET /2/trends/by/woeid/{woeid}` | Standard | Get Trends by WOEID |
| [`GetLocationsAsync`](#getlocationsasync) | `GET /2/trends/locations` | Standard | Get Trend Locations |
| [`GetPersonalizedAsync`](#getpersonalizedasync) | `GET /2/users/personalized_trends` | Standard | Get Personalized Trends |

## `GetByWoeidAsync`

GET `/2/trends/by/woeid/{woeid}`

**Get Trends by WOEID**

Retrieves trending topics for a specific location identified by its WOEID. `meta.location` describes that location: its `woeid` and `name`, and when they are known its `country`, `country_code`, `place_type` (`town`, `country` or `supername`) and `parent_id`, the WOEID of the place that contains it.

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

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

var response = await client.Trends.GetByWoeidAsync(1);
Console.WriteLine(response);
```

### Parameters

**woeid** `int` *required*

`woeid` (path parameter).

**Optional parameters (TrendsClient.GetByWoeidOptions — 2)**

**options.MaxTrends** `int`

`max_trends` (query parameter).

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

A comma separated list of Trend fields to display.

**Returns:** `Task<GetTrendsByWoeidResponse>`

***

## `GetLocationsAsync`

GET `/2/trends/locations`

**Get Trend Locations**

Retrieves every location that has trends. Each location has a WOEID to pass to `GET /2/trends/by/woeid/{woeid}`. The list is short and is returned whole, so the route takes no paging parameters.

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

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

var response = await client.Trends.GetLocationsAsync();
Console.WriteLine(response);
```

### Parameters

**Optional parameters (TrendsClient.GetLocationsOptions — 1)**

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

A comma separated list of TrendLocation fields to display.

**Returns:** `Task<GetTrendsLocationsResponse>`

***

## `GetPersonalizedAsync`

GET `/2/users/personalized_trends`

**Get Personalized Trends**

Retrieves personalized trending topics for the authenticated user.

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

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

var response = await client.Trends.GetPersonalizedAsync();
Console.WriteLine(response);
```

### Parameters

**Optional parameters (TrendsClient.GetPersonalizedOptions — 1)**

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

A comma separated list of PersonalizedTrend fields to display.

**Returns:** `Task<GetTrendsPersonalizedTrendsResponse>`

***
