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_. Self-serve signup is not open yet: write to hello@okdata.online and we will send you one. 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:
curl https://api.okdata.online/v1/catalog/status
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": "eyJvIjoyMH0", "has_more": true },
"meta": {
"billing": { "amount": "0.018", "currency": "USD", "balance_after": "9.982" },
"unavailable": { "metrics.views": "platform" }
}
}
data.itemsholds the notes. Every platform answers with the same Post shape.meta.billing.amountis what this call cost, in US dollars.meta.unavailablenames fields that are null and why. Xiaohongshu does not show view counts, sometrics.viewsis null with the reasonplatform.
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=eyJvIjoyMH0'
6. When a call fails
You get one error shape with code, message, charged and retry. Failed calls are not charged. A timeout says charged: null; resend it with the same Idempotency-Key and it can never be billed twice. Every code is on the errors page.
Next
- Give an AI agent the same data over MCP.
- Browse all 35 endpoints and their prices.
- Read how requests, paging, view and fields work.
Updated 2026-11-11