Spider_XHS says "Cookie is invalid or expired" on my server but works locally: why? (2026)

A Spider_XHS issue reports that cookie import and phone-code login both work locally, but on a server the same cookie returns "Cookie is invalid or expired" and the phone code fails to send; the reporter suspects Xiaohongshu flags the server's public IP. XTikAPI runs from a server with no Xiaohongshu cookie at all: note search, detail and comments are $0.02 a call. XTikAPI reads Xiaohongshu with 16 endpoints from $0.02 a call. A failed call is not charged, and a verified account gets $0.50 of trial balance.

Updated 2026-11-20

What was reported

Issue 191 (2026-10-10): frontend and backend deployed behind Nginx, health check fine, the server can reach xiaohongshu.com. Locally both login methods work; online, POST /api/accounts/import-cookie returns "Cookie is invalid or expired" and "Failed to send phone code". The reporter asks whether the server IP is under risk control and whether a proxy exit is supported.

What XTikAPI returns

xiaohongshu.notes.search

You pass: keyword

You get: A page of notes

xiaohongshu.notes.detail

You pass: Note id or share link in url

You get: One note

xiaohongshu.comments.list

You pass: Note id or url

You get: A page of comments

Call it from your server with Authorization: Bearer <key>; there is no login to bind.

What a month costs

10 keywords searched daily plus detail for 5 notes each: 60 calls a day, 1,800 a month at $0.02, $36.

Why XTikAPI

  • See before you pay: 192 of 229 endpoints show a recorded real response on their page (13 of 16 for Xiaohongshu).
  • One shape: posts, comments and accounts from 19 platforms come back as the same objects, author in author and counts in metrics, so another platform needs no new parser.
  • Spending you control: a failed call or a timeout is not charged (charged: false), X-Max-Price caps one call, and the same Idempotency-Key within 24 hours is never billed twice.
  • Prepaid balance, no subscription. Balance never expires, and unused top-up money can be refunded within 14 days.
  • Made for AI: every page has a Markdown twin, plus llms.txt and OpenAPI, so ChatGPT, Claude and Cursor can read it directly.
  • Free trial: a verified account gets $0.50, no card.

Endpoints

Each with its price; the endpoint page has parameters, fields and a recorded response.

Sources

What this page says about other products comes from their own pages and docs, read on 2026-11-20.

  • Spider_XHS issue 191: Cookie is invalid or expired after deploying to a server

More about Xiaohongshu

One key. Start now.

19 platforms, 229 endpoints, from $0.002 a call. Errors and timeouts are free.

Start free