Bilibili Video Scraper avatar

Bilibili Video Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
Bilibili Video Scraper

Bilibili Video Scraper

Scrape Bilibili (bilibili.com) - China's largest video platform. Search videos (title, author, view counts, duration, cover), fetch single video details by bvid/aid/URL, popular feed, and partition rankings - all through public api.bilibili.com endpoints, no login required.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

Scrape Bilibili — China's largest video platform — via its public api.bilibili.com endpoints (no login). Search videos by keyword, fetch single video details by bvid / aid / URL, get the popular feed, or partition rankings. Output includes title, author, view counts, duration, cover image, publish time and tags.

What this actor does

  • Four modes: search (default), byVideoUrl, popular, ranking
  • Search ordering (order): total rank / most viewed / newest / most danmaku / rating score
  • 15 ranking partitions as a dropdown (rid): all, anime, music, game, entertainment, knowledge, guichu, dance, fashion, life, movie, digital, food, animal, car — every option verified against the live ranking API
  • Search partition filter (tids) and search duration filter (duration: <10 / 10-30 / 30-60 / >60 min), both verified against the live search API
  • buvid bootstrap: visits bilibili.com once to obtain the buvid3 cookie the search API requires
  • Web-search HTML fallback (search.bilibili.com SSR cards, with full title/author/views/duration/cover parsing) if the search API rate-limits
  • Filters: min view count, title/description/author keyword
  • Auto-escalation: lazy-engages Apify AUTO datacenter proxy on 403/429/5xx; retries with backoff (bilibili is latency-flaky)
  • Empty fields are omitted; every record carries sourceUrl, scrapedAt, recordType

Output per video

  • bvid, aid
  • title (HTML <em> keywords stripped), description
  • author, authorMid
  • viewCount, danmaku, replyCount, favorites, likeCount, coinCount, shareCount
  • duration (seconds), durationText (3:17:23)
  • coverUrl (hdslb CDN, https-normalized), publishTime (UTC ISO)
  • typeName (partition label), uploadRegion (upload location, when published), pageCount (multi-part videos), resolution (1920x1080)
  • tags[] (search mode)
  • publishDate (YYYY-MM-DD, HTML-fallback records only; relative SSR labels like "5小时前" are dropped — only real dates are emitted)
  • videoUrl, recordType: "video" | "error", scrapedAt

Input

FieldTypeDefaultDescription
modeselectsearchsearch / byVideoUrl / popular / ranking
searchQuerystringpythonKeyword (mode=search)
videoUrlsarrayVideo URLs (mode=byVideoUrl)
bvidsarrayBV IDs (mode=byVideoUrl)
aidsarrayNumeric video IDs (mode=byVideoUrl)
ridselect0Ranking partition (15 options)
orderselecttotalrankSearch sort
tidsselect0Search partition filter
durationselect0Search duration range
minViewCountintView-count floor
containsKeywordstringTitle/description/author substring filter
maxItemsint20Hard cap (1–500)

Example: most-viewed Python tutorials

{
"mode": "search",
"searchQuery": "python",
"order": "click",
"minViewCount": 100000,
"maxItems": 15
}

Example: 30-60 minute food videos from the food partition

{
"mode": "search",
"searchQuery": "美食",
"tids": "211",
"duration": "3",
"maxItems": 10
}

Example: single video

{
"mode": "byVideoUrl",
"videoUrls": ["https://www.bilibili.com/video/BV1wD4y1o7AS/"]
}

Example: music ranking

{
"mode": "ranking",
"rid": "3",
"maxItems": 20
}

Cover images

Cover URLs point at i*.hdslb.com — verified HTTP 200 image/jpeg from a clean shell (no Referer/cookies); protocol-relative and http:// URLs are normalized to https://.

Anti-bot notes

  • api.bilibili.com search endpoints require a buvid3 cookie — the actor bootstraps it by visiting bilibili.com first.
  • The platform rate-limits aggressively (-799/-1200 codes, intermittent timeouts) — retries with backoff are built in; web-search HTML is the fallback.

Data source

Public api.bilibili.com endpoints: x/web-interface/search/type, x/web-interface/view, x/web-interface/popular, x/web-interface/ranking/v2. No login required.

Limitations

  • User-space video lists (x/space/wbi/arc/search) require WBI request signing — not supported in v1.
  • The 资讯 (news) and 运动 (sports) partitions and the invalid tid 153 were removed from the rid/tids dropdowns because the ranking/search APIs reject them (-400).
  • Search-mode tids and duration filters apply to the API path; if the search API rate-limits or times out mid-run (common — the platform is latency-flaky), the HTML fallback returns unfiltered results, so the filter may not hold on every run. Retrying the run usually returns the filtered set.
  • Garbage search queries: the platform returns real recommended videos instead of an empty result set, so an "impossible" query still yields real records (platform behavior, not a filter leak).
  • Invalid bvids/URLs produce typed recordType: "error" records (no silent drops).