# Trends by location

`GET https://api.twittrapi.com/trends/{locationId}`

Current trending topics for a place, by WOEID.

HTML page: https://www.twittrapi.com/docs/reference/trends-locationid

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `locationId` | path | string | yes |  | Yahoo WOEID, digits only (1 to 12). 1 is worldwide, 23424977 the United States. /misc/locations lists them all. |

Every read endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

## Response

Raw JSON of X's v1.1 trends/place endpoint: an array with one object holding trends (name, url, query, tweet_volume), as_of and locations.

With `format=simple`: Collection of Trend objects {name, query, url, tweetVolume} (no cursor). query is URL-decoded.

## Errors

| Status | When |
| --- | --- |
| 400 | locationId is missing or not a numeric WOEID. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/trends/1' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
from twittrapi import TwittrAPI

client = TwittrAPI(api_key="YOUR_API_KEY")
data = client.trends.get(1)
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
const data = await client.trends.get(1);
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/trends/1' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```
