# Douyin, WeChat and Xiaohongshu data in Claude Code and Codex (2026)

Connect DataXAPI's MCP server: paste one sentence with your key into Claude Code or Codex and it sets itself up; then ask in plain words, with 230 endpoints on one key. A page of Douyin video search is $0.0200, a page of an Official Account's articles $0.0200. The free trial covers up to 333 calls; a failed call is not charged.

Updated 2026-11-06

## Set it up

Paste this into Claude Code or Codex: “Read https://dataxapi.com/agents.md and set up DataXAPI in this agent. My API key is dx_…; use it for every DataXAPI call.”

Or run `npx dataxapi setup` in a terminal: it writes the entry and installs the base skill. It does not write your key: put that in the environment variable `DATAXAPI_API_KEY`.

| Client | Where the entry goes |
| --- | --- |
| Claude Code | `~/.claude.json` |
| Codex | `~/.codex/config.toml` |

## What to ask

Say what you want; it finds the endpoint and its price, then calls it.

| You say | What it calls |
| --- | --- |
| Search Douyin for 露营 videos from the last week and write the 20 most liked to a CSV | `douyin.videos.search` |
| The titles and reads of this Official Account's last 30 articles, as a table | `wechat_mp.accounts.articles.list`, `wechat_mp.articles.metrics` |
| What the comments under the top 5 Xiaohongshu sunscreen reviews complain about | `xiaohongshu.notes.search`, `xiaohongshu.notes.comments.list` |
| Write a script that saves these 10 Douyin accounts' new videos to a database every day | `douyin.users.videos.list` |

## Why does it not fill the context?

A coding agent's context is what it can least spare. what an AI reads through DataXAPI takes 95% fewer tokens than the platform's raw JSON: a page of 7 Douyin results is 1,622 tokens, against 187k raw. Every platform uses the same field names, so the parsing code it writes works on the next platform too.

## How do I keep spending in hand?

Finding an endpoint and reading its parameters and price are free; only `call` is charged, and a failed call is not. Give the agent its own key with a limit; in a script, `X-Max-Price` caps what one call may cost, and the same `Idempotency-Key` within 24 hours is never charged twice.

## Why DataXAPI

- Steady: endpoints were available 99.9% of the last 30 days, on a public status page you can check.
- Fast: a paid call took 2.5 seconds at the median over the last 7 days (counted 2026-11-06).
- Fewer tokens: across 226 endpoints, one recorded real response each, the platform's own JSON comes to 9.2M tokens and what an AI reads through DataXAPI's MCP server to 452k, 95% fewer; the JSON of a direct API call is 90% fewer too (counted 2026-11-06). Every platform answers in one shape: the author in `author`, counts in `metrics`, the next page in `page.next_cursor`, so another platform needs no new parser.
- See before you pay: every endpoint's page shows a recorded real response, field by field.
- Spending you control: a failed call is not charged; each key can have a limit, `X-Max-Price` caps one call, and the same `Idempotency-Key` within 24 hours is never charged twice.
- Ready for AI: a remote MCP server listed in the official MCP registry as `com.dataxapi/mcp`, usable from Claude, Cursor and ChatGPT.
- Free trial of up to 333 calls, no card.

## Endpoints

- [Douyin video search](https://dataxapi.com/apis/douyin/videos/search/) ($0.0200 / a call): Search Douyin videos by terms, a page at a time, sorted by relevance, newest or most liked and filtered by time posted: caption, author with follower count, engagement counts.
- [WeChat Official Account articles](https://dataxapi.com/apis/wechat_mp/accounts/articles/list/) ($0.0200 / a call): Get a page of the articles a WeChat Official Account published, newest first: title, digest, link, time published.
- [WeChat Official Account article stats](https://dataxapi.com/apis/wechat_mp/articles/metrics/) ($0.0200 / a call): Get the current counts of a WeChat Official Account article by its long link: reads, likes, recommends, shares, saves, comments.
- [Xiaohongshu note search](https://dataxapi.com/apis/xiaohongshu/notes/search/) ($0.0200 / a call): Search Xiaohongshu notes by terms: title, text, author, engagement counts, images, and a link that opens.
- [Xiaohongshu note comments](https://dataxapi.com/apis/xiaohongshu/notes/comments/list/) ($0.0200 / a call): Get a page of top-level comments on a Xiaohongshu note by ID or link, newest first: text, commenter, likes, reply count, time posted.
- [Douyin user videos](https://dataxapi.com/apis/douyin/users/videos/list/) ($0.0020 / a call): Get a page of the videos a Douyin account has posted, newest first: caption, engagement counts, time posted.

## How-to guides

- [Does Douyin have an API? Get videos and comments with Python (2026)](https://dataxapi.com/guides/douyin-api-python/)
- [WeChat Official Account articles API in Python: history and reads (third-party, 2026)](https://dataxapi.com/guides/wechat-official-account-api-python/)
- [Does Xiaohongshu (RedNote) have an API? Get notes and comments with Python (2026)](https://dataxapi.com/guides/xiaohongshu-api-python/)

## More about Douyin

- [Douyin API](https://dataxapi.com/apis/douyin/)
- [WeChat Official Accounts API](https://dataxapi.com/apis/wechat_mp/)
- [Xiaohongshu (RedNote) API](https://dataxapi.com/apis/xiaohongshu/)
- [How do I export Douyin data?](https://dataxapi.com/answers/export-douyin-data/)
- [What is sec_uid on Douyin, and how is it different from uid and the Douyin ID?](https://dataxapi.com/answers/douyin-sec-uid/)
- [What are aweme_id and modal_id on Douyin, and what is a v.douyin.com link?](https://dataxapi.com/answers/douyin-aweme-id-modal-id/)
- [Is the Douyin search index a number of searches?](https://dataxapi.com/answers/douyin-search-index-vs-search-count/)
- [What is the Douyin keyword index (Ocean Engine)?](https://dataxapi.com/answers/what-is-douyin-keyword-index-ocean-engine/)
- [What is Douyin Xingtu?](https://dataxapi.com/answers/what-is-douyin-xingtu/)
- [Can Douyin's open platform read other people's videos and comments? (2026)](https://dataxapi.com/answers/douyin-open-platform-api/)
- [How do I check a keyword's heat on Douyin and Xiaohongshu before advertising? (2026)](https://dataxapi.com/answers/douyin-xiaohongshu-keyword-heat/)
- [How do I export all of a Douyin creator's video data? (2026)](https://dataxapi.com/answers/export-douyin-creator-videos/)
- [How do I export Douyin comments in bulk to find what users want? (2026)](https://dataxapi.com/answers/export-douyin-comments-user-needs/)
- [How do I find Douyin videos that took off from small accounts, and can I pull them in bulk? (2026)](https://dataxapi.com/answers/douyin-low-fan-viral-videos/)
- [What are a_bogus and X-Bogus on Douyin? (2026)](https://dataxapi.com/answers/douyin-a-bogus-x-bogus/)
- [What is msToken on Douyin? (2026)](https://dataxapi.com/answers/douyin-mstoken/)
- [Which Douyin API should I use for search, accounts and comments? (2026)](https://dataxapi.com/answers/which-douyin-api-to-use/)
- [How do I pull Douyin's hot-topic data by program? (2026)](https://dataxapi.com/answers/douyin-hot-topics-by-program/)
- [How do I use AI to audit and review an account? (2026)](https://dataxapi.com/answers/ai-account-audit-and-review/)
- [How do I filter Xingtu creators in bulk and see their rates? (2026)](https://dataxapi.com/answers/douyin-xingtu-creators-bulk-filter/)
- [What is ttwid on Douyin? (2026)](https://dataxapi.com/answers/douyin-ttwid/)
- [What are verifyFp and s_v_web_id on Douyin? (2026)](https://dataxapi.com/answers/douyin-verifyfp-s-v-web-id/)
- [How do I convert a Douyin sec_uid to a uid, and back? (2026)](https://dataxapi.com/answers/douyin-sec-uid-to-uid/)
- [Douyin API for developers: third-party Douyin data APIs and what they return (2026)](https://dataxapi.com/answers/douyin-third-party-data-apis/)
- [Douyin MCP server for Claude and Cursor (2026)](https://dataxapi.com/answers/douyin-mcp/)
- [Creator (KOL) data from Douyin and Xiaohongshu: profiles, posts and rates (2026)](https://dataxapi.com/answers/douyin-xiaohongshu-creator-data/)
- [Chinese social media marketing data tools: official tools and APIs (2026)](https://dataxapi.com/answers/chinese-social-media-marketing-data-tools/)
- [Which social media data API is best for AI agents? Count the tokens a response takes (2026)](https://dataxapi.com/answers/social-media-api-for-ai-agents/)
- [Social media API responses fill the AI's context and burn tokens: what to do](https://dataxapi.com/answers/api-response-too-many-tokens/)
- [How many tokens does a social media API response take in an AI? Every endpoint measured (2026)](https://dataxapi.com/answers/social-media-api-token-benchmark/)
- [Douyin API for AI agents and LLMs: fewer tokens, called from Claude and Cursor (2026)](https://dataxapi.com/answers/douyin-api-for-ai-agents/)
- [Douyin video download URL: getting a video's play address by API (2026)](https://dataxapi.com/answers/douyin-video-play-url-api/)
- [Douyin and Xiaohongshu search box suggestions (autocomplete) by API, in bulk (2026)](https://dataxapi.com/answers/douyin-xiaohongshu-search-suggestions-api/)
- [Douyin video completion rate and plays: Xingtu's video report by API (2026)](https://dataxapi.com/answers/douyin-video-completion-rate/)
- [How to get Douyin keyword trends in bulk](https://dataxapi.com/guides/douyin-keyword-trends/)
- [How to export Douyin video comments in bulk](https://dataxapi.com/guides/douyin-video-comments/)
- [How to look up a Douyin creator's Xingtu rate card](https://dataxapi.com/guides/douyin-xingtu-creator-rates/)
- [SocialCrawl alternative for Douyin, Xiaohongshu and WeChat data](https://dataxapi.com/compare/socialcrawl-alternative/)
- [How to choose a social media data API: failed-call charges, MCP and Chinese platforms](https://dataxapi.com/compare/social-media-data-apis/)

---

Catalog revision 9d3b7fa5a896745d. [HTML version](https://dataxapi.com/answers/claude-code-codex-china-social-data/)
