If you have tried to build a Python pipeline, AI agent, or brand monitoring workflow for Xiaohongshu (小红书 / RedNote) in 2026, you have almost certainly hit the infamous error_code=300031 wall:
https://www.xiaohongshu.com/404?source=web&error_code=300031&error_msg=当前笔记暂时无法浏览
# "Note temporarily inaccessible" — even though the post is 100% live in the app!
Across developer forums and open-source repositories, conventional wisdom claims that bare https://www.xiaohongshu.com/explore/<24-hex-id> URLs are impossible to scrape without a live ?xsec_token=... parameter and a logged-in +86 personal cookie. Teams end up running fragile local headless browsers, scanning QR codes every morning, and watching their personal accounts get restricted after 50 requests.
In this engineering guide, we explain why standard scrapers trigger 300031, -100, and 300011—and provide copy-paste Python (apify-client), REST cURL, and Hosted MCP (mcp.apify.com) implementations that extract bare /explore/<id> posts, 300+ note keyword searches, and 250–1,000+ multi-page comments per post with zero xsec_token parameters and zero login cookies.
1. Why Standard Scrapers Fail with 300031, -100, and 300011#
When you inspect Xiaohongshu traffic in browser DevTools, three separate enforcement layers break traditional scraping scripts:
| Error Code | Message / Symptom | Root Cause in DIY Scrapers |
|---|---|---|
300031 | 当前笔记暂时无法浏览 (Note temporarily inaccessible) | Navigating to a bare /explore/<24-hex> URL without a fresh ?xsec_token=...&xsec_source=... token, or replaying a saved xsec_token outside the session or TTL window that minted it. |
-100 | Mandatory QR / +86 SMS login modal | Calling web search or comment pagination as a guest visitor without an authenticated session state. |
300011 / 461 | Account abnormal / Slide verification wall | Rotating high-concurrency queries through a personal logged-in account cookie or datacenter IP range, triggering permanent account restrictions. |
Why Saving xsec_token Links Breaks Downstream Pipelines
Even if your scraper harvests full URLs containing ?xsec_token=... during an authenticated search run, storing those tokens in Postgres, Snowflake, or Airtable for later hydration still fails:
xsec_tokenIs Ephemeral & Context-Bound: Tokens expire and are tied to the originating feed context (pc_search,pc_feed,pc_user). Re-fetching a stored URL 24 hours later to track engagement velocity (likedCount,collectedCount,commentCount) returns300031.- External Links Never Have
xsec_token: Note IDs shared in PR trackers, CRM spreadsheets, affiliate briefs, orxhslink.comshortlinks arrive as plain 24-character hex IDs or bare/explore/<id>URLs. - Personal Cookie Rotation Does Not Scale: Buying or maintaining
+86SIM cards for headless browser pools introduces compliance risk and constant manual QR re-authentication.
Instead of managing accounts or browser sessions locally, UnitBytes resolves bare Note IDs, keyword searches, and comment threads in the cloud on Apify—with $5.00 in free monthly Apify platform credit included on every free account (~2,200+ notes/month at $0 out-of-pocket cost).
2. Fix 300031: Hydrate Bare /explore/<id> URLs Without xsec_token#
Using the Xiaohongshu Trend & Post Scraper (Run on Apify Store), you can pass any of the following directly inside startUrls with mode: "notes":
- Bare web URLs:
https://www.xiaohongshu.com/explore/660000000000000000000001 - Discovery links:
https://www.rednote.com/discovery/item/660000000000000000000001 - Mobile app share shortlinks:
http://xhslink.com/a/xxxxxx
Each hydrated post returns full caption text (desc), likedCount, collectedCount, commentCount, shareCount, high-resolution carousel images, watermark-free videoUrl (for video notes), tags, publish timestamp, and author metadata starting at $1.50 / 1,000 notes ($0.0015 Gold+; $0.0022 Free).
Python (apify-client) — Bare /explore/<id> Hydration
pip install apify-client
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
# Pass bare /explore/<24-hex> URLs or xhslink.com shortlinks — NO xsec_token needed
run_input = {
"mode": "notes",
"startUrls": [
{"url": "https://www.xiaohongshu.com/explore/660000000000000000000001"},
{"url": "https://www.xiaohongshu.com/explore/660000000000000000000002"},
],
"maxItems": 2,
"enrichDetails": True,
}
run = client.actor("unitbytes/xiaohongshu-rednote-trend-scraper").call(run_input=run_input)
for note in client.dataset(run["defaultDatasetId"]).iterate_items():
print(
note["noteId"],
note.get("title"),
f"likes={note.get('likedCount')} saves={note.get('collectedCount')} comments={note.get('commentCount')}",
)
Synchronous REST cURL — Bare URL to JSON in One Request
curl -s -X POST \
"https://api.apify.com/v2/acts/unitbytes~xiaohongshu-rednote-trend-scraper/run-sync-get-dataset-items?format=json&clean=true" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "notes",
"startUrls": [
{"url": "https://www.xiaohongshu.com/explore/660000000000000000000001"}
],
"maxItems": 1,
"enrichDetails": true
}'
3. Run 300+ Note Keyword Searches Without Login (-100 Bypass)#
If your goal is pure keyword discovery, share-of-voice tracking, or D2C competitor monitoring, the dedicated RedNote Keyword Search Scraper (Run on Apify Store) exposes a streamlined 5-field JSON schema with no mode selector required:
keywords: Array of Chinese or English search queries (e.g.["skincare", "早C晚A", "Lululemon"])sort:"popularity_descending"(most liked),"general"(relevance), or"time_descending"(newest)noteType:"all","video_only", or"image_only"maxItems: Up to300+unique notes per keywordenrichDetails: Hydrates full post descriptions, tags, high-res image carousels, and MP4 video streams (trueby default)
Python (apify-client) — 5-Field Keyword Search API
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
search_input = {
"keywords": ["skincare", "早C晚A"],
"sort": "popularity_descending",
"noteType": "all",
"maxItems": 120,
"enrichDetails": True,
}
run = client.actor("unitbytes/rednote-xiaohongshu-search-scraper").call(run_input=search_input)
notes = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Retrieved {len(notes)} unique Xiaohongshu notes")
Synchronous REST cURL — Keyword Search API
curl -s -X POST \
"https://api.apify.com/v2/acts/unitbytes~rednote-xiaohongshu-search-scraper/run-sync-get-dataset-items?format=json&clean=true" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"keywords": ["敏感肌防晒"],
"sort": "popularity_descending",
"noteType": "video_only",
"maxItems": 50,
"enrichDetails": true
}'
4. Scrape 250–1,000+ Xiaohongshu Comments & Inline Replies in Python#
Standard web scrapers hit a login wall after the first 10 preview comments—or fail outright with 300031 when given a bare post URL.
The RedNote Comments & Replies Scraper (Run on Apify Store) paginates 250 to 1,000+ engagement-ranked root comments per post directly from bare /explore/<24-hex> URLs, xhslink.com links, or search keywords, starting at $1.99 / 1,000 comments ($0.00199 Gold+; $0.00249 Free).
楼中楼) CoverageWhen
includeSubComments: True is enabled, up to 3 top inline replies per root comment are extracted zero-login (maxSubCommentsPerComment: 3), while subCommentCount reports the exact total reply count on each thread alongside commenter ipLocation and automated sentiment.isBuyerIntent classification.Python (apify-client) — Multi-Page Comments from Bare URL
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
comments_input = {
"mode": "comments",
"startUrls": [
{"url": "https://www.xiaohongshu.com/explore/660000000000000000000001"}
],
"maxCommentsPerNote": 300,
"includeSubComments": True,
"maxSubCommentsPerComment": 3,
}
run = client.actor("unitbytes/xiaohongshu-rednote-comments-scraper").call(run_input=comments_input)
comments = list(client.dataset(run["defaultDatasetId"]).iterate_items())
buyer_questions = [
c for c in comments if (c.get("sentiment") or {}).get("isBuyerIntent")
]
print(f"Scraped {len(comments)} comments ({len(buyer_questions)} buyer-intent questions)")
Synchronous REST cURL — Multi-Page Comments
curl -s -X POST \
"https://api.apify.com/v2/acts/unitbytes~xiaohongshu-rednote-comments-scraper/run-sync-get-dataset-items?format=json&clean=true" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "comments",
"startUrls": [
{"url": "https://www.xiaohongshu.com/explore/660000000000000000000001"}
],
"maxCommentsPerNote": 100,
"includeSubComments": true,
"maxSubCommentsPerComment": 3
}'
5. Connect Claude Code, Cursor & Windsurf via Hosted MCP (mcp.apify.com)#
Building an AI research agent in Claude Code, Cursor, Windsurf, or VS Code? Instead of installing a 1.5 GB local browser MCP wrapper that breaks on 300031, point your MCP client directly at Apify's official Streamable HTTP MCP gateway pre-loaded with all 6 UnitBytes RedNote tools:
Cursor (~/.cursor/mcp.json) / Windsurf Config
{
"mcpServers": {
"rednote-xiaohongshu": {
"url": "https://mcp.apify.com/?tools=fetch-actor-details,get-actor-run,get-dataset-items,unitbytes/rednote-xiaohongshu-search-scraper,unitbytes/xiaohongshu-rednote-trend-scraper,unitbytes/xiaohongshu-rednote-comments-scraper,unitbytes/xiaohongshu-rednote-profile-scraper,unitbytes/xiaohongshu-rednote-live-scraper,unitbytes/xiaohongshu-scraper",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}
Claude Code CLI One-Liner
claude mcp add --transport http rednote-xiaohongshu \
"https://mcp.apify.com/?tools=fetch-actor-details,get-actor-run,get-dataset-items,unitbytes/rednote-xiaohongshu-search-scraper,unitbytes/xiaohongshu-rednote-trend-scraper,unitbytes/xiaohongshu-rednote-comments-scraper,unitbytes/xiaohongshu-rednote-profile-scraper,unitbytes/xiaohongshu-rednote-live-scraper,unitbytes/xiaohongshu-scraper" \
--header "Authorization: Bearer YOUR_APIFY_TOKEN"
6. Choosing the Right Engine Across the 6-Actor RedNote Suite#
Every engine below runs 100% cookieless in the cloud, includes ready-to-import n8n AI Workflow Templates, and bills strictly Pay-Per-Event:
| RedNote Cloud Engine | Primary Developer Use Case | Gold+ Rate (Free Tier) | Cloud Console |
|---|---|---|---|
| RedNote Keyword Search Scraper | Pure 5-field cookieless keyword search (300+ notes/query, sort, noteType) | $1.50 / 1K notes ($2.20 Free) | Run on Apify Store |
| Xiaohongshu Trend & Post Scraper | Bare /explore/<id> hydration (no xsec_token), keyword search & 13 trend channels | $1.50 / 1K notes ($2.20 Free) | Run on Apify Store |
| RedNote Comments & Replies Scraper | 250–1,000+ comments/post + top 3 inline replies, IP location & buyer-intent flags | $1.99 / 1K comments ($2.49 Free) | Run on Apify Store |
| Xiaohongshu KOL & Profile Scraper | Automated creatorLeads discovery, follower/save totals, MCN badges & ~30 portfolio posts | $3.50 / 1K profiles ($5.00 Free) | Run on Apify Store |
| RedNote Live Stream Scraper | Active live shopping rooms (hasGoods), concurrent viewers, live chat & 1080p .flv/.m3u8 | $5.40 / 1K rooms ($7.90 Free) | Run on Apify Store |
| RedNote (Xiaohongshu) All-in-One Scraper & API | Unified 7-in-1 multi-surface workspace combining Search, Notes, Comments, KOLs & Live | $1.50 / 1K notes ($2.20 Free) | Run on Apify Store |
For broader social commerce strategy and live-shopping breakdowns, explore our companion playbooks: How to Scrape Xiaohongshu (RedNote) Without Login and How to Scrape Xiaohongshu Live Streams, 1080p Video & KOL Leads.
Frequently Asked Questions (FAQ)
Why does Xiaohongshu return error 300031 ('Note temporarily inaccessible') on /explore/<id> URLs?
On xiaohongshu.com, clicking a post card inside an authenticated feed attaches a short-lived, session-bound xsec_token query parameter. Requesting a bare /explore/<24-hex-id> link without xsec_token—or replaying an expired xsec_token from an earlier session—causes the web gateway to reject the request with error_code=300031.
Can I scrape a bare xiaohongshu.com/explore/<24-hex> URL without xsec_token or login cookies?
Yes. Both the UnitBytes Xiaohongshu Trend & Post Scraper and the RedNote Comments & Replies Scraper resolve bare https://www.xiaohongshu.com/explore/<24-hex-id> URLs, rednote.com item links, xhslink.com shortlinks, and raw 24-character hex Note IDs directly in the cloud with zero xsec_token parameters and zero cookies.
How do I run Xiaohongshu keyword searches without error -100 or a +86 SMS account?
Use unitbytes/rednote-xiaohongshu-search-scraper on Apify. Pass a 5-field JSON payload (keywords, sort, noteType, maxItems, enrichDetails) to retrieve up to 300+ unique notes per keyword sorted by popularity_descending, general, or time_descending starting at $1.50 per 1,000 notes on Gold+ plans.
How many Xiaohongshu comments and replies can I extract per post in Python?
Using unitbytes/xiaohongshu-rednote-comments-scraper, you can paginate 250 to 1,000+ engagement-ranked root comments per post plus up to 3 top inline replies per comment (subCommentCount reports the full reply total) starting at $1.99 per 1,000 comments on Gold+.
Extract Xiaohongshu Viral Notes, KOLs & Comments — Zero Accounts
Extract viral posts, creator portfolios, engagement ratios, and nested comment sentiment without +86 phone numbers or app logins. Run self-serve on Apify or request a Done-For-You Excel/CSV export below.
Related Technical Guides & Teardowns
PyTrends Is Dead (HTTP 429): Google Trends API Pricing & 2026 Alternatives ($0.30/1K)
Why the archived PyTrends Python library fails with HTTP 429 TooManyRequestsError in 2026—and how Google Trends API alternatives compare ($0.30/1K vs. SerpApi $15/1K) for real-time and historical search data.
Reddit API Pricing & Cost in 2026 ($0.24/1K Calls vs. Free & Pay-Per-Result Alternatives)
Complete breakdown of Reddit API pricing & cost ($0.24 per 1,000 calls, 100 QPM cap, $12K+ enterprise contracts) vs. Free Tier and $1/1K pay-per-result Reddit scraper API alternatives with zero API keys.
How to Scrape the Facebook & Meta Ads Library (2026): Competitor Ad Spy, Video Ads, EU DSA Reach & Spend API ($0.50/1K)
Complete 2026 developer and media-buyer guide to extracting commercial Facebook & Instagram ads, playable HD MP4 videos, carousel cards, cross-run competitor ad changes, EU DSA & UK reach demographics, and political ad spend starting at $0.50 per 1,000 ads.