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 key

Option 1: Tools → MCP

For agent apps: one address covers every platform and the AI finds the endpoint itself.

  1. Open Tools → MCP and choose Add MCP Server (HTTP).
  2. Server URL: https://xtikapi.com/v1/mcp. Any name; server identifier: xtikapi.
  3. Under custom headers add Authorization with the value Bearer YOUR_API_KEY.
  4. 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.

  1. Open Tools → Custom and create a tool.
  2. Import from URL, e.g. https://xtikapi.com/openapi/xiaohongshu.json.
  3. Auth: API Key, header Authorization, type Bearer, with a key that has a spend limit.
  4. Test one endpoint on the tool screen, then drop it into your workflow.
OpenAPI URL
https://xtikapi.com/openapi/xiaohongshu.json
https://xtikapi.com/openapi/douyin.json
https://xtikapi.com/openapi/tiktok.json

What 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

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:

Other integrations