【问题标题】:Counting Tweets计算推文
【发布时间】:2021-04-02 00:59:49
【问题描述】:

我有兴趣在特定时间范围内检索带有特定主题标签或关键字的推文数量。到目前为止,我只遇到过 Twitter 搜索 API、Twitter 历史搜索和完整档案搜索。虽然这些肯定有用,但我想知道是否有办法只从服务器获取数字响应,因为我不会对推文本身做任何事情。

感谢您的帮助。

【问题讨论】:

    标签: api twitter


    【解决方案1】:

    付费高级搜索 API(30 天和完整存档)提供 counts 端点。在此示例中,我们要求 API 提供 2020 年 4 月至 5 月的每日计数:

    curl --request POST --url https://api.twitter.com/1.1/tweets/search/fullarchive/[ENV]/counts.json  --header 'authorization: Bearer [BEARERTOKEN]' --header 'content-type: application/json' --data '{"query": "#cheerlights","fromDate": "202004260000","toDate": "20200526000","bucket":"day"}'
    

    目前,标准 v1.1 和新的 v2 搜索 API 不提供与推文结果分开的计数。

    【讨论】:

      猜你喜欢
      • 2020-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-22
      • 2021-07-24
      相关资源
      最近更新 更多