Is there any work around on fetching twitter conversations using latest Twitter REST API v1.1

后端 未结 2 1427
我寻月下人不归
我寻月下人不归 2020-12-28 11:31

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

2条回答
  •  臣服心动
    2020-12-28 11:56

    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.

提交回复
热议问题