# 小红书 主页或对象详情 API (xiaohongshu.profile)

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

小红书主页详情按 `user_id` 读取一个账号的资料：昵称、小红书号、简介、头像、性别、IP 归属地、认证信息、粉丝数和关注数、笔记数，以及笔记累计获得的点赞与收藏。品牌方、代理机构和研究者常在筛选达人、谈合作或把账号加入监测名单之前，用它核实账号有多大、粉丝有多活跃。

`user_id` 可以是主页链接里 /user/profile/ 后面的 ID、主页链接本身，或评论结果里评论者的作者 ID。这里的 `follower_count` 是精确值，不像用户搜索里是换算的约数；不公开的计数返回 null，不是 0。`ip_location` 是平台标的省份或国家，不是本人填写的地区。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | 小红书用户主页 /user/profile/ 后面的用户 ID，或完整用户主页 URL；也可以直接用评论类结果里的 author_id。用于读取该账号资料或其发布的笔记，不是昵称。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | 用户在原平台的唯一 ID。 |
| nickname | 用户昵称。 |
| red_id | 小红书号，用户自定义的可搜索 ID，区别于内部 user_id。 |
| url | 该记录在小红书上的链接。search、note、profile、hashtag 返回的链接一般带访问令牌，未登录的浏览器也能打开（令牌有时效，过期后重新调用即可）；user_posts 返回的笔记链接不带令牌，在浏览器里打开需要令牌：用笔记 ID 调 note 能拿到可以打开的链接；search_users 返回的主页链接同样不带令牌，用 user_id 调 profile 拿能打开的链接。pgy_content_square 不带 keyword 时笔记链接带令牌，带 keyword 时不带（用笔记 ID 调 note 拿能打开的链接）。followers_list 返回的是粉丝的主页链接，同样不带令牌；note_location 返回的笔记链接带上了请求里的令牌（请求里没带就没有）。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| follower_count | 粉丝数。profile 里是精确值；search_users 里是从列表展示的「粉丝 1.2万」换算的近似值（1.2万 → 12000）；followers_list 里是这位粉丝自己的粉丝数。null 表示不公开或没认出来，不等于 0。 |
| following_count | 关注数。null 表示不公开，不等于 0。 |
| like_collect_count | 主页上的「获赞与收藏」：该账号笔记累计获得的点赞数与被收藏数之和。拆开的两个数见 like_count、collect_count。 |
| post_count | 发布内容总数。null 表示不公开，不等于 0。 |
| gender | 用户性别，按主页展示值给出，可能为空。 |
| ip_location | 小红书展示的 IP 归属地（省份/国家），平台强制显示，非用户填写。user_posts 只有部分笔记带。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| tags | 标签列表：note 是笔记的话题标签；profile 是主页上展示的个人标签（如星座、地区）；reviews 是这条评价被打上的评价标签（如 质量很好），没有时没有这个字段。按页面原文。 |
| like_count | 点赞数。笔记、评论类结果是这条内容的点赞数；reviews 是这条商品评价被点「有用」的次数；profile 里是该账号所有笔记累计获得的点赞数。null 表示不公开或这次没拿到，不等于 0。 |
| collect_count | 收藏数。笔记类结果是这篇笔记被收藏的次数；profile 里是该账号笔记累计被收藏的次数。null 表示不公开或这次没拿到，不等于 0。 |
| real_name_info | 主页上展示的实名信息原文；没有时没有这个字段。 |
| verification_type | 认证类型（search_users、profile）：individual 个人认证、business 企业认证、other 其他认证；未认证的账号没有这个字段。 |
| verification_text | 主页上的认证说明原文（profile）。 |
| location | 地理位置描述，原文透传，格式随平台而异。 |
| 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": "xiaohongshu",
  "action": "profile",
  "params": {
    "user_id": "5bec178863f51f0001859bd9"
  }
}'
```

```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": "xiaohongshu",
        "action": "profile",
        "params": {
            "user_id": "5bec178863f51f0001859bd9",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "xiaohongshu",
  "action": "profile",
  "results": {
    "user_id": "5bec178863f51f0001859bd9",
    "nickname": "•••",
    "red_id": "536248807",
    "url": "https://www.xiaohongshu.com/user/profile/5bec178863f51f0001859bd9?xsec_token=YBa43WesDF2ZG-HMGXVxTlt0t4eJdIhAYkDoVSOA1K-Ew%3D",
    "bio": "人生的觉醒消失于人群之中",
    "follower_count": 2114,
    "following_count": 49,
    "like_collect_count": 16889,
    "post_count": 752,
    "gender": 0,
    "ip_location": "•••",
    "avatar_url": "https://sns-avatar-qc-ae.rednotecdn.com/•••",
    "is_verified": false,
    "tags": [
      "白羊座",
      "江苏扬州",
      "旅行博主"
    ],
    "like_count": 15178,
    "collect_count": 1711,
    "location": "中国  江苏  扬州",
    "platform": "xiaohongshu"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `like_collect_count` 是什么？

就是主页上的「获赞与收藏」：账号所有笔记累计获得的点赞数加被收藏数。拆开的两个数分别在 `like_count` 和 `collect_count`，可以看出粉丝更爱点赞，还是更爱收藏起来回看。

### 该存 `user_id` 还是 `red_id`？

两个都存，但用 `user_id` 做主键：它是传回本能力和用户内容能力的那个 ID。`red_id` 是账号自己设置、用户在 App 里搜索时输入的小红书号，适合展示，或者用来对上别人发给你的号。

### 返回的主页链接能在浏览器里打开吗？

通常可以。这里返回的链接一般带访问令牌，未登录也能打开，令牌过期后重新调用会拿到新的。用户搜索返回的主页链接、用户内容返回的笔记链接不带令牌，所以那两个能力会让你回到这里，或去笔记详情拿可以打开的链接。

## Also

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