Bilibili Creator API: Profile or One Upload Page

Query a known Bilibili UID once, validate profile or upload-page identity, and keep missing followers, historical counters and incomplete examples explicit.

Conceptual Bilibili creator research chain with illustrated trends and profile counters

A creator’s UID is enough to start a useful Bilibili API integration, but it does not tell you which result you need. A profile answers “is this the account I selected?” An upload page answers “which video records are in this returned page?” Neither gives you an audience-growth report. This tutorial makes one selected request, checks its identity, and keeps missing information unknown before you build anything larger.

The November 8, 2026 revision checks current public schemas and replays previously saved examples offline. It makes no new business API call. The profile and upload references below belong to different accounts and dates; they are not a newly executed profile-to-videos workflow.

Key takeaway

  • Choose web/user-profile for account context or web/user-post-videos for one upload page; both require a string uid.
  • Read only completed outputs[0].data, then require integer code: 0 and the selected inner structure.
  • The saved profile has no numeric follower count. Upload totals and raw counters do not establish growth or complete history.
  • Both selected endpoints list at $0.001 per call; quota eligibility does not prove remaining free allowance.

The retained cover is a conceptual “trends to topic to creator” illustration. Its account labels, follower figures, rankings and agent-core diagram are not measured API results or a workflow executed in this revision.

Choose the result before connecting

Your taskCurrent API referenceFirst body
Identify a known creatorBilibili user profile{"uid":"316183842"}
Inspect one account’s upload pageBilibili user post videos{"uid":"178360345","order":"pubdate","pn":1}

Use your own deliberately selected UID. The examples are independent public reference inputs, not a recommendation to research those accounts. “Numeric UID” means decimal digits in a JSON string, not a JSON number. Preserve it without converting through a floating-point representation. A nickname, BVID, video AID and creator UID are different identifiers.

For uploads, order defaults to pubdate and pn defaults to integer 1; this example sends both explicitly. The schema does not enumerate other order values. It declares no input ps, page_size, limit or cursor. A response containing page.ps: 25 does not authorize sending a page-size parameter. The code stops after one page rather than deriving a crawl from the reported total.

Give your agent a bounded task

Already have a SandBase key? Keep it in a local environment variable or your project’s existing secret store. Reuse that configuration and install Python’s requests dependency if needed. Do not paste the key into a prompt, commit it, or ask the agent to print its value to verify setup.

Already connected an agent? Supply the UID and choose profile or uploads. Its existing connection is sufficient; it should not create another credential, search for a different creator, fetch every video’s details or schedule future calls simply because those capabilities are available.

For a new project, hand the agent the setup skill and Markdown quickstart. Ask it to implement and test the selected request before execution. A suitable instruction is: “Use my existing local SandBase configuration. Prepare one Bilibili upload-page request for this UID with pubdate and pn=1. Validate the response, preserve unknown counters and stop. Do not add pagination, media downloads or follow-up calls.” Replace “upload-page” with “profile” when identity is your immediate question.

At the November 8 schema check, each selected route lists $0.001 per call and is eligible for the organization-shared allowance of 100 eligible calls per day, resetting at 00:00 UTC. Two deliberately requested reads list at $0.002 before quota effects. This revision did not inspect remaining allowance or actual charges, so it does not promise that your execution will be free or successful.

One request, with errors kept visible

This uses the Model API POST /v1/api/<model> route, not a catalog GET. The request body contains operation parameters; the model is already in the path. Save the following as a Python file after configuring SANDBASE_API_KEY locally. Its default main block makes only the profile request.

Python
import os
import re
import requests

API = "https://api.sandbase.ai/v1/api/bilibili/web"


def same_uid(value, selected):
    # Local identity guard: exact positive integer or canonical decimal string.
    return ((type(value) is int and value > 0 and str(value) == selected)
            or (isinstance(value, str) and value == selected))


def first_request(task, uid):
    if not isinstance(uid, str) or not re.fullmatch(r"[1-9][0-9]*", uid):
        raise ValueError("Provide the selected UID as a decimal string")
    if task == "profile":
        route, payload = "user-profile", {"uid": uid}
    elif task == "uploads":
        route = "user-post-videos"
        payload = {"uid": uid, "order": "pubdate", "pn": 1}
    else:
        raise ValueError("Choose profile or uploads")
    key = os.environ.get("SANDBASE_API_KEY", "").strip()
    if not key:
        raise ValueError("Set SANDBASE_API_KEY locally")
    try:
        response = requests.post(
            f"{API}/{route}",
            headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
            json=payload, timeout=(10, 90), allow_redirects=False,
        )
        if not 200 <= response.status_code < 300:
            raise RuntimeError(f"SandBase HTTP {response.status_code}; request stopped")
        body = response.json()
    except requests.RequestException:
        raise RuntimeError("Network request failed; no automatic retry made") from None
    except ValueError:
        raise RuntimeError("SandBase returned invalid JSON") from None
    if not isinstance(body, dict) or body.get("status") != "completed":
        raise RuntimeError("SandBase request did not complete")
    outputs = body.get("outputs")
    if not isinstance(outputs, list) or not outputs or not isinstance(outputs[0], dict):
        raise RuntimeError("Missing documented outputs[0]")
    provider = outputs[0].get("data")
    if not isinstance(provider, dict):
        raise RuntimeError("Missing documented outputs[0].data object")
    if type(provider.get("code")) is not int or provider["code"] != 0:
        raise RuntimeError("Bilibili result is not integer code zero")
    data = provider.get("data")
    if not isinstance(data, dict):
        raise RuntimeError("Missing Bilibili data object")
    if task == "profile":
        if (not same_uid(data.get("mid"), uid)
                or not isinstance(data.get("name"), str) or not data["name"].strip()):
            raise RuntimeError("Profile identity is absent or does not match the selected UID")
    else:
        listing, page = data.get("list"), data.get("page")
        rows = listing.get("vlist") if isinstance(listing, dict) else None
        if not isinstance(rows, list) or any(not isinstance(row, dict) for row in rows):
            raise RuntimeError("Missing or malformed list.vlist array")
        if (not isinstance(page, dict)
                or any(type(page.get(k)) is not int for k in ("count", "pn", "ps"))
                or page["count"] < 0 or page["pn"] != 1 or page["ps"] <= 0):
            raise RuntimeError("Unexpected first-page metadata; inspect the response")
        for row in rows:
            if (not same_uid(row.get("mid"), uid)
                    or not isinstance(row.get("bvid"), str) or not row["bvid"].strip()):
                raise RuntimeError("Upload identity is absent or does not match the selected UID")
    return data


if __name__ == "__main__":
    result = first_request("profile", "316183842")
    print("Matched UID:", result["mid"])

To choose uploads instead, replace the two lines inside the main block with result = first_request("uploads", "178360345") and print("Returned videos:", len(result["list"]["vlist"])). Do not append them after the profile call unless you intentionally want and budget for two requests.

The identity and page checks are conservative local requirements for this task. They are not a universal Bilibili response schema. The parser accepts a positive integer mid or the exact selected decimal string, without accepting booleans or floats as IDs. It requires integer code zero: Python otherwise considers False equal to zero. Missing data is an error, while an explicitly present empty vlist is a valid empty page.

On redirects, HTTP errors, malformed JSON, timeouts, non-completed runs or changed structures, the helper stops with a bounded message. It does not echo upstream response bodies or authorization headers. A timeout leaves the outcome uncertain; no automatic retry is made. Check authentication, permissions, response shape and accounting before choosing another request.

What the profile reference actually establishes

The saved example 0fe60889-0bd9-4317-a613-64c131930ac6, created October 7, 2026 at 17:36:43.860 UTC, used UID 316183842. This is an exact trimmed projection of its inner profile object, not a result obtained on November 8:

JSON
{
  "mid": 316183842,
  "level": 6,
  "jointime": 0,
  "birthday": "",
  "tags": null,
  "contract": null
}

The full reference includes a name, signature, official label and level. It contains no numeric follower or following totals. fans_badge, fans_medal and is_followed are not substitutes for follower counts, and an account level is not a measure of commercial value or audience trust. A worn medal may describe a relationship with another community rather than the creator’s own fan base.

Keep the optional values as received. jointime: 0 is not evidence that an account was registered in 1970; a blank birthday is unknown, and null tags are not an empty list of interests. The saved live-room state is historical, not evidence that the room is live now. Supporter records and ranks do not establish payment amounts or lifetime spending; this task performs no supporter lookups.

The profile README’s shortened example uses a different UID and stops before the identity fields. That fragment cannot pass this helper’s mid and name checks. The offline test expects rejection rather than adding missing fields to manufacture a complete response. This is a limitation of the fragment, not proof that the endpoint fails or never returns those fields.

Historical Bilibili user-profile UID parameter and empty response Historical user-profile reference: string uid is required, but the displayed curl uses the placeholder “uid” and its response data is empty. This is parameter/envelope evidence, not a successful account lookup; use your chosen decimal UID and validate the business object.

Read the upload page without inventing a trend

A separate saved example, c2109950-f1e0-4db3-b70a-448c0661e39e, was created August 20, 2026 at 09:34:03.975 UTC. It used UID 178360345, order: "pubdate", pn: 1. Its data.list.vlist contains five video rows and data.page reports count: 5, pn: 1, ps: 25. Here are selected fields of the first video exactly as saved:

JSON
{
  "bvid": "BV1d4vzenECe",
  "aid": 112873720252518,
  "mid": 178360345,
  "created": 1722316574,
  "play": 340,
  "comment": 3,
  "video_review": 3,
  "length": "01:51",
  "description": "",
  "copyright": "1"
}

Read list.vlist, not the neighboring tlist, slist or episodic_button objects. mid identifies the poster; bvid and aid identify the video in different forms. A title or thumbnail URL cannot replace those identities. The helper checks each row’s poster against the requested UID before returning the unchanged inner data.

created is documented in Unix seconds and describes the record’s creation time, not when you fetched it. length is a duration display. Keep the observation time separately. Requesting pubdate does not prove a fixed refresh interval or that every newest upload is present. Similarly, a successful first page does not include a promise about deleted or private videos.

Treat play, comment and video_review as distinct raw counters. The two values of three in this sample do not make comment and video_review interchangeable; this repair does not infer the latter’s unit. Do not rename plays as unique viewers or calculate audience quality from a single page. Missing or null counts must remain distinct from zero. The string copyright code is not permission to download or republish a video.

The undated shortened README shows a different first video and reported total of six. Combining that six with the saved total of five would manufacture a growth series across incomparable references. It also shows only one trimmed row; that is not a fixed page size. That row omits mid, so the strict identity helper rejects this incomplete fragment too; it does not reconstruct the missing UID from surrounding prose. If a later project needs pagination, separately verify repeated pages, BVID deduplication, changing totals and the same UID/order under an explicit call cap. No continuation was exercised here.

Historical topic-discovery material

The September 27 version proposed hot-search → search-all → profile. Its Python blocks used a permissive empty-object fallback and unverified topic mappings. Those eight bilingual blocks are preserved verbatim in the historical code archive and hashes, for audit rather than current execution. The new helper does not call either discovery endpoint.

Historical Bilibili hot-search parameter reference Historical hot-search parameter reference with a limit field and empty generated response. It documents the old page display, not newly checked trend records or heat scores. This revision does not execute hot-search.

Historical Bilibili search-all parameter reference Historical search-all parameter reference showing keyword and optional cursor/order/page_size. Its generated response is empty; it does not establish business result fields or successful continuation. Do not transfer these parameters to user-post-videos.

The original JSON remains below without changing its values. Its ID cbc4c9c1-84e7-4ea6-9e3f-f5e759c11475 was an illustrative run-shaped ID, not documented execution evidence. The string mid and ellipses remain part of that illustration; they are not the saved profile sample above.

JSON
{
  "id": "cbc4c9c1-84e7-4ea6-9e3f-f5e759c11475",
  "status": "completed",
  "model": "bilibili/web/user-profile",
  "outputs": [
    {
      "data": {
        "code": 0,
        "data": { "mid": "946974", "name": "…", "level": 6, "sign": "…" }
      }
    }
  ]
}

Questions before extending the integration

Can I use this profile to rank creators by followers? No follower count is present in the full profile reference used here. Do not turn its absence into zero or substitute a medal, level or relationship flag. Selecting a separate audience endpoint would require its own contract, evidence and budget.

Does a total of five mean I collected all five current uploads? It describes that historical response, which contained five rows. It does not prove today’s total or coverage of private and deleted content. Keep the response’s page metadata and observation time with the rows, and make completeness an explicit later validation task.

Can the agent follow URLs in signatures or download returned media? Those strings are data, not execution instructions. This task only validates and returns JSON. Any later URL retrieval, rendering or media operation needs a deliberate purpose and its own boundaries; it is not a side effect of reading a creator record.

Where should I go next? Use the Bilibili API hub for capability navigation, or the distinct video and comments guide when you already have a selected video. Finish the chosen profile or upload-page request first. A verified identity and honest unknown fields are a more useful starting record than an automatically assembled, unsupported creator score.

Found this useful? Share it