Answers

Is there an MCP or API version of MediaCrawler 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, video detail, comments, creator profile, creator videos, hot search
Xiaohongshu note search, note detail, comments, creator profile, creator notes, hot topics
Bilibili video search, video detail, comments, popular board
Weibo post 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 {{cost:douyin.videos.search2+xiaohongshu.notes.search2+douyin.videos.comments.list10+xiaohongshu.notes.comments.list10}}

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. If your agent is a script, the same data is one GET away:

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.

Updated