Bilibili APIs - User Profile (V2)
prod-global
GET
/api/bilibili/get-user-detail/v2
Retrieve detailed profile information of a specific Bilibili user, including username, avatar, level, and verification status.
Typical use cases:
- Analyzing creator's profile, level, and verification status.
- Verifying user identity and social presence on Bilibili.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | Access token for the API. |
uid | query | string | Yes | Bilibili User ID (UID). |
Code Samples
💡 Environment Note
Default samples use https://api.justoneapi.com (prod-global). For users in Mainland China, it is recommended to replace it with http://47.117.133.51:30015 (prod-cn) for better performance. See Environment Guide.
bash
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE"text
I want to use the "User Profile (V2)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/bilibili/get-user-detail/v2
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/bilibili-apis/user-profile-v2-en.json
Parameters:
- token (query): Access token for the API. (Required)
- uid (query): Bilibili User ID (UID). (Required)
Return format: JSON
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set request timeout to at least 60 seconds.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
Please help me write a script in my preferred programming language to call this API and handle the response.python
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE"
response = requests.get(url)
print(response.json())js
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/bilibili/get-user-detail/v2?token=YOUR_API_KEY&uid=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
json
{
"code": 0,
"data": {
"common": {
"userInfo": {
"isLogin": false,
"face": "",
"vipStatus": 0,
"vipType": 0
},
"serverConfig": {
"constants": {
"newClipboard": false
},
"limitChannel": {
"ua": [
"MicroMessenger",
"wxwork",
"Weibo",
"qzone/.*_qz_([\\d.]+)",
"QQ/([\\d\\.]+)",
"NewsArticle",
"GoldBrowser",
"WukongSearch",
"wksearch",
"SKLand",
"Googlebot"
],
"bsource": [
"bilibili-toutiao",
"search_google",
"bddj"
],
"referrer": [
"(.)*\\.google.com"
]
},
"customChannel": {
"bsource": [
"OPPO_search",
"vendor_vivo_widget_search"
]
},
"switch": {
"search_h5_style": "column1"
}
},
"abtest": {
"h5_recommend_trend": "1"
},
"ua": "Mozilla/5.0 (Linux; Android 10; CLT-AL00 Build/HUAWEICLT-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/11.20 SP-engine/2.16.0 baiduboxapp/11.20.0.14 (Baidu; P1 10) NABar/1.0",
"browser": {
"mobile": true,
"ios": false,
"android": true,
"windowsphone": false,
"iPhone": false,
"iPad": false,
"webApp": false,
"MicroMessenger": false,
"wechat": false,
"weibo": false,
"uc": false,
"qq": false,
"baidu": true,
"mqq": false,
"mbaidu": true,
"iqiyi": false,
"QQLive": false,
"Safari": false,
"Youku": false,
"chrome": false,
"CMDC": false,
"xiaomiqjs": false,
"baiduspider": false,
"zhihu": false,
"wxwork": false,
"quark": false,
"harmonyOSNext": false,
"oppoBrowser": false
},
"defDomain": "",
"isWxTagLaunch": false,
"noCallApp": false,
"switch": {
"search_h5_style": "column1"
}
},
"home": {
"hotList": {
"result": [],
"extra": {},
"error": false,
"noMore": false
}
},
"channel": {
"channelConfig": [],
"channelData": {},
"serverFetched": null
},
"video": {
"error": 0,
"isClient": false,
"breadcrumb": {},
"viewInfo": {},
"upInfo": {},
"related": {
"result": [],
"extra": {},
"error": false,
"noMore": false
},
"tags": [],
"elec": {},
"p": 0,
"avid": 0,
"bvid": "",
"quality": {},
"playUrlInfo": {},
"playState": "init",
"bsource": "",
"gameMode": false,
"keyword": "",
"trackId": "",
"togglePlay": true,
"isTab3": false,
"isCustom": false,
"isSem": false,
"reportMsg": {},
"pageType": "share",
"playerSettings": {},
"videoPageSettings": {},
"isRelatedUp": false,
"archiveType": 0,
"archiveConfigId": "",
"eventConfig": {
"topBannerImage": "",
"topSearchUrl": {
"type": "browser",
"urlH5": "",
"searchKeyword": ""
},
"topButtonUrl": {
"type": "browser",
"urlH5": "",
"searchKeyword": ""
},
"bottomBannerImage": "",
"bottomBannerUrl": {
"type": "browser",
"urlH5": "",
"searchKeyword": ""
},
"mainCallButtonText": "",
"relatedTabText": {
"text": "",
"videoListID": ""
},
"relatedTabList": []
},
"hotWord": "",
"hotSearchVideoList": []
},
"search": {
"searchAllResult": {
"extra": {
"count": {
"video": 0,
"media_bangumi": 0,
"bili_user": 0,
"media_ft": 0
},
"pgcList": [],
"filmList": []
},
"totalrank": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"click": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"pubdate": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"dm": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
}
},
"searchBangumiResult": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"searchUserResult": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"searchFilmResult": {
"result": [],
"noMore": false,
"page": 0,
"total": 0
},
"openAppDialog": true,
"keyword": "",
"isCustom": false,
"bsource": ""
},
"space": {
"mid": 472747194,
"info": {
"mid": 472747194,
"name": "巫师财经",
"sex": "男",
"face": "https://i0.hdslb.com/bfs/face/c518dc95663850d075a90897de617cc634151f7a.jpg",
"face_nft": 0,
"face_nft_type": 0,
"sign": "前中金分析师,合作:nef_mk,文字和图表都发在公众号了,自取随便用,就说是你写的",
"rank": 10000,
"level": 6,
"jointime": 0,
"moral": 0,
"silence": 0,
"control": 0,
"coins": 0,
"fans_badge": true,
"fans_medal": {
"show": false,
"wear": false,
"medal": null,
"detail": null
},
"official": {
"role": 1,
"title": "bilibili 知名UP主",
"desc": "",
"type": 0
},
"vip": {
"type": 1,
"status": 0,
"due_date": 1702051200000,
"vip_pay_type": 0,
"theme_type": 0,
"label": {
"path": "",
"text": "",
"label_theme": "",
"text_color": "",
"bg_style": 0,
"bg_color": "",
"border_color": "",
"use_img_label": true,
"img_label_uri_hans": "",
"img_label_uri_hant": "",
"img_label_uri_hans_static": "https://i0.hdslb.com/bfs/vip/d7b702ef65a976b20ed854cbd04cb9e27341bb79.png",
"img_label_uri_hant_static": "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/KJunwh19T5.png",
"label_id": 0,
"label_goto": null
},
"avatar_subscript": 0,
"nickname_color": "",
"role": 0,
"avatar_subscript_url": "",
"tv_vip_status": 0,
"tv_vip_pay_type": 0,
"tv_due_date": 0,
"avatar_icon": {
"icon_resource": {}
},
"ott_info": {
"vip_type": 0,
"pay_type": 0,
"pay_channel_id": "",
"status": 0,
"overdue_time": 0
},
"super_vip": {
"is_super_vip": false
}
},
"pendant": {
"pid": 0,
"name": "",
"image": "",
"expire": 0,
"image_enhance": "",
"image_enhance_frame": "",
"n_pid": 0
},
"nameplate": {
"nid": 0,
"name": "",
"image": "",
"image_small": "",
"level": "",
"condition": ""
},
"user_honour_info": {
"mid": 0,
"colour": null,
"tags": [],
"is_latest_100honour": 0
},
"is_followed": false,
"top_photo": "bfs/space/cd52d4ac1d336c940cc4958120170f7928d9e606.png",
"sys_notice": {},
"live_room": null,
"birthday": "01-22",
"school": null,
"profession": {
"name": "",
"department": "",
"title": "",
"is_show": 0
},
"tags": [
"资本永不眠"
],
"series": {
"user_upgrade_status": 3,
"show_upgrade_window": false
},
"is_senior_member": 0,
"mcn_info": null,
"gaia_res_type": 0,
"gaia_data": null,
"is_risk": false,
"elec": {
"show_info": {
"show": true,
"state": 2,
"title": "充电",
"icon": "https://i0.hdslb.com/bfs/garb/item/33e2e72d9a0c855f036b4cb55448f44af67a0635.png",
"jump_url": "https://www.bilibili.com/h5/upower/index?mid=472747194&navhide=1&oid=472747194",
"total": 7697,
"list": [
{
"pay_mid": 362793762,
"rank": 1,
"avatar": "https://i0.hdslb.com/bfs/face/1050e369495e476333d73c83371a894a9b12ce75.jpg",
"uname": "cathiegao"
},
{
"pay_mid": 279173605,
"rank": 2,
"avatar": "https://i1.hdslb.com/bfs/face/c1de1ed35d0b19b355fec5a3c7177fbbcd17f801.jpg",
"uname": "小石头21126"
},
{
"pay_mid": 210411350,
"rank": 3,
"avatar": "https://i2.hdslb.com/bfs/face/6d9ef0098bb5d8448af88be78a32465264c44b69.jpg",
"uname": "東青先生"
},
{
"pay_mid": 10302270,
"rank": 4,
"avatar": "https://i0.hdslb.com/bfs/face/edde8ef9e029c298dc2fad663ef948b20ef2d489.jpg",
"uname": "JosephZ8901"
},
{
"pay_mid": 494571761,
"rank": 5,
"avatar": "https://i0.hdslb.com/bfs/face/member/noface.jpg",
"uname": "小羊角ge"
},
{
"pay_mid": 18757174,
"rank": 6,
"avatar": "http://i0.hdslb.com/bfs/face/member/noface.jpg",
"uname": "热呢俄"
},
{
"pay_mid": 324177027,
"rank": 7,
"avatar": "https://i0.hdslb.com/bfs/face/fe639d57dccc65fade152617fc31fb92dc184433.jpg",
"uname": "doidi"
},
{
"pay_mid": 1389275292,
"rank": 8,
"avatar": "https://i0.hdslb.com/bfs/face/3f6bece9bf66560792f0fa5ca2f5d1d8a7c65b24.jpg",
"uname": "云の生活"
},
{
"pay_mid": 18163644,
"rank": 9,
"avatar": "http://i0.hdslb.com/bfs/face/f22001df5c14b29565c82a460533f26f53ceb34f.jpg",
"uname": "工藤凉平"
},
{
"pay_mid": 521534,
"rank": 10,
"avatar": "https://i0.hdslb.com/bfs/face/member/noface.jpg",
"uname": "boroboro"
},
{
"pay_mid": 2141299866,
"rank": 11,
"avatar": "https://i0.hdslb.com/bfs/face/cd3eb173a3b87c1c3b44e045bef1b5e9e3a5d8f9.jpg",
"uname": "笋哲"
}
],
"upower_count_show": true,
"long_title": "",
"jump_url_web": "https://member.bilibili.com/mall/upower-pay?mid=472747194"
}
},
"contract": null,
"certificate_show": false,
"name_render": null,
"top_photo_v2": {
"sid": 9,
"l_img": "https://i0.hdslb.com/bfs/space/cd52d4ac1d336c940cc4958120170f7928d9e606.png",
"l_200h_img": "https://i0.hdslb.com/bfs/activity-plat/static/0977767b2e79d8ad0a36a731068a83d7/uL5vWnvU3i.png"
},
"theme": null,
"attestation": {
"type": 2,
"common_info": {
"title": "bilibili 知名UP主",
"prefix": "bilibili UP主认证",
"prefix_title": "bilibili UP主认证:bilibili 知名UP主"
},
"splice_info": {
"title": "bilibili 知名UP主"
},
"icon": "https://i0.hdslb.com/bfs/activity-plat/static/20230828/e3b8ebec8e86f060b930a2c0536bb88b/72wejSxl9Z.png",
"desc": ""
}
},
"feedList": {
"result": [],
"extra": {},
"error": false,
"noMore": false
}
},
"opus": {
"id": "",
"detail": null,
"preview": null,
"isClient": false,
"fallback": {
"id": "",
"type": 0
},
"verifyData": null,
"isTab3": false,
"uniqueK": ""
},
"tag": {
"tagInfo": {},
"tagSimilar": [],
"tagRelated": {
"result": [],
"extra": {},
"error": false,
"total": 0
}
},
"topic": {
"topicDetail": {},
"activities": {},
"ads": {},
"topicId": 0,
"topicListResult": {
"result": [],
"extra": {},
"no_more": false,
"error": false,
"total": 0
},
"relevantTopics": [],
"headerTextColor": 0,
"isExpanded": false
},
"playlist": {
"mediaId": "",
"ps": 20,
"tid": 0,
"playlistType": 3,
"p": 1,
"isClient": false,
"hasMore": true,
"mediaData": {
"mediaList": [],
"ps": 20,
"pn": 1,
"noMore": false
},
"mediaList": [],
"randomList": [],
"videoIndex": 0,
"videoInfo": {},
"playMode": "order",
"playUrl": [],
"forbidPreview": false,
"playEnd": false,
"playSum": 0
},
"tribee": {
"tribeeBaseInfo": {},
"tribeeList": [],
"tribeeListTotal": 0,
"tribeeInviteDefer": null,
"tribeeInviteInfo": null,
"tribeeSteamHomeInfo": {}
},
"route": {
"name": "space",
"path": "/space/472747194",
"hash": "",
"query": {},
"params": {
"id": "472747194"
},
"fullPath": "/space/472747194",
"meta": {},
"from": {
"name": null,
"path": "/",
"hash": "",
"query": {},
"params": {},
"fullPath": "/",
"meta": {}
}
}
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
