Dify · MCP · OpenAPI
Douyin, Xiaohongshu and TikTok data in Dify
Dify gives you two routes. Under Tools → MCP, add https://xtikapi.com/v1/mcp with your key in a custom header, and agents can use find and call across 19 platforms. Or under Tools → Custom, import one platform's OpenAPI file so each endpoint becomes its own tool, which suits workflows that always call the same thing.
Get an API keyOption 1: Tools → MCP
For agent apps: one address covers every platform and the AI finds the endpoint itself.
- Open Tools → MCP and choose Add MCP Server (HTTP).
- Server URL: https://xtikapi.com/v1/mcp. Any name; server identifier: xtikapi.
- Under custom headers add Authorization with the value Bearer YOUR_API_KEY.
- Dify then lists four tools, find, describe, call and account; add them to your agent.
Option 2: Tools → Custom (import OpenAPI)
For workflows on one platform where each step calls a known endpoint.
- Open Tools → Custom and create a tool.
- Import from URL, e.g. https://xtikapi.com/openapi/xiaohongshu.json.
- Auth: API Key, header Authorization, type Bearer, with a key that has a spend limit.
- Test one endpoint on the tool screen, then drop it into your workflow.
https://xtikapi.com/openapi/xiaohongshu.json
https://xtikapi.com/openapi/douyin.json
https://xtikapi.com/openapi/tiktok.jsonWhat people build with it
Product feedback agent: search notes, read comments, summarise
An agent app with the MCP tools. Ask what people on Xiaohongshu say about a coffee machine this week: it runs one search, then reads comments on 5 notes.
Endpoints: Xiaohongshu note search API ($0.02), Xiaohongshu comments API ($0.02)
Cost: About 6 calls per chat, $0.12. Model costs are separate.
Daily digest of a WeChat official account
Workflow: schedule → custom tool (WeChat articles list) → LLM summary → email.
Endpoints: WeChat Official Accounts article list API ($0.02)
Cost: 3 accounts once a day: 90 calls a month, $1.80.
Platforms it can read
- Douyin34 endpoints
- Xiaohongshu16 endpoints
- TikTok24 endpoints
- Kuaishou9 endpoints
- Bilibili10 endpoints
- Weibo12 endpoints
- Zhihu16 endpoints
- WeChat Official Accounts7 endpoints
- WeChat Channels10 endpoints
- YouTube12 endpoints
- Instagram9 endpoints
- X16 endpoints
- Reddit11 endpoints
- Threads5 endpoints
- Xingtu14 endpoints
- Pugongying15 endpoints
- WeChat Search1 endpoint
- Telegram5 endpoints
- LinkedIn3 endpoints
Questions
My Dify has no MCP page or custom headers. Now what?
MCP tools and their header settings come with newer Dify releases; upgrade a self-hosted instance. Until then, use option 2: OpenAPI import works on older versions too.
Does self-hosted Dify work?
Yes. Tool calls leave from the Dify container, which needs to reach https://xtikapi.com.
What does it cost in Dify?
Dify bills you as usual; XTikAPI charges per call, from $0.002 depending on the endpoint. You pay only when the platform answers; errors and timeouts are free. New accounts get $0.50 of trial credit with no card.
Do I need a Douyin or Xiaohongshu account?
No. No platform login, cookie or QR scan, only an XTikAPI API key. It reads public data, so none of your own accounts can be banned for automation.
Can a runaway workflow drain my balance?
Give this tool its own key with a spend limit in the console; at the limit that key stops and your other keys keep working. The balance is prepaid, so it stops at zero and never runs into debt.
Which platforms can it read?
19 platforms and 229 endpoints: Douyin, Xiaohongshu, TikTok, Kuaishou, Bilibili, Weibo, WeChat, Zhihu, YouTube, Instagram, X, Reddit and more. Posts, comments, accounts and trends come back in one shape, so switching platforms does not break the steps after it.
More about Dify
Sources
The steps follow Dify's own docs: