用户资料
通过数字 Rest ID 检索 X (Twitter) 用户资料。用于在监控帖子或进行创作者与账号研究前,查看已知账号信息。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
rest_id |
必填 | string | X 用户的唯一数字标识符(Rest ID)。 | 11348282 |
— |
代码示例
curl -G "https://api.mofa-ai.com/v1/twitter/get_user_detail_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'rest_id=11348282'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/twitter/get_user_detail_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"rest_id": "11348282",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/twitter/get_user_detail_v1");
url.search = new URLSearchParams({
rest_id: "11348282",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-08,耗时 8002 ms · 请求参数 {"rest_id": "11348282"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "twitter.get_user_detail_v1",
"cost_usd": 0.02,
"data": {
"code": 0,
"data": {
"id": "11348282",
"desc": "Making the seemingly impossible, possible. ✨",
"name": "NASA",
"avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
"status": "active",
"friends": 115,
"profile": "NASA",
"rest_id": "11348282",
"location": "Pale Blue Dot",
"protected": false,
"sub_count": 92271894,
"affiliates": [],
"created_at": "Wed Dec 19 20:20:32 +0000 2007",
"media_count": 28241,
"header_image": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
"blue_verified": true,
"statuses_count": 74520,
"business_account": null,
"verification_type": null,
"pinned_tweet_ids_str": [
"2119188276049228152"
]
},
"message": null,
"requestId": "187a79ca03ee4d7b8bc09d3375f87147",
"recordTime": "2026-11-08T08:00:20.228289855",
"requestParams": {
"body": null,
"query": {
"restId": "11348282"
}
}
}
}