Hi,
Is there a way to filter on tweets having the users’ location? I only want to call tweets for which the user has location information.
I am using the academic track, the twitter api v2 and twarc2.
Thanks, Britta
In search, you can only filter on Tweet location, specifically the “Place” the tweet is tagged with - not on User Location: Search Tweets - How to build a query | Docs | Twitter Developer Platform either place: or place_country: or point_radius: or bounding_box operators.
In twarc you can search for a place:
twarc2 places --type name "london"
it will give you something like
London, England, United Kingdom [id=457b4814b4240d87]
Camden Town, London, United Kingdom [id=5de8cffc145c486b]
Hackney, London, United Kingdom [id=2a3f152d1ac5044a]
Lewisham, London, United Kingdom ...
and then use the ID of the place it gives you in a query:
twarc2 search "#brexit place:457b4814b4240d87" london_brexit.jsonl
User location is not available in Search, and there’s no public geo location for User Profiles - the location field in profiles is a text field users can fill in whatever they like - you can filter on this field in the Filter Stream but not in Search: Filtered stream - How to build a rule | Docs | Twitter Developer Platform