Answers
How do I get Douyin and Xiaohongshu data into a Coze or Dify workflow without cookies?
Short answer
Register okdata as a custom tool: Dify can import its OpenAPI schema with your key as a Bearer token, and Coze can create a plugin from the same HTTP endpoints with the key in a header. No cookie is involved; a Douyin account's latest videos cost $0.002 a page and a Xiaohongshu account's notes $0.02 a page.
The popular Coze workflow goes like this: paste the links of ten benchmark accounts (对标账号), collect their latest Douyin videos and Xiaohongshu notes into a Feishu table, then let the model rewrite the best ones. Step one of most tutorials says "copy your cookie from the browser and paste it here". It works for a few days. Then the cookie expires, the collection node returns nothing, and the workflow keeps "succeeding" with an empty table. Swapping that one node for an API call with a key fixes it for good.
The endpoints the workflow needs
- Douyin account profile: takes a profile URL or a
v.douyin.comshare link and returns the account, including its sec_uid (starts withMS4wLjABAAAA). The list endpoint needs this ID, not the 抖音号 shown in the app. - Douyin account videos: newest videos with likes, comments and shares, about 20 a page.
- Xiaohongshu account notes: newest notes, about 20 a page, by the ID in the profile URL.
Look up each Douyin sec_uid once and store it in the table; after that the daily run only calls the list endpoints.
Registering the tool
- Dify: Tools → Custom → Create, import the schema from
https://okdata.online/openapi.json, and set auth to API Key, headerAuthorization, type Bearer. Keep only the three or four operations you use, so the model does not pick the wrong one. - Coze: create a plugin based on an existing service, base URL
https://api.okdata.online, auth type Service with location Header, nameAuthorization, valueBearer okd_.... Add one tool per endpoint withid,fieldsandcursoras inputs.
Screen-by-screen steps for both are on the integrations page.
Cost of the benchmark-account workflow
| Run | Calls | Cost |
|---|---|---|
| One-time sec_uid lookup, 10 Douyin accounts | 10 | $0.02 |
| Daily: 10 Douyin + 10 Xiaohongshu accounts, first page | 20 | {{cost:douyin.users.videos.list10+xiaohongshu.users.notes.list10}} |
| 30 days | 600 | {{cost:douyin.users.videos.list300+xiaohongshu.users.notes.list300}} |
Test the call first
curl -G "https://api.okdata.online/v1/douyin/users/videos/list" \
-H "Authorization: Bearer $OKDATA_API_KEY" \
-d id=MS4wLjABAAAA... \
-d fields=id,url,text,published_at,metrics.likes,metrics.comments
When this returns videos, the plugin or custom tool will too.
Gotchas
- Errors come back as JSON with
codeandmessageand are not charged. Add a branch for anything other thanok, so an empty table never looks like a quiet day. - Douyin can pin older videos to the top of a profile; sort by
published_atin a code node. - Xiaohongshu hides view counts, so
metrics.viewsis null. - Recent Dify releases can also connect MCP servers. Whether yours can send a custom Authorization header depends on the version, so check before relying on it; the OpenAPI route works either way.
- The data is public posts only. Rewriting other people's content for your account is your call; copying it word for word is not a good one.
Other ways
The Coze plugin store has Douyin and Xiaohongshu plugins; some are free and some ask for your cookie, which brings back the original problem. Feishu's own automation can pull from an HTTP endpoint too. For ten accounts checked once a week, a person with a spreadsheet is still a fine answer. All workflow tools are covered under integrations.
Updated