# Is there an MCP or API version of MediaCrawler for AI agents?

> MediaCrawler crawls Douyin, Xiaohongshu, Bilibili and Weibo locally with your logins. For an agent that needs data mid-conversation: the hosted MCP route and costs.

Canonical page: https://okdata.online/answers/mediacrawler-mcp-for-ai-agents/

**Short answer: **MediaCrawler is a local crawler that logs in with your accounts and writes files, so an agent cannot simply ask it for data mid-conversation. A hosted API fits that job better: okdata serves Douyin, Xiaohongshu, Bilibili and Weibo search and comments over MCP and HTTP, with no login. A Douyin search costs $0.02, a page of Bilibili comments $0.002.

People ask the MediaCrawler maintainers for an MCP version because the workflow does not fit an agent. You configure keywords, start a crawl, scan QR codes in a browser, wait, then read the CSV or database it wrote. An agent works the other way round: halfway through a conversation it decides it needs 20 Douyin videos about air fryers and the comments under the top three, and it needs them in seconds. okdata is built for that second pattern. Each question is one HTTP call or one MCP `call`, answered with JSON, and no account of yours is logged in anywhere.

## What maps across

| MediaCrawler platform | Hosted endpoints |
|---|---|
| Douyin | [video search](/apis/douyin/videos/search/), [video detail](/apis/douyin/videos/get/), [comments](/apis/douyin/videos/comments/list/), [creator profile](/apis/douyin/users/get/), creator videos, hot search |
| Xiaohongshu | [note search](/apis/xiaohongshu/notes/search/), note detail, [comments](/apis/xiaohongshu/notes/comments/list/), creator profile, creator notes, hot topics |
| Bilibili | video search, video detail, [comments](/apis/bilibili/videos/comments/list/), popular board |
| Weibo | [post search](/apis/weibo/posts/search/), account profile, hot search |
| Kuaishou, Tieba, Zhihu | not covered |

## What a typical agent task costs

Say the agent is asked how Douyin and Xiaohongshu users talk about a product, and reads the comments on the five most-liked posts on each.

| Step | Calls | Cost |
|---|---|---|
| Douyin search, 2 pages | 2 | $0.04 |
| Xiaohongshu search, 2 pages | 2 | $0.04 |
| Douyin comments, 5 videos × 2 pages | 10 | $0.02 |
| Xiaohongshu comments, 5 notes × 2 pages | 10 | $0.20 |
| Total | 24 | $0.30 |

## Wiring it

An MCP client only needs the URL `https://api.okdata.online/mcp` and an `Authorization: Bearer` header; setups for each client are on the [MCP page](/mcp/). If your agent is a script, the same data is one GET away:

```python
import os, requests

API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

def get(path, **params):
    body = requests.get(API + path, headers=H, params=params, timeout=60).json()
    if body["code"] != "ok":
        raise RuntimeError(f"{body['code']}: {body['message']}")
    return body["data"]

videos = get("/v1/douyin/videos/search", query="空气炸锅", sort="most_liked",
             fields="id,title,metrics.likes,metrics.comments")["items"]
top = videos[0]
comments = get("/v1/douyin/videos/comments/list", id=top["id"], sort="hot",
               fields="text,likes,ip_location")["items"]
print(top["title"], len(comments), "comments")
```

## Differences you will notice

- Comment endpoints return top-level comments with a reply count. MediaCrawler can also crawl second-level replies.
- Every page is a paid call. MediaCrawler costs nothing per page; you pay with your time, your accounts and the risk to them.
- Only public data. Nothing that needs a login comes back.
- Fields the platform hides are null and listed in `meta.unavailable`, so the agent can tell missing from zero.

## When MediaCrawler is still the better fit

For a one-time crawl of 100,000 comments, for Kuaishou, Tieba or Zhihu, or when you need nested replies, MediaCrawler is free and thorough, and you keep every raw field. Many teams run both: MediaCrawler for the occasional big dataset, an API for the questions an agent asks every day. For the comment-reading use case in more depth, see [word-of-mouth analysis](/solutions/word-of-mouth/).

## Endpoints used

- [Douyin video search](https://okdata.online/apis/douyin/videos/search/) `douyin.videos.search`: $0.02 per call · about 20 videos per page
- [Douyin video comments](https://okdata.online/apis/douyin/videos/comments/list/) `douyin.videos.comments.list`: $0.002 per call · about 20 comments per page
- [Xiaohongshu note search](https://okdata.online/apis/xiaohongshu/notes/search/) `xiaohongshu.notes.search`: $0.02 per call · about 20 notes per page
- [Xiaohongshu note comments](https://okdata.online/apis/xiaohongshu/notes/comments/list/) `xiaohongshu.notes.comments.list`: $0.02 per call · about 10 comments per page
- [Bilibili video comments](https://okdata.online/apis/bilibili/videos/comments/list/) `bilibili.videos.comments.list`: $0.002 per call · about 20 comments per page
- [Weibo post search](https://okdata.online/apis/weibo/posts/search/) `weibo.posts.search`: $0.002 per call · about 10 posts per page

Updated 2026-11-12
