Skip to content

Twitter API location: tweet geo data and profile location

Twitter API location explained: why most tweets have no geotag, how profile location works, and how to get tweets by location and a user's place in code.

Piyushh · November 13, 2026 · 3 min read

A map with only a few pins and many blank tags, picturing how few tweets carry a location.

Twitter API location comes in two kinds, and they behave differently. A tweet carries a place only if its author geotagged it, and most tweets aren't geotagged. A profile has a location field the owner typed in, and it can say anything. Work out which one you need before you write code. The answer to "where is this person" usually comes from the second kind, read as text.

This guide covers both kinds and what the data dictionary says about each. It then shows how to get tweets by location in Python with a hosted API.

Tweet location: the geo field

X's API v2 data dictionary (checked 2026-11-13 at docs.x.com) describes the geo field as "the location or place of a geo-tagged Tweet". It points to a Place object with a full_name such as "Manhattan, NY", a country_code and GeoJSON data.

The key word is "geo-tagged": the author has to attach a place to the post. Most don't, so in a random sample of tweets the geotag is usually empty. We have not measured how rare it is and won't give you a percentage.

ChatterAPI does not return the tweet geotag. A tweet row carries the text, timestamps, likes, retweets, replies, views and an author object, but no place and no coordinates. If you need geotagged posts specifically, you need X's own API and its geo operators. We did not verify which access level those operators require, so read X's operator reference before you commit to that route.

Profile location: free text

The user object has a location field. X's description: "the location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location."

We see the same thing. A recorded sample for x.user_location, captured 2026-10-13, returned this for @levelsio:

{
  "handle": "levelsio",
  "location": "📕My book $5K/m 👉",
  "hasLocation": true,
  "note": "This is the text the account owner typed into the location field. It can be a city, a country, a joke or a place they have never lived."
}

That's a pitch, not a place. Treat profile location as a hint: good for "which countries do my followers say they are in", bad for "where is this person standing".

To check one account, use the free Twitter location finder. In code, x.user returns the same field along with the bio and follower counts, for 2 credits.

Get tweets by location in Python

ChatterAPI gives you two honest ways to do this.

The first is to search, then read each author's location. x.search takes keywords and X operators in q. Every tweet in the response carries the author's profile, with location. So you search a topic and keep the authors whose location text matches a place:

import os
import requests

r = requests.get(
    "https://api.chatterapi.com/v1/x/tweets/search",
    params={"q": '"crm recommendation"', "sort": "latest"},
    headers={"Authorization": f"Bearer {os.environ['CHATTERAPI_KEY']}"},
    timeout=60,
)
r.raise_for_status()

for t in r.json()["data"]:
    loc = (t["author"]["location"] or "").lower()
    if "india" in loc or "bengaluru" in loc:
        print(t["createdAt"][:10], t["author"]["handle"], t["author"]["location"], t["text"][:60])

A page holds about 20 tweets and costs 2 credits. Follow page.nextCursor for more. In our recorded sample for this query (test key, captured 2026-10-13), 19 of 20 authors had filled in a location, for example "Marietta, GA" and "Bengaluru". That tells you nothing about how common it is across X. It is one query.

Matching free text is messy. "India", "Bengaluru", "BLR" and "Karnataka, India" all point to the same place. Build a small alias list for the places you care about, and expect to miss some.

The second is to search by operator. Because q accepts X search operators, you can put a location operator inside the query. We have not verified that near: or a place operator works through our search, so test it on a free test key and read the rows before you build on it. Don't assume it filters.

What you cannot get

  • Where someone posted from. Our x.user_location tool says it plainly: X does not publish where an account posts from.
  • Real-time location streams. ChatterAPI only polls, with no push or streaming.
  • A verified home city. Nobody can get that from public data.

Which route to pick

You needUse
One account's stated locationTwitter location finder or x.user_location
Tweets on a topic from people in a regionx.search, then filter author.location
Geotagged posts with coordinatesX's own API and its geo operators

Use the cursor to scale the search job. If you also need a time range, see how to search tweets by date. The Twitter API Python guide walks through the search call in Python from start to finish.

Check a profile location now

Paste a handle into the Twitter location finder to see what location an account lists. You don't need to write any code.

FAQ

How do I get the location of a tweet from the Twitter API?
Only a tweet that its author geotagged carries a place. X's data dictionary describes the geo field as the location or place of a geo-tagged Tweet, and most tweets are not tagged. For everything else you can read the author's profile location, which is free text.
Can the Twitter API get tweets by location?
X's own API has geo operators, but we did not verify which access level they need, so check X's operator reference. With ChatterAPI you can search tweets by keyword and read each author's profile location, then filter by that text yourself.
Is the Twitter profile location accurate?
No. X documents it as a free-form value that may not indicate a valid location. People type cities, countries, jokes and links into it.
How do I get tweets by location in Python?
Call a search endpoint, loop over the results and filter on the author's location field. The example below does this with requests against /v1/x/tweets/search.
Does ChatterAPI return the geotag of a tweet?
No. Tweet rows carry text, engagement and an author profile, which includes the profile location. They do not include a place or coordinates.

More on X (Twitter) API

Try it free for 7 days.

1,000 credits to make your first calls. One key for Reddit and X, over REST or MCP.