# Xiaohongshu Hashtag API (xiaohongshu.hashtag)

- Canonical page: https://everyinfra.com/en/xiaohongshu-api/hashtag
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "xiaohongshu", "action": "hashtag", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of up to 20 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| topic_id | not declared | yes | not declared | The topic page ID for hashtag (24 characters), or a topic page link such as https://www.xiaohongshu.com/page/topics/<ID>, an app topic link or a Xiaohongshu short share link. The topics[].topic_id values returned by note work directly. It is not the ID of a note's tag object or the topic name. |
| page_token | not declared | no | not declared | Pagination cursor for the comments, sub_comments, search, user_posts, search_users and hashtag actions: pass back the next_page_token value from a row of the previous response to fetch the next page; omit it to start from the first page. Each page is one call, billed per request. |
| sort | enum: newest / popular | no | not declared | Order of the topic's notes: newest puts the latest first (the same as omitting it) and popular puts the most popular first. Keep the same value while paging. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | The record's link on Xiaohongshu. Links from search, note, profile and hashtag usually carry an access token, so they open in a signed-out browser (the token expires; call again for a fresh link). Note links from user_posts carry no token and need one to open in a browser: call note with the note ID to get a link that opens. Profile links from search_users carry no token either; call profile with the user_id for one that opens. Note links from pgy_content_square carry a token, except with `keyword`, where they carry none. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| text | Note body or comment text. note and hashtag return the full body; search and user_posts may return a truncated excerpt (up to about 60 and 100 characters respectively). Call note with the note ID for the full text. |
| like_count | Like count. On note and comment results, the likes on that item; on profile, the total likes the account's notes have received. null means not public or not returned this time, not zero. |
| collect_count | Save count. On note results, how many times that note was saved; on profile, the total saves across the account's notes. null means not public or not returned this time, not zero. |
| comment_count | Comments. null means not disclosed, not 0. |
| share_count | Shares. null means not disclosed, not 0. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| image_url | Image link. Capabilities with several images may return an image_urls array. |
| author_name | Author's display name. |
| author_id | The author's user ID. Pass it to profile or user_posts. Note results carry the 24-character ID from profile URLs; comment results (comments, comments_batch, sub_comments) usually carry a different 29-character form. The two forms of one person do not match, so convert them with the user_id that profile returns before de-duplicating across batches. |
| avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
| author_url | The author's profile link. It carries no access token, so a signed-out browser cannot open it; the url that profile returns for the author_id opens directly. |
| is_video | Whether the note is a video note. The play URL is NOT part of the note detail response (since 2026-10-14): call the separate video action with the same note URL to fetch it; each call is billed per call. |
| next_page_token | Page token (search, comments, sub_comments, user_posts, search_users, hashtag): pass it back unchanged as page_token, with the other parameters the same, to fetch the next page. |
| video_url | Video playback link (MP4), signed and expiring; download promptly if you need to keep it. null for image notes or when not returned. It appears on search/user_posts rows and in the separate video action; the note detail does not carry it (since 2026-10-14) — call the video action with the same note URL when you need the play link. |
| duration_sec | Video length in seconds. null for image notes or when it was not returned this time. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| images | Image links. On note, hashtag, search and user_posts, every image of the note in order. On comment results (comments, comments_batch, sub_comments), the images attached to the comment, stickers included; an empty array means none. null means this item was not returned this time. |

## 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": "hashtag",
  "params": {
    "topic_id": "5be3ef92a514290001a15147"
  }
}'
```

```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": "hashtag",
        "params": {
            "topic_id": "5be3ef92a514290001a15147",
        },
    },
    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; the list keeps the first 2 of 18. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "xiaohongshu",
  "action": "hashtag",
  "results": [
    {
      "id": "6adcf9ce000000002a02aa53",
      "url": "https://www.xiaohongshu.com/explore/6adcf9ce000000002a02aa53?xsec_token=FBguhMknWemCgqYU8sbFRwAQQTt1uvZ-Fdz-Fi4p9ejxw%3D",
      "title": "提拉米苏",
      "text": "#星巴克[话题]# #提拉米苏[话题]# #贝果三明治[话题]#",
      "like_count": 0,
      "collect_count": 0,
      "comment_count": 0,
      "share_count": 0,
      "posted_at": "2026-10-24T18:32:47+00:00",
      "image_url": "https://sns-na-i2.xhscdn.com/1040g008326nfm9r5lq5g5pe4smi4alonjl0mrhg?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=22&sc=LF_PRV&sign=c51ee6a96b89f340c8ec4ad13fda0469&t=6add00a2",
      "author_name": "•••",
      "author_id": "•••",
      "avatar_url": "https://sns-avatar-qc.xhscdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/•••",
      "is_video": false,
      "next_page_token": "n1.tWzE3OTI4NjIyOTAwMDAsIjZhZGNlODUyMDAwMDAwMDAyNTAyMjAyYyIsIkxZRG03V3VzM1ByV3JDZHNxTEtGb3ciXQ",
      "video_url": null,
      "duration_sec": null,
      "platform": "xiaohongshu",
      "images": [
        "https://sns-na-i2.xhscdn.com/1040g008326nfm9r5lq5g5pe4smi4alonjl0mrhg?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=22&sc=LF_PRV&sign=c51ee6a96b89f340c8ec4ad13fda0469&t=6add00a2",
        "https://sns-na-i2.xhscdn.com/1040g008326nfm9r5lq3g5pe4smi4alon85o1dog?imageView2/2/w/540/format/webp|imageMogr2/strip&redImage/frame/0"
      ],
      "duration_seconds": null
    },
    {
      "id": "6adcf8b3000000002a02a99b",
      "url": "https://www.xiaohongshu.com/explore/6adcf8b3000000002a02a99b?xsec_token=FBguhMknWemCgqYU8sbFRwARusWG8xYkzW1rDs95JQxQk%3D",
      "title": "",
      "text": "一顆心，只為你。#安乾镐[话题]# #keonho[话题]# #营业图[话题]# #星巴克[话题]# #热点[话题]#",
      "like_count": 3,
      "collect_count": 0,
      "comment_count": 0,
      "share_count": 0,
      "posted_at": "2026-10-24T18:28:03+00:00",
      "image_url": "https://sns-na-i2.xhscdn.com/notes_pre_post/1040g3k0326nfehtr5q105q92os8tp6j1dn10jko?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=22&sc=LF_PRV&sign=bd0e8a7248ede2cf3b3bc3f1a97ed2bd&t=6add00a2",
      "author_name": "•••",
      "author_id": "•••",
      "avatar_url": "https://sns-avatar-qc.xhscdn.com/•••",
      "author_url": "https://www.xiaohongshu.com/•••",
      "is_video": false,
      "next_page_token": "n1.tWzE3OTI4NjIyOTAwMDAsIjZhZGNlODUyMDAwMDAwMDAyNTAyMjAyYyIsIkxZRG03V3VzM1ByV3JDZHNxTEtGb3ciXQ",
      "video_url": null,
      "duration_sec": null,
      "platform": "xiaohongshu",
      "images": [
        "https://sns-na-i2.xhscdn.com/notes_pre_post/1040g3k0326nfehtr5q105q92os8tp6j1dn10jko?imageView2/2/w/608/format/heif/q/56|imageMogr2/strip&redImage/frame/0/enhance/4&ap=22&sc=LF_PRV&sign=bd0e8a7248ede2cf3b3bc3f1a97ed2bd&t=6add00a2",
        "https://sns-na-i2.xhscdn.com/notes_pre_post/1040g3k0326nfehtr5q1g5q92os8tp6j1l2aufco?imageView2/2/w/540/format/webp|imageMogr2/strip&redImage/frame/0"
      ],
      "duration_seconds": null
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 18,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## 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
