微博 API - 用户资料 (V3)
prod-global
GET
/api/weibo/get-user-detail/v3
获取指定微博用户的详细资料信息,包括昵称、头像、用户ID、粉丝/关注数量、个人简介及认证状态。
典型应用场景:
- 创作者/KOL识别与监测
- 为分析和报告丰富用户记录
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
token | query | string | 是 | API 访问令牌。 |
uid | query | string | 是 | 微博用户ID (UID)。 |
代码示例
💡 环境说明
默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择。
bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/weibo/get-user-detail/v3?token=YOUR_API_KEY&uid=VALUE"text
我想使用 Just One API 提供的“用户资料 (V3)”接口。
接口地址: https://api.justoneapi.com/api/weibo/get-user-detail/v3
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/weibo-apis/user-profile-v3-zh.json
请求参数说明:
- token (query): API 访问令牌。 (必填)
- uid (query): 微博用户ID (UID)。 (必填)
返回格式: JSON
响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
- 0: 成功
- 100: Token 无效或已失效
- 301: 采集失败,请重试
- 302: 超出速率限制
- 303: 超出每日配额
- 400: 参数错误
- 500: 内部服务器错误
- 600: 权限不足
- 601: 余额不足
请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/weibo/get-user-detail/v3?token=YOUR_API_KEY&uid=VALUE"
response = requests.get(url)
print(response.json())js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/weibo/get-user-detail/v3?token=YOUR_API_KEY&uid=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 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/weibo/get-user-detail/v3?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
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/weibo/get-user-detail/v3?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
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/weibo/get-user-detail/v3?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;响应结果
json
{
"code": 0,
"data": {
"ok": 1,
"data": {
"user": {
"id": 7448795925,
"idstr": "7448795925",
"pc_new": 7,
"screen_name": "A2O_WORLD",
"profile_image_url": "https://tvax1.sinaimg.cn/crop.0.0.1080.1080.50/00886o5Lly8iaq3yj8ssrj30u00u03ys.jpg?KID=imgbed,tva&Expires=1773077735&ssig=JkCC5UPCtr",
"profile_url": "/u/7448795925",
"verified": true,
"verified_type": 0,
"domain": "a2ozone",
"weihao": "",
"verified_type_ext": 2,
"status_total_counter": {
"total_cnt_format": "63.9万",
"comment_cnt": "74,298",
"repost_cnt": "26,171",
"like_cnt": "538,235",
"total_cnt": "638,704"
},
"avatar_large": "https://tvax1.sinaimg.cn/crop.0.0.1080.1080.180/00886o5Lly8iaq3yj8ssrj30u00u03ys.jpg?KID=imgbed,tva&Expires=1773077735&ssig=SLJr3Ap5A6",
"avatar_hd": "https://tvax1.sinaimg.cn/crop.0.0.1080.1080.1024/00886o5Lly8iaq3yj8ssrj30u00u03ys.jpg?KID=imgbed,tva&Expires=1773077735&ssig=0nYBMaDrfF",
"follow_me": false,
"following": false,
"mbrank": 1,
"mbtype": 12,
"v_plus": 0,
"user_ability": 2376200,
"planet_video": false,
"verified_reason": "A2O Entertainment官方微博",
"description": "A2O官方网站:https://www.a2oentertainment.com.cn",
"location": "北京",
"gender": "m",
"followers_count": 125870,
"followers_count_str": "12.6万",
"friends_count": 36,
"statuses_count": 326,
"url": "",
"svip": 1,
"vvip": 1,
"cover_image_phone": "https://wx2.sinaimg.cn/crop.0.0.640.640.640/00886o5Lgy1i6mf701fn5j31o01o0wkv.jpg",
"icon_list": [
{
"type": "vip",
"data": {
"mbrank": 1,
"mbtype": 12,
"svip": 1,
"vvip": 1
}
}
],
"user_type": 0,
"is_star": "0",
"is_muteuser": false,
"special_follow": false
},
"tabList": [
{
"name": "home",
"tabName": "精选"
},
{
"name": "feed",
"tabName": "微博"
},
{
"name": "newVideo",
"tabName": "视频"
},
{
"name": "superTopic",
"tabName": "超话"
},
{
"name": "album",
"tabName": "相册"
}
],
"blockText": ""
}
}
}💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。
