Query for just news tweets through search API


#1

I need just news data from twitter. What query should I enter so my request only returns the tweets classified as news? This is equivalent to clicking on news on the left panel in the advanced search webpage. How can I make such a request through Search API.


#2

Unfortunately the Search API does not support filtering just to the news scope.


#3

Is there a way to filter to the news scope in any other way if not through the search API?


#4

One thing you could do is to use the Streaming API filter endpoint with track parameters that match the domain names of ‘news’ organisations, thereby picking up news by finding tweets that have URLs pointing to a known news site. Checkout the API here:

You could send something like this in your post data:

track=bbc.co.uk,cnn.com,nytimes.com

With this you can have up to 400 different terms on the stream. In this way you could also focus on a particular region, or language, by only including news organisations that are from that area or use a certain language.

Cheers,

JB.


#5

That seems like a feasible thing to do in my case. I am trying to extract news specifically about housing, but I want data for a particular time period, say Jan 2009-June 2009. Is Streaming API a good way to get that kind of historical data?


#6

Unfortunately only way to go back in time like that is to use a paid service like gnip. If however you were looking for very specific tweets (only a handful) you may be able to just do manual searching with date ranges via the web search interface in your browser.

Cheers,

JB.