跳转到主要内容
Trends 查询 endpoint 允许开发者根据 where-on-earth id(WOEID)获取某个位置的 Trends。
注意:WOEID 是由 Yahoo 创建的传统标识符,现已弃用。X API 使用数值来标识城镇和国家的趋势位置。请参考我们的旧版 博文,或 存档数据
如果可用,许多趋势还会返回过去 24 小时内的 tweet_count 此 endpoint 支持 App 级认证(app-auth),并实行每 15 分钟 75 次请求的请求速率限制。

入门

要使用此 endpoint,您需要从开发者门户获取一个[OAuth 2.0 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
    ]
}
账户设置 要访问这些 endpoint,您需要: 请在我们的入门指南中了解有关获取 X API v2 endpoint 访问权限的更多信息。
I