For AI

Quickstart: your first okdata call

Get a key, make one call to Xiaohongshu note search, read the data and the bill, then fetch the next page. About two minutes.

1. Get a key

Keys start with okd_. Sign up with your email at the console (a 6-digit code, no password) and the first key is made for you, with a free trial balance. Keep it in an environment variable, never in code:

export OKDATA_API_KEY="okd_..."

2. Look before you pay

The status route is free and needs no key. It tells you which endpoints are up right now (live.status: available, degraded or paused), how each platform is doing, any open incidents, and the share of calls served over the last 30 days:

curl https://api.okdata.online/v1/catalog/status

The status page shows the same, and incidents are also an Atom feed at https://api.okdata.online/v1/catalog/status/incidents.atom.

3. Make one call

Search Xiaohongshu notes for a keyword. The path is the endpoint id with dots turned into slashes:

curl -G "https://api.okdata.online/v1/xiaohongshu/notes/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=sunscreen'

That is one call. It costs $0.02 and returns a page of about 20 notes.

4. Read the answer

{
  "code": "ok",
  "data": { "items": [ { "id": "6731f0a2000000001b02c3d4", "type": "image", "title": "...", "metrics": { "likes": 48200, "views": null } } ] },
  "page": { "next_cursor": "c1.k3Vq9TzR0bYw2LmXe8NdPa", "cursor_expires_at": "2026-11-12T08:00:00Z", "has_more": true, "returned": 20 },
  "meta": {
    "result_status": "complete",
    "billing": { "amount": "0.02", "currency": "USD", "balance_after": "9.98" },
    "unavailable": { "metrics.views": "platform" }
  }
}
  • data.items holds the notes. Every platform answers with the same Post shape.
  • meta.billing.amount is what this call cost, in US dollars.
  • meta.unavailable names fields that are null and why. Xiaohongshu does not show view counts, so metrics.views is null with the reason platform.

5. Get the next page

Send page.next_cursor back as cursor. Each page is a separate call with its own price; stop when you have enough or when page.has_more is false.

curl -G "https://api.okdata.online/v1/xiaohongshu/notes/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=sunscreen' \
  --data-urlencode 'cursor=c1.k3Vq9TzR0bYw2LmXe8NdPa'

6. When a call fails

You get one error shape: code says what happened, charged and retry say whether you paid and whether to try again, and problems and param say what exactly was wrong (message is a fixed sentence per code). Failed calls are not charged, timeouts included. In the rare settlement_unknown case (charged: null), resend with the same Idempotency-Key: you get the result and it can never be billed twice. Every code is on the errors page.

Next

Updated

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp