X Account Location
X's About this account panel is a short record attached to every profile: the country or region the account is based in, the app store, app or web client it connects through, the date it joined, how many times its username has changed and the organization it is affiliated with. Read together, these details let you test whether an account operates from where its content suggests, vet creators before a deal and find groups of accounts that share an unexpected origin.
X Account Location API Features
- The country X lists for each accountEach X Account Location API row puts the "Account based in" value from the profile's About this account panel in country, such as United States or United Kingdom.
- How the account reaches Xconnected_via names the channel X associates with the account, for example United States App Store, Android App or Web, which you can set beside country.
- Join date and handle historypublished_at holds the date the account joined X and username_changes_count counts its renames, two quick signals of how established a handle is.
- Affiliation and ID verificationaffiliate_username shows the organization badge on the profile, such as X for elonmusk or BBCNews for BBCWorld, next to is_identity_verified and the blue-check flag is_verified.
- A row per username in one taskSend a list of usernames, a leading @ optional, and each account comes back as its own row with id, username, name, avatar_url and is_private alongside its location details.
X Account Location API Parameters
| Parameters | Required | Description |
|---|---|---|
usernames | Required | X usernames to look up, with or without the leading @. Each account returns its own row. |
How to Use the X Account Location API
Submit usernames to the X Account Location API and read one About this account row per account.
- POST {"usernames": ["elonmusk", "BBCWorld"]} to /v1/x/user-about.
- Poll GET /v1/tasks/{task_id} until status is succeeded.
- Read one row per account from results.items and pass results.next_cursor back while has_more is true.
curl -X POST "https://api.socq.ai/v1/x/user-about" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"usernames":["elonmusk","BBCWorld"]}'
# An account that shows no country on X still returns a row, with country set to null.X Account Location API Use Cases
- Checking where political and news accounts operate: Run the handles driving a political or news topic through the X Account Location API and flag those whose country or connected_via points to a different part of the world from the audience they address.
- Vetting a creator before a paid partnership: Confirm that country matches the market you are paying to reach, and look at published_at and username_changes_count for a recently created or often renamed handle.
- Grouping accounts that may be coordinated: Cluster a set of suspicious accounts by country, connected_via and join month to surface batches that were created around the same time from the same place.
- Counting the countries behind a conversation: Pass the usernames that replied to or reposted a post, collected with other X endpoints, and tally country to see which regions the discussion comes from.
X Account Location API Pro Tips
- Before labeling an account as foreign-run, read country together with connected_via and published_at; one field on its own can mislead.
- Store accounts by id, since username_changes_count shows how often a handle can change.
- Keep collected_at with every row and rerun the same usernames through the X Account Location API later to catch a change in country, connected_via or username_changes_count.
- Match the returned rows to your input list by username: when some accounts are missing, the rest still come back and the missing ones simply have no row.
Related APIs
Beyond the X Account Location API, use these APIs when you need a different type of public X data.
- Twitter Profile Scraper API — Retrieve public account identity, biographies, avatars, cover images, account status, and visible audience statistics by username.
- Twitter User Tweets Scraper API — Collect recent public posts, authors, media, hashtags, mentions, and engagement by username with replies excluded.
- X Followers List API — Collect public follower account identities and visible profile metrics for one or more X usernames.
- X Following List API — Collect profiles followed by public X accounts, including identity, biographies, account signals, visible counters, and source usernames.
- X Post Retweeters API — Collect a task-level unique set of normalized public profiles for accounts that reposted known X or Twitter status URLs.
- X Verified Followers API — Collect the verified accounts following a profile, with their usernames, names, avatars and join dates.
- Twitter Tweet Scraper API
- Twitter Search API
- X Post Quotes API
- X Post Replies API
- X Trends API
- Twitter Mentions API
- Twitter User Search API
- X Community API
- X Community Posts API
- X Thread Context API
- X List Tweets API
- Twitter List Members API
- Twitter List Followers API
- X Community Members API
- X Community Moderators API
- X Communities Search API
- X Articles API
- X Spaces API
- Twitter Media Scraper API
- X User Replies API
- Twitter Follow Checker API
- Twitter Video Transcript API