Track keywords and more than one location in Streaming API


#1

I am trying to do a rather complicated filtered pull from the Streaming API. I want to track a handful of keywords, and a couple of different locations. I am having a hard time figuring out how to write the query string.

I’ve seen plenty of great examples where there are search terms and one location, but not any with more than one.

Is there a way to have more than one location in the Track query string?

Thanks!


#2

It’s documented here. To filter for location you use the locations parameter. It takes two longitude/latitude pairs to specify the bounding box for one location. Each number is separated by a comma. For two locations, it would look like this: locations=A1,A2,A3,A4,B1,B2,B3,B4. The A’s are the first location; the B’s are the second location.


#3

Thank you so much! That really helps, and answers my question. I have scanned and scrutinized the Twitter Streaming API request parameters documentation you linked to multiple times, but couldn’t figure it out, because all the examples were for only one location.