跳转到主要内容
Trends 查询端点允许开发者根据 where-on-earth id(WOEID)获取特定位置的 Trends。
注意:WOEID 是由 Yahoo 创建的遗留标识符,现已弃用。X API 使用数值来标识城镇和国家的趋势位置。可参考我们的遗留 博客文章或 归档数据
在可用的情况下,许多趋势还会返回过去 24 小时的 tweet_count 此端点支持应用级认证(app-auth),并采用每 15 分钟窗口 75 次请求的速率限制。

快速开始

要使用此端点,您需要从开发者门户获取 [bearer token](https://developer.x.com(/resources/fundamentals/authentication#app-only-authentication-and-oauth-2-0-bearer-token)。获取 bearer token 后,您可以按以下方式调用使用情况 API:
      curl 'https://api.x.com/2/trends/by/woeid/26062' --header 'Authorization: Bearer XXXXX'
如果请求成功,您将看到如下所示的 JSON 响应:
{
    "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
    ]
}
账户设置 要访问这些端点,您需要: 请参阅我们的快速入门指南,了解如何获取 X API v2 端点的访问权限。