账号授权
https://api.bilibili.com/x/account-oauth2/v1/token
开放能力
本文档介绍了第三方应用如何接入哔哩哔哩 OAuth 2.0, 可使用户授权第三方应用访问其哔哩哔哩上基本开放信息和其他已授权的相关信息,而无需将用户名和密码提供给第三方应用。
url 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| client_id | string | 是 | 申请应用时分配的client_id |
| client_secret | string | 是 | 申请应用时分配的secret |
| grant_type | string | 是 | 请求的类型,此处的值固定为"authorization_code" |
| code | string | 是 | 授权拿到的code值 |
响应字段
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| refresh_token | string | 是 | refresh_token续期令牌 |
| access_token | string | 是 | access_token |
| expires_in | int | 是 | 过期时间(UTC时间) |
| scopes | []string | 是 | 用户已授权的权限点 |
调用方式
javascript
// 让 AI 直接调(需要开放平台凭据)
bili_api_call { "ref": "1", "query": {…}, "body": {…} }
// 只看将要发出的请求(不需要凭据)
bili_api_call { "ref": "1", "dryRun": true }
// 生成完整调用代码
bili_codegen { "ref": "1", "lang": "python" }原始文档:001_账号授权.md(6280 字节)。用 bili_docs_get { "ref": "1" } 读全文,或用 bili_api_spec { "ref": "1" } 取结构化规格。