X (Twitter) — 用户主页
SpiderHubs OpenAPI 文档:X (Twitter) — 用户主页,分类 X (Twitter)。接口 GET /openapi/v1/contentcreator/twitter/web/fetch_user_profile。按用户名(screen_name)或数字 ID(rest_id)获取...
OpId:
tw-user-profile · 最近更新: 2026-05-23说明
按用户名(screen_name)或数字 ID(rest_id)获取用户资料,二选一。
基础信息
- Endpoint:
- GET /openapi/v1/contentcreator/twitter/web/fetch_user_profile
- 计费:
- 1 积分 / 次
- 限流:
- 300 次 / 分钟 / 用户
请求参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| screen_name | string | 否 | 用户名(@ 后面的部分),与 rest_id 二选一 |
| rest_id | string | 否 | 用户数字 ID,与 screen_name 二选一 |
响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 业务状态码,200 表示成功 |
| request_id | string | 本次请求唯一标识,排查问题时可提供 |
| data | object | 业务数据容器,具体字段见下 |
| data.profile | string | 用户名(screen_name,@ 后面的部分) |
| data.rest_id | string | 用户数字 ID(可作为 rest_id 参数使用) |
| data.name | string | 显示昵称 |
| data.desc | string | 简介 |
| data.sub_count | int | 粉丝数 |
| data.friends | int | 关注数 |
| data.statuses_count | int | 推文总数 |
| data.media_count | int | 媒体推文数 |
| data.blue_verified | bool | 是否蓝 V |
| data.avatar | string | 头像 URL |
| data.header_image | string | 主页横幅图 URL |
| data.website | string | 主页外链 |
请求示例 · cURL
curl 'https://api.spiderhubs.com/openapi/v1/contentcreator/twitter/web/fetch_user_profile?screen_name=elonmusk' \
-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx'响应示例
{
"code": 200,
"request_id": "44b7dbe5-3f18-4910-ae38-3f5cf51d9e41",
"data": {
"status": "active",
"profile": "elonmusk",
"rest_id": "44196397",
"blue_verified": true,
"avatar": "https://pbs.twimg.com/profile_images/...jpg",
"header_image": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"desc": "Starmind",
"name": "Elon Musk",
"website": "https://www.spacex.com/...",
"protected": false,
"location": "",
"friends": 1370,
"sub_count": 240919657,
"statuses_count": 105668,
"media_count": 4620,
"id": "44196397"
}
}开始调用 SpiderHubs API
使用账户中心生成的 API Key,通过 Authorization: Bearer sk_live_xxx 调用接口。