如何从 Twitter API 和趋势线获取关注者数量 [英] How to get a count of followers from Twitter API and trendline

查看:37
本文介绍了如何从 Twitter API 和趋势线获取关注者数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Twitter 随时间的推移编写一些关于关注者数量的报告,但是经过大量搜索和反复试验,我无法获得一段时间内的关注者数量 - 特别是过去的关注者数量.

I am in the process of writing some reports for the number of followers over time for Twitter, however after substantial searches and trial and error, I have not being able to get the number of followers over time - particularly past number of followers.

我知道有一个 API 可以为关注者获取个人用户 ID,但这对于我需要的东西来说太过分了,我不得不每天调用它.理想情况下,如果我可以传递一个日期并且它可以返回关注者的数量,那就太好了.

I know there is an API to get the individual userIds for the followers, but thats an overkill for what I need and I would have to call it everyday. Ideally it would be great if I can pass a date and it could return the number of followers.

有没有人有这方面的经验以及 API 可能是什么!

Does anyone have any experience with this and what the API might be!

谢谢

推荐答案

虽然没有直接的 API 来获取趋势线,但获取关注者数量相当容易,通过 URL 访问:

While there is no direct API to get the trendline, getting the followers count is fairly easy, access via the URL:

http://api.twitter.com/1/users/show.json?user_id=12345

文档包含所有内容@https://dev.twitter.com/docs/api/1/get/users/show

要获取趋势线,看来我需要每天查询它!

To get the trendline, seems like I will need to query it on a daily basis!

更新至 Twitter API v1.1

https://api.twitter.com/1.1/users/show.json?user_id=12345

文档位于 https://dev.twitter.com/docs/api/1.1/get/users/show

2018 年 5 月 31 日更新

新的 API 端点位于

The new API end point is at

https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-show

这篇关于如何从 Twitter API 和趋势线获取关注者数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆