# X (Twitter) 账号所在地与改名记录 API (twitter.user_about)

- Canonical page: https://everyinfra.com/twitter-api/user_about
- Endpoint: POST /api/v1/social with {"platform": "twitter", "action": "user_about", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

X 账号所在地与改名记录按 `username` 读取一个账号的「关于此账号」页信息。`username` 可以带 @，也可以直接填主页链接。除基础资料外，还有 X 显示的所在国家或地区 `account_based_in`、X 认为它准不准的 `is_location_accurate`、注册来源 `signup_source` 和改名次数 `username_change_count`。它回答「这个账号实际在哪、改过几次名」，适合核查账号背景。

批量资料那一页按数字 ID 一次查 20 个，给的是原文透传的位置描述；这一页一次只读一个账号，给的是 X 自己展示的所在地、注册来源和改名历史。`verified_since` 是账号开始拿到认证标记的时间。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=twitter&action=user_about

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | X 用户短名，可带 @，也可填主页链接；返回这个账号「关于此账号」页的信息。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | 用户在原平台的唯一 ID。 |
| username | 用户名（@handle）。 |
| display_name | 显示名，可能与 username 不同。 |
| url | 该记录在原平台上的可访问链接。 |
| account_based_in | X「关于此账号」页显示的账号所在国家 / 地区（如 United States）；X 没显示时没有这个字段。 |
| is_location_accurate | X 是否认为 account_based_in 准确（false 表示可能用了代理或 VPN 等）。 |
| signup_source | 账号注册来源（如 United States App Store）；X 没显示时没有这个字段。 |
| username_change_count | 账号改过几次用户名。 |
| last_username_change_at | 最近一次改用户名的时间；没改过时没有这个字段。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| verified_since | 账号开始拿到认证标记的时间。 |
| is_protected | 账号是否为受保护状态（推文仅粉丝可见）。 |
| affiliation | 账号挂的机构标签（如员工账号挂的公司名「X」）；没挂时没有这个字段。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| account_status | 账号状态，正常是 active（被封或停用时为其他值）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "twitter",
  "action": "user_about",
  "params": {
    "username": "nasa"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "twitter",
        "action": "user_about",
        "params": {
            "username": "nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "user_about",
  "results": {
    "user_id": …,
    "username": …,
    "display_name": …,
    "url": …,
    "account_based_in": …,
    "is_location_accurate": …,
    "signup_source": …,
    "username_change_count": …,
    "last_username_change_at": …,
    "is_verified": …,
    "verified_since": …,
    "is_protected": …,
    "affiliation": …,
    "avatar_url": …,
    "account_status": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `is_location_accurate` 为 false 是什么意思？

表示 X 认为 `account_based_in` 不准确，账号可能用了代理或 VPN 等。它是 X 的判断，不是本接口的核实结果。

### 为什么有些账号没有 `account_based_in` 或 `signup_source`？

X 没在「关于此账号」页显示这两项时，响应里就没有对应字段，不是接口出错。`last_username_change_at` 也一样，账号没改过用户名时没有这个字段。

### 怎么看出一个账号是不是改过名？

看 `username_change_count`，它是账号改过几次用户名；改过的话，`last_username_change_at` 给出最近一次的时间。这一页只给次数和最近一次时间。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=twitter
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
