B 站 UP 主 信息接口文档 检测中...
接口地址: https://api.chyt.top/get_bilibili_info
请求方式: GET
返回格式: JSON
请求示例: https://api.chyt.top/get_bilibili_info?mid=8047632
接口说明: 获取指定 Bilibili 用户的基本信息,包括粉丝数、等级、会员状态等。
请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
mid | 是 | string | Bilibili 用户的唯一 ID |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
code | int | 请求状态码,200 表示成功,其他值表示失败 |
msg | string | 错误信息,仅当 code 非 200 时返回 |
mid | string | 用户的唯一 ID |
username | string | 用户名 |
sex | string | 性别(可能值:保密、男、女) |
followers | int | 粉丝数 |
avatar | string | 用户头像链接 |
sign | string | 用户签名 |
likes | int | 获赞数 |
archive | int | 投稿视频数 |
level | string | 账号等级(例如:V6) |
membership | string | 会员等级描述(例如:年度大会员) |
is_following | bool | 当前用户是否已关注 |
返回示例
成功响应:
json
{
"code": 200,
"mid": "8047632",
"username": "哔哩哔哩弹幕网",
"sex": "男",
"followers": 3598460,
"avatar": "https://i0.hdslb.com/bfs/face/0c84b9f4ad546d3f20324809d45fc439a2a8ddab.jpg",
"sign": "哔哩哔哩 干杯 ( ゜- ゜)つロ",
"likes": 46337365,
"archive": 254,
"level": "V6",
"membership": "十年大会员",
"is_following": false
}
代码示例
php
<?php
$url = 'https://api.chyt.top/get_bilibili_info?mid=8047632';
$response = file_get_contents($url);
echo $response;
?>
python
import requests
url = 'https://api.chyt.top/get_bilibili_info'
params = {'mid': '8047632'}
response = requests.get(url, params=params)
print(response.json())
JavaScript
const https = require('https');
const url = 'https://api.chyt.top/get_bilibili_info?mid=8047632';
https.get(url, (res) => {
res.on('data', (d) => process.stdout.write(d));
});
java
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) throws IOException {
URL url = new URL("https://api.chyt.top/get_bilibili_info?mid=8047632");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
String response;
while ((response = br.readLine()) != null) {
System.out.println(response);
}
}
}
}
C
#include <stdio.h>
#include <curl/curl.h>
int main() {
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.chyt.top/get_bilibili_info?mid=8047632");
CURLcode res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
return 0;
}