Is there any work around on fetching twitter conve

2019-01-23 10:18发布

I am working on a project where the conversation of a twitter user needs to be retrieved. For example i want to get all the replies of this tweet of BBC World Service. Using the REST API v1.1 i can get the timeline (tweet, re-tweet) of a twitter user. But i did not find any documentation/working work around on fetching replies of a specific tweet. Is there any work around on getting the replies of a specific tweet at all?

标签: api rest twitter
1条回答
淡お忘
2楼-- · 2019-01-23 10:51

There is no API call to get replies to a specific tweet. You can, however, cheat!

Using the Search API you can construct a search query which is:

  • In reply to @bbcworldservice.
  • Occurred after the tweet was posted.
  • Optionally, before a specific date / time.

So, in this case, something like

https://api.twitter.com/1.1/search/tweets.json?
    q=%23bbcworldservice&
    since_id=489366839953489920&
    count=100

You'll get a list of Tweets (up to 100). You will then need to search them for in_reply_to_status_id_str and see if it matches the status you're looking for.

查看更多
登录 后发表回答