# What is a Bilibili mid (UID), and where do I get it?

> A Bilibili mid is the numeric user ID behind space.bilibili.com links. Its shape, how it differs from nicknames and aids, where API results carry it, and what you cannot do with it here.

Canonical page: https://okdata.online/answers/bilibili-mid-uid/

**Short answer: **The mid is Bilibili's permanent numeric user ID, the number shown as UID and in profile links like space.bilibili.com/<mid>. okdata returns it as author.id on every Bilibili video and comment, for example $0.002 for a search page of about 20 videos. There is no Bilibili profile endpoint in the catalog, so a mid cannot be turned into follower counts here.

On Bilibili, `mid` is the account's numeric user ID. The profile page labels it UID, and the profile link is built from it: `space.bilibili.com/` followed by the number. A nickname can change, the mid cannot, which is why every serious Bilibili dataset keys creators and commenters on it.

## What it looks like

- A positive integer with no prefix. Early accounts have short mids; in the responses we read in November 2026 they ran from 7 to 16 digits, and accounts registered in the last few years have 16 digits starting with 3.
- 16 digits is still safe for a JavaScript number and a 64-bit integer, but more than Excel keeps: it rounds numbers to 15 significant digits. Store mids as text or BIGINT and format the spreadsheet column as text.
- Live rooms have their own room numbers, videos have aids and BV ids, comments have their own ids. None of them is a mid, even when the number looks similar.

## Where okdata returns it

| Endpoint | Field holding a mid | Cost |
|---|---|---|
| [Bilibili video search](/apis/bilibili/videos/search/) | `author.id` of each video's uploader | $0.002 a page |
| [Bilibili video detail](/apis/bilibili/videos/get/) | `author.id` of the uploader | $0.002 |
| [Bilibili video comments](/apis/bilibili/videos/comments/list/) | `author.id` of each commenter | $0.002 a page |

`author.name` is the nickname at fetch time. `author.followers` and `author.verified` come back null on Bilibili, and `meta.unavailable` says so.

## What you cannot do with a mid here

The catalog has no Bilibili account endpoint: no follower count, no profile, no "all videos by this uploader" list. If you start from a mid, the practical routes are a search for the creator's name or topic, filtered on `author.id`, or opening `space.bilibili.com/<mid>` in a browser for the follower count.

## Example

Find the mids behind the newest videos on a topic and count how often each uploader appears:

```python
import os, requests
from collections import Counter

URL = "https://api.okdata.online/v1/bilibili/videos/search"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

body = requests.get(URL, headers=H, timeout=60, params={
    "query": "机械键盘 测评", "sort": "latest",
    "fields": "id,title,author.id,author.name"}).json()
if body["code"] != "ok":
    raise SystemExit(body["message"])

videos = body["data"]["items"]
by_mid = Counter((v["author"]["id"], v["author"]["name"]) for v in videos)
for (mid, name), n in by_mid.most_common(10):
    print(mid, name, n, f"https://space.bilibili.com/{mid}")
```

One page is $0.002; ten pages across a few keywords are $0.02.

## Limits

- Search finds what Bilibili ranks for a keyword. A creator who never uses your words will not show up, and a filter on `author.id` only sees the videos the search returned.
- A commenter's mid identifies the account, not the person. Treat it as personal data: keep it only as long as your analysis needs it.
- Deleted or private videos return `not_found`, which is free.

For finding sponsorship candidates from search results, see [finding Bilibili creators in a niche](/answers/bilibili-find-up-creators-for-sponsorship/).

## Endpoints used

- [Bilibili video search](https://okdata.online/apis/bilibili/videos/search/) `bilibili.videos.search`: $0.002 per call · about 20 videos per page
- [Bilibili video detail](https://okdata.online/apis/bilibili/videos/get/) `bilibili.videos.get`: $0.002 per call
- [Bilibili video comments](https://okdata.online/apis/bilibili/videos/comments/list/) `bilibili.videos.comments.list`: $0.002 per call · about 20 comments per page

## More about Bilibili

- [Bilibili API](https://okdata.online/apis/bilibili/)
- [Bilibili API in Python: videos, comments, popular board (2026)](https://okdata.online/guides/bilibili-api-python/)
- [How do I scrape the comments on a Bilibili video?](https://okdata.online/answers/bilibili-video-comments-api/)
- [How do Bilibili BV and AV numbers relate, and which one should I store?](https://okdata.online/answers/bilibili-bv-vs-av-number/)
- [How do I find Bilibili creators (UP主) in a niche for sponsorships?](https://okdata.online/answers/bilibili-find-up-creators-for-sponsorship/)
- [How do I get notified when new Bilibili videos mention my product?](https://okdata.online/answers/bilibili-new-videos-keyword-alert/)
- [Bilibili's search API keeps returning -412. Is there a simpler way to search videos?](https://okdata.online/answers/bilibili-search-api-412-error/)
- [Comments API](https://okdata.online/roles/posts-comments-list/)
- [Post detail API](https://okdata.online/roles/posts-get/)
- [Post search API](https://okdata.online/roles/posts-search/)
- [Bilibili hot searches: today’s list](https://okdata.online/tools/hot-search/bilibili/)

## Sources

- [yt-dlp Bilibili extractor: space.bilibili.com/<numeric id> profile URLs](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/bilibili.py) (read 2026-11-12)
- [V2EX: Bilibili user UIDs now have 16 digits](https://www.v2ex.com/t/1132841) (read 2026-11-12)
- [Excel: keeping leading zeros and large numbers (15-digit precision)](https://support.microsoft.com/en-us/excel/keeping-leading-zeros-and-large-numbers) (read 2026-11-12)

Where people asked this (read 2026-11-12): 

- https://www.v2ex.com/t/1132841
- https://github.com/HFrost0/bilix/issues/171
- https://github.com/AyaseEli-Bing/bilibili-spider/issues/2

Updated 2026-11-12
