# Trend locations

`GET https://api.twittrapi.com/misc/locations`

All places X has trends for, with their WOEIDs.

HTML page: https://www.twittrapi.com/docs/reference/misc-locations

## Parameters

None.

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/available endpoint: an array of places with name, woeid, country and placeType.

With `format=simple`: Collection of TrendLocation objects {woeid, name, country, countryCode, placeType, parentId} (no cursor).

## Errors

| Status | When |
| --- | --- |

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/misc/locations' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
from twittrapi import TwittrAPI

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

Node.js:

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

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

RapidAPI:

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