Hi,
I want to find Tweets posted at a specific time, for instance Tweets on a specific day within a one hour window. Twitter’s advanced search has the since: and until: fields, but they don’t seem to allow for a timestamp. Does anyone know how to do this?

(E.g. It’s possible to look for Tweets about ‘new year’ posted on a specific day [this works:
https://twitter.com/search?q=“new year” since:2021-01-06 until:2021-01-07&src=typed_query&f=live] but not at a specific time [this doesn’t work: https://twitter.com/search?q=“new year” since:2021-01-06T13:00:00 until:2021-01-06T14:00:00&src=typed_query&f=live])

I’ve noticed a similar question posted years ago here [Finding tweets on a specified time window] but it hasn’t been answered.

Thanks!

The API does not support search to that level of granularity, by hour (and, I may be wrong, but I don’t think the advanced web search supports that, either) - you would need to do the filtering inside your app.

Thanks for your answer! If I can’t find Tweets for specific times, and need to look per day instead, I might run into Twitter’s page-down limits and miss out on some of the relevant Tweets. Is there a way to get the number of Tweets relevant to a query, in order to at least have a measure of achieved recall?
[Sorry, I’m new to this community - I’m not sure if this should be posted as a separate question…]

I can see that a similar question has been posted here [How can I get count of tweets that mention a specific keyword?] but the only answer is a suggestion to vote on the feedback channel, which presumably means it’s not currently possible.

The web search is a different system to the API, but does come in handy for exploratory search. You can search by hour in web, with since_time and until_time (as a unix epoch in seconds) GitHub - igorbrigadir/twitter-advanced-search: Advanced Search for Twitter.

To get tweets more reliably, the v2 recent search has timestamps down to the second and supposedly is the full index, unlike the web and v1.1 api search which is limited: GET /2/tweets/search/recent | Docs | Twitter Developer Platform

To get counts, it’s possible but only using a paid premium plan - and that’s a third type of API that’s different to the others again Premium search APIs | Docs | Twitter Developer Platform but this count is not exact, they are estimates for planning queries. The exact count would involve retrieving the tweets.

Hope that helps!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.