탐색으로 건너뛰기

What are xsec_token, x-s, x-t, and error 300011 on Xiaohongshu?

Markdown으로 보기

xsec_token, x-s, and x-t are Xiaohongshu’s access-control and request-signing parameters, and 300011, 300012, and 300013 are the account and session risk-control codes returned when a logged-in Xiaohongshu scraper session is flagged. Calling Xiaohongshu through BeatAPI (POST https://api.beatapi.io/v1/social-data/call or https://beatapi.io/mcp) handles signing on the gateway side; note search, details, and comments cost $0.03 per request ($0.06 for PGY; checked 2026-11-24; failed gateway calls cost $0).

Xiaohongshu anti-bot tokens and error codes explained

ItemMeaning on XiaohongshuWhy direct scrapers fail
xsec_tokenShort-lived per-note access token attached to note links returned by search or feed APIs (?xsec_token=...&xsec_source=...)Opening a bare /explore/<note_id> link without a fresh xsec_token returns 404, empty detail, or a login prompt
x-s and x-tRequest signature header (x-s, paired with x-s-common) and millisecond timestamp (x-t) produced by obfuscated web JSXiaohongshu web bundle updates invalidate local signers and trigger HTTP 461
300011Account anomaly or login risk blockTriggers on local Playwright scripts and xiaohongshu-mcp instances running on cloud or overseas IPs
300012 / 300013Session verification or frequency-limit risk codesIndicates that the web_session + a1 cookie pair or exit IP has been throttled or gated behind a captcha

How to call BeatAPI Xiaohongshu actions without cookies or signing

Pass a plain keyword, note_id, or share_text to POST https://api.beatapi.io/v1/social-data/call with no xsec_token, x-s, x-t, or web_session cookies:

curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"xiaohongshu.app_v2.search_notes","params":{"keyword":"露营咖啡机","page":1,"sort_type":"comment_descending"}}'

Example search response (live-sampled 2026-11-23, anonymized)

{
"object": "social_data.call",
"status": "succeeded",
"request_id": "202611260732156684925978268d9d6yOLdMCKV",
"action": "xiaohongshu.app_v2.search_notes",
"data": {
"code": 0,
"success": true,
"page": 1,
"next_page": 2,
"search_id": "2eExampleSearchId",
"data": {
"items": [
{
"note": {
"id": "6a9c5884000000002b002d95",
"title": "Sample coffee machine review"
}
}
]
}
},
"usage": {
"billing_unit": "request",
"quantity": 1,
"price_usd": "0.03",
"price_version": "sd_20cf7d377ad9"
}
}

On xiaohongshu.app_v2.get_note_comments and Xiaohongshu detail actions, an invalid note_id or unparseable link can return HTTP 200 with an upstream business error inside data and still be billed. Pull note.id from a verified search response or valid share link first (see Xiaohongshu business errors).