# MOFA Data API > One API key for public data from 31 Chinese and global platforms (273 endpoints): social posts, videos, comments, public profiles, products and rankings, returned as structured JSON. Customers prepay USD credit and pay per successful call ($0.01–$0.30 per call); failed calls are free. Operator: 汕头市模法智能科技有限公司 (Shantou MOFA Intelligent Technology Co., Ltd.). Contact: contact@mofa-ai.com ## Base URL https://api.mofa-ai.com ## Authentication Create an API key at https://api.mofa-ai.com/console/keys (sign in with an email code). Send it in either header: Authorization: Bearer mk_live_… X-API-Key: mk_live_… ## Calling an endpoint Every endpoint has an id `.` and a path `/v1//`. GET https://api.mofa-ai.com/v1//?param=value POST https://api.mofa-ai.com/v1// (JSON object or form body) POST https://api.mofa-ai.com/v1/call {"endpoint": ".", "params": {...}} Example: curl -G https://api.mofa-ai.com/v1/xiaohongshu/search_note_v2 -H "Authorization: Bearer $MOFA_API_KEY" --data-urlencode 'keyword=咖啡' Success: {"success": true, "code": 0, "message": "success", "request_id": "req_…", "endpoint": "", "cost_usd": 0.03, "data": {...}} (unknown params are listed in "ignored_params") Error: {"success": false, "code": , "error": "", "message": "…"} Headers: X-Request-Id, X-MOFA-Cost-USD (0 when not billed), X-MOFA-Balance-USD ## Discovery (no key needed) - https://api.mofa-ai.com/openapi.json: OpenAPI 3.1 description of every endpoint - https://api.mofa-ai.com/v1/endpoints: every endpoint with params and price (?platform=, ?lang=en|zh) - https://api.mofa-ai.com/v1/endpoints/: one endpoint, with an example response when available - https://api.mofa-ai.com/v1/platforms: platforms - https://api.mofa-ai.com/v1/account: balance and key info for the calling key (key required, free) ## Errors (never billed) - invalid_api_key (401): Missing or invalid API key. Send it as 'Authorization: Bearer mk_live_…'. - account_suspended (403): This account is suspended. Contact contact@mofa-ai.com. - unknown_endpoint (404): Unknown endpoint. See GET /v1/endpoints or https://api.mofa-ai.com/docs. - missing_parameter (400): A required parameter is missing. - invalid_parameter (400): A parameter value is invalid. - invalid_body (400): The request body must be a JSON object or a form. - insufficient_balance (402): Your balance is too low for this call. Top up at https://api.mofa-ai.com/console/billing. - key_budget_exceeded (402): This API key reached its spending limit. Raise it in the console. - rate_limited (429): Too many requests for this API key. Slow down and retry. - too_many_concurrent (429): Too many calls in flight for this account. Retry when some finish. - upstream_rejected (422): The data source rejected the request (not billed). - upstream_error (502): The data source failed (not billed). Retry shortly. - upstream_timeout (504): The data source timed out (not billed). Retry shortly. - service_unavailable (503): The data service is temporarily unavailable (not billed). Retry shortly. - internal_error (500): Internal error (not billed). ## Limits - 300 requests per minute per key; 15 calls in flight per account. - Over a limit: HTTP 429 (rate_limited / too_many_concurrent) with Retry-After. Higher limits on request. ## Platforms - WeChat / 微信公众号 (`weixin`): 21 endpoints, https://api.mofa-ai.com/docs/weixin - RedNote / 小红书 (`xiaohongshu`): 14 endpoints, https://api.mofa-ai.com/docs/xiaohongshu - Zhihu / 知乎 (`zhihu`): 14 endpoints, https://api.mofa-ai.com/docs/zhihu - WeChat Channels / 微信视频号 (`weixin_channels`): 13 endpoints, https://api.mofa-ai.com/docs/weixin_channels - Weibo / 微博 (`weibo`): 11 endpoints, https://api.mofa-ai.com/docs/weibo - Bilibili / 哔哩哔哩 (`bilibili`): 9 endpoints, https://api.mofa-ai.com/docs/bilibili - Douyin / 抖音 (`douyin`): 9 endpoints, https://api.mofa-ai.com/docs/douyin - Kuaishou / 快手 (`kuaishou`): 8 endpoints, https://api.mofa-ai.com/docs/kuaishou - Douban / 豆瓣 (`douban`): 6 endpoints, https://api.mofa-ai.com/docs/douban - Toutiao / 今日头条 (`toutiao`): 5 endpoints, https://api.mofa-ai.com/docs/toutiao - Youku / 优酷 (`youku`): 3 endpoints, https://api.mofa-ai.com/docs/youku - Cross-platform search / 跨平台搜索 (`search`): 1 endpoints, https://api.mofa-ai.com/docs/search - RedNote Shop / 小红书电商 (`xiaohongshu_ec`): 1 endpoints, https://api.mofa-ai.com/docs/xiaohongshu_ec - Douyin Xingtu / 抖音星图 (`douyin_xingtu`): 32 endpoints, https://api.mofa-ai.com/docs/douyin_xingtu - IMDb / IMDb (`imdb`): 18 endpoints, https://api.mofa-ai.com/docs/imdb - Shopee / Shopee (`shopee`): 18 endpoints, https://api.mofa-ai.com/docs/shopee - RED Pugongying / 小红书蒲公英 (`xiaohongshu_pgy`): 16 endpoints, https://api.mofa-ai.com/docs/xiaohongshu_pgy - Taobao / Tmall / 淘宝 (`taobao`): 13 endpoints, https://api.mofa-ai.com/docs/taobao - Instagram / Instagram (`instagram`): 8 endpoints, https://api.mofa-ai.com/docs/instagram - YouTube / YouTube (`youtube`): 7 endpoints, https://api.mofa-ai.com/docs/youtube - Douyin E-commerce / 抖音电商 (`douyin_ec`): 6 endpoints, https://api.mofa-ai.com/docs/douyin_ec - QQ Huxuan / QQ 互选 (`qq_huxuan`): 6 endpoints, https://api.mofa-ai.com/docs/qq_huxuan - TikTok / TikTok (`tiktok`): 6 endpoints, https://api.mofa-ai.com/docs/tiktok - Amazon / 亚马逊 (`amazon`): 5 endpoints, https://api.mofa-ai.com/docs/amazon - Facebook / Facebook (`facebook`): 5 endpoints, https://api.mofa-ai.com/docs/facebook - JD.com / 京东 (`jd`): 5 endpoints, https://api.mofa-ai.com/docs/jd - X / X (`twitter`): 4 endpoints, https://api.mofa-ai.com/docs/twitter - Reddit / Reddit (`reddit`): 3 endpoints, https://api.mofa-ai.com/docs/reddit - 1688 / 1688 (`1688`): 2 endpoints, https://api.mofa-ai.com/docs/1688 - TikTok Shop / TikTok Shop (`tiktok_shop`): 2 endpoints, https://api.mofa-ai.com/docs/tiktok_shop - Xianyu / 闲鱼 (`xianyu`): 2 endpoints, https://api.mofa-ai.com/docs/xianyu ## More - Docs: https://api.mofa-ai.com/docs - Pricing: https://api.mofa-ai.com/pricing - Terms: https://api.mofa-ai.com/terms - Acceptable use: https://api.mofa-ai.com/acceptable-use