Search code examples
apisearchtwittersearch-engine

How can I use the Twitter Search API to return all tweets that match my search query, posted only within the last five seconds?


I would like to use the API to return all tweets that match my search query, but only tweets posted within the last five seconds.

With Twitter's Search API, I can use the since_id to grab all tweets from a specific ID. However, I can't really see a good way to find the tweet ID to begin from.

I'm also aware that you can use "since:" in the actual query to use a date, but you cannot enter a time.

Can someone with Twitter API experience offer me any advice? Thanks for reading and your time!

http://apiwiki.twitter.com/Search-API-Documentation


Solution

  • This sounds like something you can do on your end, as created_at is one of the fields returned in the result set. Just do your query, and only use the ones that are within the last 5 seconds.