Answers / Bilibili

How do I get Bilibili video comments with an API?

Send GET /v1/bilibili/comments?id=BV_ID with your PostToData API key, or use the MCP get_comments tool with platform=bilibili. Pass a standard BV ID (such as BV1GJ411x7h7) or the full bilibili.com video URL. Each comment comes back with its text, author, like count, reply count, and a direct source link.

Bilibili · comments · $0.003 a call · one verified website trial · updated 2026-11-13

Run it live

Calls run only when you press Run. Opening this page does not spend credit.

Loading…

Profiles require a numeric UID. Videos accept BV IDs. One page per call.

Your results will appear here. Choose a platform and action, then press Run.

Real API calls require verification for one trial, or a signed-in account with prepaid credit.

From code

curl
curl "https://posttodata.com/v1/bilibili/comments?id=BV1GJ411x7h7&limit=5" -H "Authorization: Bearer YOUR_API_KEY"
Python (requests)
import requests

r = requests.get(
    "https://posttodata.com/v1/bilibili/comments",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"id": "BV1GJ411x7h7", "limit": 5},
)
for item in r.json()["data"]["items"]:
    print(item["url"], item.get("text") or item.get("title"))
TypeScript / Node.js
const url = new URL("https://posttodata.com/v1/bilibili/comments");
url.searchParams.set("id", "BV1GJ411x7h7");
url.searchParams.set("limit", "5");
const res = await fetch(url, {
  headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await res.json();
console.log(data.data.items);
Go
req, _ := http.NewRequest("GET", "https://posttodata.com/v1/bilibili/comments?id=BV1GJ411x7h7&limit=5", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

From your AI

Claude and ChatGPT clients that support OAuth can sign in without pasting a key. Follow the client setup guide. The command below is the API-key option for Claude Code.

Add the MCP server once
claude mcp add --transport http posttodata https://posttodata.com/mcp --header "Authorization: Bearer YOUR_API_KEY"

Then ask

“Fetch top comments for Bilibili video BV1GJ411x7h7 using PostToData, limit 10. Summarize viewer questions and cite sources.”

The model calls get_comments with platform bilibili.

Response Schema & Data Sample

Normalized JSON output structure returned by PostToData. All fields are strongly typed; missing upstream metrics return null rather than being omitted.

200 OK — JSON Response
{
  "meta": {
    "platform": "bilibili",
    "action": "comments",
    "total_items": 1,
    "currency": "USD",
    "price_usd": "0.003"
  },
  "data": {
    "items": [
      {
        "id": "BV1GJ411x7h7",
        "type": "comment",
        "url": "https://bilibili.com/video/example_id",
        "published_at": "2026-11-15T12:00:00Z",
        "text": "This matches the public discussion thread on the platform.",
        "author": {
          "id": "user_404",
          "username": "dev_community",
          "name": "Community User",
          "url": null
        },
        "metrics": {
          "likes": 38,
          "comments": 4,
          "shares": null,
          "views": null,
          "score": null
        },
        "parent_id": null
      }
    ]
  }
}

Good to know

  • Bilibili comments list at $0.003 per successful call.
  • No Bilibili account or browser cookies (SESSDATA) required.
  • BV IDs and full video URLs are both accepted.
  • Replies are flattened with depth indicators suitable for AI prompts.

Full reference in the docs. All Bilibili endpoints are on the Bilibili API page.

More answers