X アカウントの account_based_in 所在地シグナルを確認する方法
X profile の location はユーザーが自由に編集でき、冗談やブランド文言であることもあります。クリエイター審査、提携先確認、地域キャンペーンの確認、不審アカウントの調査では、自由入力の location だけでは足りません。
TwexAPI の User About endpoint は、指定した screen name に対して account_based_in、location_accurate、関連する account metadata を返します。これらの fields は review evidence として扱い、live GPS location や完全な identity check とは見なさないでください。
このエンドポイントで分かること
次のような問いに向いています。
- この X アカウントはどの国または地域を示しているか?
- response は location signal を accurate としているか?
- organization affiliation や verification label があるか?
- username changes が多く、追加 review が必要か?
Influencer vetting、partner onboarding、regional campaign review、account-risk scoring、compliance triage で使いやすい endpoint です。
API エンドポイント
GET https://api.twexapi.io/twitter/{screen_name}/about
Authorization: Bearer <your_token>Path parameter:
| Parameter | 説明 |
|---|---|
screen_name | 確認する X username。@ は含めません |
Request example:
curl --request GET \
--url https://api.twexapi.io/twitter/elonmusk/about \
--header 'Authorization: Bearer <your_token>'使うべきレスポンスフィールド
Response は code、msg、data を含む standard object です。Account details は data に入ります。
1{
2 "code": 200,
3 "msg": "success",
4 "data": {
5 "user_id": "44196397",
6 "name": "Elon Musk",
7 "screen_name": "elonmusk",
8 "account_based_in": "United States",
9 "location_accurate": true,
10 "source": "United States App Store",
11 "username_changes_count": 0,
12 "is_blue_verified": true,
13 "userLabelType": "BusinessLabel",
14 "affiliate_username": "X"
15 }
16}| Field | 解釈 |
|---|---|
account_based_in | アカウントの国または地域シグナル |
location_accurate | response が location signal を accurate としているか |
source | 利用可能な場合に返る account source information |
username_changes_count | handle changes が多い場合の review signal |
userLabelType / affiliate_username | organization や affiliation context |
is_blue_verified / verification | verification signal。単体では identity proof ではない |
Python 例
次の例は 1 アカウントを取得し、review record として使いやすい形に整えます。Audit 用途では raw response も保存してください。
1import os
2import requests
3
4API_BASE = "https://api.twexapi.io"
5TOKEN = os.environ["TWEXAPI_TOKEN"]
6
7def get_account_location(screen_name: str) -> dict:
8 response = requests.get(
9 f"{API_BASE}/twitter/{screen_name}/about",
10 headers={"Authorization": f"Bearer {TOKEN}"},
11 timeout=30,
12 )
13 response.raise_for_status()
14
15 payload = response.json()
16 if payload.get("code") not in (None, 200):
17 raise RuntimeError(payload.get("msg", "TwexAPI request failed"))
18
19 data = payload.get("data") or {}
20 return {
21 "screen_name": data.get("screen_name") or screen_name,
22 "user_id": data.get("user_id"),
23 "account_based_in": data.get("account_based_in"),
24 "location_accurate": data.get("location_accurate"),
25 "source": data.get("source"),
26 "username_changes_count": data.get("username_changes_count"),
27 "is_blue_verified": data.get("is_blue_verified"),
28 "user_label_type": data.get("userLabelType"),
29 "affiliate_username": data.get("affiliate_username"),
30 "raw": data,
31 }
32
33if __name__ == "__main__":
34 result = get_account_location("elonmusk")
35 print(result)実行方法:
TWEXAPI_TOKEN="your_twexapi_bearer_token" python check-account-based-in.pyバッチレビューの形
この endpoint は 1 request で 1 screen name を確認します。Batch job では list を loop し、result が返るたびに保存します。
Production では次を推奨します。
screen_nameの input file または database table を使う- 各 result に
checked_atを保存する - auditability のため raw
dataobject を保存する account_based_inを自社の country/region taxonomy に normalize する- missing、unexpected、low-confidence な location result を manual review に回す
- この field だけで approve / reject を自動決定しない
よくある誤読
account_based_in は profile の free-form location field とは別です。また、account owner が今その国に物理的にいることを証明するものでもありません。
location_accurate: true でも、final verdict ではなく signal として扱います。High-impact decisions では、account age、username-change history、organization affiliation、post language、campaign records、manual review と組み合わせて判断してください。
使うべきワークフロー
次のような workflow に向いています。
- creator / influencer onboarding
- partner / affiliate review
- regional campaign eligibility checks
- suspicious account triage
- market research segmentation
- account geography が必要な compliance workflows
安全な pattern は、結果を保存し、context と一緒に reviewer へ見せることです。この field は decision を支援するものであり、decision 全体を代替するものではありません。