> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-oauth-2-ios.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

The Trends lookup endpoint allow developers to get the Trends for a location, specified using the where-on-earth id (WOEID).

<Note>
  **Note**: WOEID is a legacy identifier created by Yahoo and has been deprecated. X API uses the numeric value to identify town and country trend locations. Reference our legacy [blog post](https://blog.x.com/engineering/en_us/a/2010/woeids-in-twitters-trends.html), or [archived data](https://archive.org/details/geoplanet_data_7.10.0.zip0.)
</Note>

The `tweet_count` for the last 24 hours is also returned for many trends if this is available.

This endpoint supports app-auth authentication and has a rate limit of 75 requests per 15-minute window.

### Getting started

To use this endpoint, you need a \[bearer token]\([https://developer.x.com(/resources/fundamentals/authentication#app-only-authentication-and-oauth-2-0-bearer-token)](https://developer.x.com\(/resources/fundamentals/authentication#app-only-authentication-and-oauth-2-0-bearer-token\)) from the [developer portal](https://developer.x.com/en/portal/dashboard). Once you have the bearer token,  you can call the usage API as shown below:

```
curl 'https://api.x.com/2/trends/by/woeid/26062' --header 'Authorization: Bearer XXXXX'
```

If the request is successful, you should see the JSON response as shown below:

```
{
    "data": [
        {
            "trend_name": "Europe",
            "tweet_count": 232408
        },
        {
            "trend_name": "Isak",
            "tweet_count": 2956
        },
        {
            "trend_name": "RNLI",
            "tweet_count": 2484
        },
        {
            "trend_name": "Toon",
            "tweet_count": 11447
        },
        {
            "trend_name": "St James",
            "tweet_count": 5565
        },
        {
            "trend_name": "Manning",
            "tweet_count": 10077
        },
        {
            "trend_name": "Copenhagen",
            "tweet_count": 35272
        },
        {
            "trend_name": "Coventry",
            "tweet_count": 3662
    ]
}
```

**Account setup**

To access these endpoints, you will need:

* An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info).
* To authenticate using the keys and tokens from a [developer App](/resources/fundamentals/developer-apps) that is located within a [Project](/resources/fundamentals/projects). 

Learn more about getting access to the X API v2 endpoints in our [getting started guide](/x-api/getting-started/getting-access).

<div className="flex space-x-2">
  <Button href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    Sample code
  </Button>

  <Button href="https://app.getpostman.com/run-collection/9956214-784efcda-ed4c-4491-a4c0-a26470a67400">
    Run in Postman
  </Button>
</div>
