> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

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

> Technical breakdown of Xiaohongshu's xsec_token, x-s/x-t signing headers, and 300011/300012/300013 risk codes, plus stateless BeatAPI endpoints ($0.03/request) that require no cookies.

`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

| Item                    | Meaning on Xiaohongshu                                                                                                       | Why direct scrapers fail                                                                                           |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **`xsec_token`**        | Short-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-t`**     | Request signature header (`x-s`, paired with `x-s-common`) and millisecond timestamp (`x-t`) produced by obfuscated web JS   | Xiaohongshu web bundle updates invalidate local signers and trigger HTTP `461`                                     |
| **`300011`**            | Account anomaly or login risk block                                                                                          | Triggers on local Playwright scripts and `xiaohongshu-mcp` instances running on cloud or overseas IPs              |
| **`300012` / `300013`** | Session verification or frequency-limit risk codes                                                                           | Indicates 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:

**`Search notes ($0.03)`**

```bash title="Search notes ($0.03)"
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"}}'
```

**`Fetch note comments ($0.03)`**

```bash title="Fetch note comments ($0.03)"
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.get_note_comments","params":{"note_id":"<note_id>","cursor":"","index":0,"pageArea":"UNFOLDED","sort_strategy":"latest_v2"}}'
```

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

```json
{
  "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](/faq/xiaohongshu-business-errors)).

## Related

* [Fix Xiaohongshu HTTP 461](/faq/xiaohongshu-461-status-code)
* [Xiaohongshu MCP without login](/faq/xiaohongshu-mcp-without-login)
* [Fetch Xiaohongshu note comments](/guides/xiaohongshu-note-comments)