# user_profile

POST /v1/user_profile 是“账号资料”动作：一个账号的简介和数据。目前在 17 个平台上开放（TikTok、Instagram、X、Reddit、YouTube、Facebook 等），平台是请求里的一个参数。每次调用 1 到 12 积分，因平台而异；失败的调用不扣。

- 页面：https://socialtoai.com/zh/docs/api/user-profile/
- 最近更新：2026-10-17

- POST: `https://api.socialtoai.com/v1/user_profile`

## 请求

请求体是 JSON。下面这几项每个动作都一样，其余的参数因平台而异，见后文。

| 名称 | 类型 | 位置 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `platform` | string | 请求体 | 是 | 要读的平台，取这个动作已开放的平台之一。 |
| `max_cost_credits` | integer | 请求体 | 否 | 这次调用最多花多少积分。超出时免费拒绝，并在返回里给出报价。 |
| `Idempotency-Key` | string | 请求头 | 否 | 1 到 255 个可见 ASCII 字符。同一个键加同样的参数会返回第一次的结果，不会重复扣费。 |

## 平台与积分

每个平台收的参数不同。平台自己的页面上有完整的参数表、字段表和可以改的请求。

| 平台 | 价格键 | 积分 | 必填 | 可选 | 每页 |
| --- | --- | --- | --- | --- | --- |
| [TikTok](https://socialtoai.com/zh/tiktok-user-profile-api.md) | `tiktok.user_profile` | 2 | `id`、`username` 里给一个 | – | – |
| [Instagram](https://socialtoai.com/zh/instagram-user-profile-api.md) | `instagram.user_profile` | 2 | `username` | – | – |
| [X](https://socialtoai.com/zh/x-user-profile-api.md) | `x.user_profile` | 1 | `id`、`username` 里给一个 | – | – |
| [Reddit](https://socialtoai.com/zh/reddit-user-profile-api.md) | `reddit.user_profile` | 2 | `username` | – | – |
| [YouTube](https://socialtoai.com/zh/youtube-user-profile-api.md) | `youtube.user_profile` | 2 | `id`、`username` 里给一个 | – | – |
| [Facebook](https://socialtoai.com/zh/facebook-user-profile-api.md) | `facebook.user_profile` | 2 | `id`、`username`、`url` 里给一个 | – | – |
| [LinkedIn](https://socialtoai.com/zh/linkedin-user-profile-api.md) | `linkedin.user_profile` | 2 | `username`、`url` 里给一个 | – | – |
| [Threads](https://socialtoai.com/zh/threads-user-profile-api.md) | `threads.user_profile` | 2 | `username` | – | – |
| [Telegram](https://socialtoai.com/zh/telegram-user-profile-api.md) | `telegram.user_profile` | 2 | `username` | – | – |
| [小红书](https://socialtoai.com/zh/xiaohongshu-user-profile-api.md) | `xiaohongshu.user_profile` | 12 | `id`、`url` 里给一个 | – | – |
| [抖音](https://socialtoai.com/zh/douyin-user-profile-api.md) | `douyin.user_profile` | 2 | `id`、`url` 里给一个 | – | – |
| [微博](https://socialtoai.com/zh/weibo-user-profile-api.md) | `weibo.user_profile` | 2 | `id` | – | – |
| [公众号](https://socialtoai.com/zh/wechat-user-profile-api.md) | `wechat.user_profile` | 12 | `id` | – | – |
| [B 站](https://socialtoai.com/zh/bilibili-user-profile-api.md) | `bilibili.user_profile` | 2 | `id` | – | – |
| [知乎](https://socialtoai.com/zh/zhihu-user-profile-api.md) | `zhihu.user_profile` | 2 | `username` | – | – |
| [快手](https://socialtoai.com/zh/kuaishou-user-profile-api.md) | `kuaishou.user_profile` | 12 | `id` | – | – |
| [视频号](https://socialtoai.com/zh/wechat-channels-user-profile-api.md) | `wechat_channels.user_profile` | 12 | `id` | – | – |

## 参数

| 名称 | 类型 | 说明 | 哪些平台收 |
| --- | --- | --- | --- |
| `id` | string | TikTok 用户编号，一串数字 | TikTok、X、YouTube、Facebook、小红书、抖音、微博、公众号、B 站、快手和视频号 |
| `username` | string | TikTok 账号名，不带 @ | TikTok、Instagram、X、Reddit、YouTube、Facebook、LinkedIn、Threads、Telegram和知乎 |
| `url` | string | 主页链接，facebook.com/账号名 的写法 | Facebook、LinkedIn、小红书和抖音 |

## 示例

TikTok：一个账号：名称、简介、粉丝数、关注数和作品数。

**cURL**

```
curl https://api.socialtoai.com/v1/user_profile \
  -H "Authorization: Bearer $SOCIALTOAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "id": "6767146744805213190"
  }'
```

**Python**

```
import os
import requests

response = requests.post(
    "https://api.socialtoai.com/v1/user_profile",
    headers={"Authorization": f"Bearer {os.environ['SOCIALTOAI_KEY']}"},
    json={
        "platform": "tiktok",
        "id": "6767146744805213190",
    },
)
print(response.json())
```

**返回** (200 OK, 2 积分)

```
{
  "request_id": "req_00000000-0000-4000-8000-000000000001",
  "schema_version": "v1",
  "fetched_at": "2026-10-12T19:16:32.000Z",
  "action": "user_profile",
  "platform": "tiktok",
  "status": "ok",
  "items": [
    {
      "platform": "tiktok",
      "id": "…",
      "ref": "…",
      "approx": [],
      "type": "account",
      "username": "…",
      "name": "…",
      "url": "https://example.com/…",
      "bio": "…",
      "verified": true,
      "followers": 605660,
      "following": 92,
      "posts_count": 364
    }
  ],
  "unavailable": [],
  "warnings": [],
  "applied_params": {
    "id": "6767146744805213190"
  },
  "cost_credits": 2,
  "billing": {
    "cost_credits": 2,
    "balance_credits": 98,
    "today_spend_credits": 2,
    "daily_limit_credits": null,
    "daily_remaining_credits": null,
    "display": "本次 2 积分，余额 98 积分"
  },
  "replayed": false
}
```

_示例数据：名字、链接和正文已换成占位符。_

## 返回什么

返回[外层结构](https://socialtoai.com/zh/docs/api/response.md)，`items` 里是 [`account`](https://socialtoai.com/zh/docs/api/response.md) 对象。一次调用返回一个对象。

失败的调用是 0 积分，并说明原因，见[错误](https://socialtoai.com/zh/docs/api/errors.md)。
