Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rest

twitter

api

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?

like image 899
hasan3050 Avatar asked Nov 29 '22 00:11

hasan3050


1 Answers

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.

like image 66
Terence Eden Avatar answered Dec 06 '22 04:12

Terence Eden