跳到正文
DEV Community· Conn Ho·· 6 天前AI 評分53

如何從中國境外取得 RedNote(小紅書)和抖音數據,並以英文閲讀

How to get RedNote (Xiaohongshu) and Douyin data from outside China, in English

AI 導讀

Conn Ho 示範如何在中國境外透過 okdata API 取得 RedNote(小紅書)和抖音的公開數據,再用模型以英文整理。服務可查詢公開貼文、評論及熱門趨勢,毋須小紅書或抖音帳戶、中文電話號碼或 cookies;RedNote 搜尋每次 $0.02,文中估算每月追蹤成本約 $6.50。

正文

In January 2025, millions of Americans installed RedNote, the English name of Xiaohongshu, and found out how much of China's consumer conversation happens there and on Douyin, TikTok's Chinese sibling. If you sell into China, run a cross-border shop or study Chinese consumers, those two apps are where the reviews, complaints and trends are. Getting that data into a spreadsheet or an AI agent from outside China is harder than it should be.

Disclosure: I build okdata, the API used below. It sells public social data per call and has a hosted MCP server for AI agents.

What gets in the way

  • The website sends you somewhere else. Since early November 2026, xiaohongshu.com has been redirecting visitors on overseas IPs from note and profile pages to rednote.com, as developers of an open-source Xiaohongshu tool found (xiaohongshu-mcp #906).
  • Your account may be the wrong kind. An account registered with a non-Chinese phone number is a RedNote account, and tools that log in to xiaohongshu.com can't use it (#609).
  • Logged-in scrapers get flagged. A script driving a real account soon trips the platform's checks: Xiaohongshu answers with error 461 or "account abnormal", and Douyin's web requests need signed parameters that keep changing. The account is what you lose.
  • The official open platforms are for something else. They serve merchants and partners working with their own accounts, not searching public posts.

What you can get without any of that

okdata reads public Xiaohongshu and Douyin pages for you and returns JSON with English field names, in the same shape as its TikTok or YouTube data. You need no Xiaohongshu or Douyin account, no Chinese phone number and no cookies, and it works from a server anywhere.

Data Endpoint Price
RedNote note search, about 20 notes a page xiaohongshu.notes.search $0.02 a call
Full text and images of one note xiaohongshu.notes.get $0.02
Comments on a note, about 10 a page xiaohongshu.notes.comments.list $0.02 a page
RedNote hot topics xiaohongshu.trends.list $0.02
Douyin video search, about 20 a page douyin.videos.search $0.02 a call
Comments on a Douyin video, about 20 a page douyin.videos.comments.list $0.002 a page
Douyin hot search board, 50 entries douyin.trends.list $0.002

A failed call costs nothing. You top up a balance by card, Alipay or WeChat Pay, and a new key comes with $0.10 to try it.

Every endpoint lists its price and page size before you call it.
Every endpoint lists its price and page size before you call it.

1. Search RedNote in Chinese, read the results in English

The tip that matters most: search in Chinese. Most notes are written in Chinese, so 防晒霜 finds far more than "sunscreen". Let your model translate the query on the way in and summarize on the way out.

export OKDATA_API_KEY=okd_...
curl -G "https://api.okdata.online/v1/xiaohongshu/notes/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=防晒霜 推荐' \
  --data-urlencode 'sort=popular'

The docs example, trimmed:

{
  "code": "ok",
  "data": {
    "items": [
      {
        "id": "6731f0a2000000001b02c3d4",
        "title": "油皮夏天防晒怎么选|实测 6 款",
        "text": "连续两周通勤实测,按清爽度和防晒力排了个序,第 3 款意外好用。",
        "lang": "zh",
        "published_at": "2026-11-02T09:30:00Z",
        "metrics": { "likes": 48200, "comments": 1312, "favorites": 9650 },
        "hashtags": ["防晒", "油皮"]
      }
    ]
  },
  "page": { "next_cursor": "eyJvIjoyMH0", "has_more": true },
  "meta": { "billing": { "amount": "0.02", "currency": "USD" } }
}

The text stays in Chinese and the field names don't. metrics.favorites is RedNote's 收藏 (saves), which people use to bookmark things they mean to buy, so sort on it when you want the notes that sell. Pass page.next_cursor back as cursor for the next 20.

Hand the batch to your model with one instruction: summarize in English and quote the original Chinese next to each claim. You keep the translation honest and can check any line yourself.

Search in Chinese, read in English: a Chinese query comes back with English field names, and the model summarizes in English with the Chinese quoted

2. What is China talking about today? Douyin hot search

import os, requests

API = "https://api.okdata.online/v1"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

def get(path, **params):
    r = requests.get(API + path, headers=H, params=params, timeout=60)
    body = r.json()
    if body["code"] != "ok":
        raise RuntimeError(f"{body['code']}: {body['message']}")
    return body["data"]["items"]

for t in get("/douyin/trends/list")[:10]:
    print(t["rank"], t["name"], t["heat"])

# Pick a topic, take the most-liked video, read the comments under it
top = get("/douyin/videos/search", query="防晒霜", sort="most_liked")[0]
comments = get("/douyin/videos/comments/list", id=top["id"])
print(len(comments), "comments on", top["url"])

That script spends $0.002 + $0.02 + $0.002, about two and a half cents.

The Douyin hot search endpoint: 50 entries with heat, $0.002 a call.
The Douyin hot search endpoint: 50 entries with heat, $0.002 a call.

3. Or skip the code and ask Claude

The same data is behind one MCP URL, https://api.okdata.online/mcp. In Claude on the web: Customize → Connectors → Add custom connector, paste the URL, choose Sign in now and sign in. In Cursor, add it to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "okdata": {
      "url": "https://api.okdata.online/mcp",
      "headers": { "Authorization": "Bearer ${env:OKDATA_API_KEY}" }
    }
  }
}

Then ask in plain English:

Search Xiaohongshu for 防晒霜 推荐, read the five most-saved notes and their comments, and tell me in English what people with oily skin complain about. Quote the Chinese.

The server gives the model five tools instead of 200: it finds the endpoint, checks its price for free, then makes the paid call. You see what it will cost before it spends anything.

What a month of tracking costs

Every week Calls Cost
10 Chinese keywords on RedNote, 2 pages each 20 $0.40
Full text of the 30 most-saved notes 30 $0.60
First page of comments on those 30 notes 30 $0.60
Douyin hot search, once a day 7 $0.014
Week 87 $1.61

That is about $6.50 a month, with no subscription.

Before you start

  • It returns public posts, comments and profiles only. Nothing behind a login, no private messages.
  • Cursors stay valid for 24 hours, so finish a paging run the same day.
  • Personal data in public posts is still personal data. Collect what the question needs and handle it the way your local law asks.

You can get a key at https://okdata.online/signup/?src=devto-rednote. Every endpoint, with its fields and price, is at https://okdata.online/apis/xiaohongshu/ and https://okdata.online/apis/douyin/.

What are you trying to learn from Chinese social media? I'm happy to answer in the comments, including whether this is the wrong tool for it.

來源:DEV Community · dev.to