XHS Data API Open in RapidAPI

Available on RapidAPI

XHS Data API

Structured public Xiaohongshu data for note, media, comment, and author workflows. Normalized responses, real cursor pagination, and request-level traceability.

22
public endpoints
50
URLs per async batch
JSON
consistent response contract

Quick start

One request to normalized note data

Subscribe on RapidAPI, keep the key on your server, and use a current public note URL containing its matching xsec_token.

curl --request GET \
  --url 'https://xhs-data-api.p.rapidapi.com/note/detail_from_url?url=PUBLIC_NOTE_URL' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header 'X-RapidAPI-Host: xhs-data-api.p.rapidapi.com'
import os
import requests

response = requests.get(
    "https://xhs-data-api.p.rapidapi.com/note/detail_from_url",
    headers={
        "X-RapidAPI-Key": os.environ["X_RAPIDAPI_KEY"],
        "X-RapidAPI-Host": "xhs-data-api.p.rapidapi.com",
    },
    params={"url": os.environ["XHS_NOTE_URL"]},
    timeout=45,
)
response.raise_for_status()
note = response.json()["data"]["note"]
const params = new URLSearchParams({
  url: process.env.XHS_NOTE_URL,
});

const response = await fetch(
  `https://xhs-data-api.p.rapidapi.com/note/detail_from_url?${params}`,
  { headers: {
      "X-RapidAPI-Key": process.env.X_RAPIDAPI_KEY,
      "X-RapidAPI-Host": "xhs-data-api.p.rapidapi.com",
  }},
);
const { data } = await response.json();

RapidAPI supplies the gateway headers. No additional backend API key is required.

Endpoint coverage

Focused public-data primitives

Use small composable endpoints for interactive requests, or sequential asynchronous jobs for larger imports.

Notes and media

Parse URLs, retrieve rich note details, inspect image/video/music availability, and combine detail with one comment page.

/note/detail_from_url

Comments

Read normalized top-level comments with resource-bound cursors and duplicate protection across a valid chain.

/note/comments_from_url

Authors and posts

Retrieve identity-bound profiles, cursor-paginated published notes, combined overviews, and coverage-aware metrics.

/user/overview_from_url

Batch processing

Use synchronous partial-result batches or submit up to 50 URLs to a durable, sequential asynchronous worker.

/note/async_batch_detail_from_url

Integration workflows

Built for predictable continuation

  1. 01

    Validate the resource

    Parse a complete public note or author URL before an upstream fetch. Keep current signed note URLs out of source control.

    GET /note/parse_url
  2. 02

    Request normalized data

    Use the detail, media, profile, or overview endpoint that matches the job. Optional missing fields remain null, never fabricated zeroes.

    GET /note/detail_from_url
  3. 03

    Continue with returned cursors

    Start without a cursor, then pass the exact data.next_cursor while keeping the original resource unchanged.

    data.has_more
  4. 04

    Trace and recover

    Honor Retry-After, retry the same cursor after temporary failures, and include data.request_id with support requests.

    data.request_id

Response contract

Useful errors, stable envelopes

Success and failure responses remain machine-readable. Sensitive provider state, cookies, credentials, and request headers are never included in raw output.

Read the full endpoint documentation
{
  "code": 200,
  "msg": "success",
  "data": {
    "request_id": "support-id",
    "cursor": null,
    "next_cursor": "service-issued-cursor",
    "has_more": true,
    "count": 10,
    "items": []
  }
}

Know before shipping

Source-aware by design

The API preserves uncertainty so client applications can make honest decisions about upstream coverage.

Note detail and comment requests need a current public URL with its matching xsec_token.

Signed media URLs and public-link tokens can expire. Use them promptly and refresh when needed.

null means the upstream source did not provide a field. It must not be interpreted as zero.

This public version focuses on stable note and author workflows. Note search and child-comment replies are not advertised.

XHS Data API logo

Start building

Test every endpoint in the RapidAPI Playground

Open XHS Data API