I’m trying to run searches for tweets by keyword for a set of countries. An example query might be:

place_country:US ("some keyword" OR "some other keyword" OR "Some Third Keyword")

I’ll run the same query for multiple countries, replacing the place_country ISO code with others but keeping the same keyword.

When I do this, I get a lot of records… but they’re all the same for each country. I’ve tried adding has:geo but this severely reduces the number of records being returned.

Overall, I have two questions:

  1. Is this the right method to search for tweets by country, or is there a better way?
  2. Is there a way to use fewer requests, since we’re making a new request for each country? Being able to delineate a tweet by the country is very important for the use-case.

Thanks!!

The approach here looks correct, what do you mean by ‘they’re all the same for each country’? The place_country operator matches on Tweets with tagged places within that country.

For increasing efficiency per per request, make sure you’re using the highest maxResults value.
Depending on your rule length or preferences on post processing results, you could use:

(place_country:US OR place_country:GB OR place_country:AU) ("some keyword" OR "some other keyword" OR "Some Third Keyword")

Meaning these three requests:

place_country:US ("some keyword" OR "some other keyword" OR "Some Third Keyword")

place_country:GB ("some keyword" OR "some other keyword" OR "Some Third Keyword")

place_country:AU ("some keyword" OR "some other keyword" OR "Some Third Keyword")

would return the exact same records unless I included has:geo in the queries as well.

If I do what you suggest:

(place_country:US OR place_country:GB OR place_country:AU) ("some keyword" OR "some other keyword" OR "Some Third Keyword")

Am I able to associate the tweets with their respective country after retrieving the results?

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