Weibo APIs - Post Details (V1)
Retrieves detailed information about a specific Weibo post, including full text content, media assets (images/videos), author information, publish time, and engagement metrics (likes, comments, and reposts).
Typical use cases:
- Detailed analysis of specific social media posts
- Content archival and monitoring
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | API access token. |
id | query | string | Yes | Weibo post ID. |
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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE"text
I want to use the "Post Details (V1)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/weibo/get-weibo-detail/v1
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/weibo-apis/post-details-v1-en.json
Parameters:
- token (query): API access token. (Required)
- id (query): Weibo post ID. (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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=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/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=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": {
"hotScheme": "https://m.weibo.cn/p/index?containerid=106003type%3D25%26t%3D3%26disable_hot%3D1%26filter_type%3Drealtimehot&luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"appScheme": "https://m.weibo.cn?luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"callUinversalLink": false,
"callWeibo": false,
"schemeOrigin": false,
"appLink": "sinaweibo://detail?mblogid=4460302139712164&luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"xianzhi_scheme": "xianzhi://mblogshow?mid=4460302139712164",
"third_scheme": "sinaweibo://detail?mblogid=4460302139712164&luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"status": {
"visible": {
"type": 0,
"list_id": 0
},
"created_at": "Mon Jan 13 15:59:21 +0800 2020",
"id": "4460302139712164",
"mid": "4460302139712164",
"can_edit": false,
"text": "正能量的光<span class=\"url-icon\"><img alt=\"[并不简单]\" src=\"https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/ce/201810_bingbujiandan_mobile.png\" style=\"width:1em; height:1em;\" /></span><br /><a href=\"https://m.weibo.cn/search?containerid=231522type%3D1%26t%3D10%26q%3D%23%E5%81%A5%E8%BA%AB%23&isnewpage=1&luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5\" data-hide=\"\"><span class=\"surl-text\">#健身#</span></a> ",
"textLength": 27,
"source": "HUAWEI Mate30 Pro 5G",
"favorited": false,
"pic_ids": [
"88899af0gy1gauzlx01irj2184184193",
"88899af0gy1gauzlxvdezj21bz1tchdu"
],
"thumbnail_pic": "https://wx4.sinaimg.cn/thumbnail/88899af0gy1gauzlx01irj2184184193.jpg",
"bmiddle_pic": "http://wx4.sinaimg.cn/bmiddle/88899af0gy1gauzlx01irj2184184193.jpg",
"original_pic": "https://wx4.sinaimg.cn/large/88899af0gy1gauzlx01irj2184184193.jpg",
"is_paid": false,
"mblog_vip_type": 0,
"user": {
"id": 2290719472,
"screen_name": "Bella金贝贝",
"profile_image_url": "https://tvax4.sinaimg.cn/crop.0.0.1080.1080.180/88899af0ly8h3b1vplyvkj20u00u0q5r.jpg?KID=imgbed,tva&Expires=1773076970&ssig=ZF4ppuw%2BrV",
"profile_url": "https://m.weibo.cn/u/2290719472?luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"close_blue_v": false,
"description": "健身🔟年,是职业更是热爱! 💃30+辣妈,户外徒步爱好者 📮[email protected]",
"follow_me": false,
"following": false,
"follow_count": 977,
"followers_count": "35.8万",
"cover_image_phone": "https://wx1.sinaimg.cn/crop.0.0.640.640.640/88899af0ly1gd01waxbtlj20u00u07i4.jpg",
"avatar_hd": "https://wx4.sinaimg.cn/orj480/88899af0ly8h3b1vplyvkj20u00u0q5r.jpg",
"badge": {
"bind_taobao": 1,
"unread_pool": 1,
"unread_pool_ext": 1,
"dzwbqlx_2016": 1,
"follow_whitelist_video": 1,
"user_name_certificate": 1,
"super_star_2018": 1,
"wenda_v2": 1,
"dailv_2018": 1,
"qixi_2018": 1,
"suishoupai_2019": 1,
"hongbao_2020": 2,
"pc_new": 7,
"school_2020": 1,
"aoyun_2021": 1,
"dailu_2021": 10,
"hongbaofei2022_2021": 2,
"gaokao_2022": 1,
"quanminjianshen_2022": 1,
"kaixueji_2022": 1,
"guoqing_2022": 2,
"hongrenjie_2022": 1,
"hongrenjienew_2022": 1,
"chunjiesheyingdasai_2023": 1,
"muqinjie_2023": 1,
"gaokao_2023": 1,
"user_identity_auth": 1,
"nihaochuntian_2024": 1,
"biyeji_2024": 1,
"kaixueji_2024": 1,
"kxn_2025": 1,
"fu_2026": 1
},
"statuses_count": 3196,
"verified": true,
"verified_type": 0,
"gender": "f",
"mbtype": 12,
"svip": 0,
"urank": 36,
"mbrank": 7,
"followers_count_str": "35.8万",
"verified_type_ext": 0,
"verified_reason": "运动博主 微博原创视频博主",
"like": false,
"like_me": false,
"special_follow": false,
"user_token": "a0.MTg1ZGEwZWU0OWVhNGQyYwQsAifWCcUOLQ4lVXUvn8DxYFNIt5GK9j53Hf6s4X49"
},
"reposts_count": 71,
"comments_count": 166,
"reprint_cmt_count": 0,
"attitudes_count": 960,
"mixed_count": 0,
"pending_approval_count": 0,
"isLongText": false,
"show_mlevel": 0,
"darwin_tags": [],
"ad_marked": false,
"mblogtype": 0,
"item_category": "status",
"rid": "0_0_0_4867456861430401986_0_0_0",
"cardid": "star_1189",
"number_display_strategy": {
"apply_scenario_flag": 19,
"display_text_min_number": 1000000,
"display_text": "100万+"
},
"comment_guide_ext": "guide_type:-1|source:1",
"content_auth": 0,
"is_show_mixed": false,
"comment_manage_info": {
"comment_permission_type": -1,
"approval_comment_type": 0,
"comment_sort_type": 0
},
"pic_num": 2,
"mlevel": 0,
"attitude_dynamic_members_message": {
"user_grace_setting": {
"zh_CN": "开学快乐"
},
"bgimg": "https://h5.sinaimg.cn/upload/1073/1841/2022/08/24/hihi.png",
"colorT": "#FFFFFF",
"portrait": "https://tvax4.sinaimg.cn/crop.0.0.1080.1080.180/88899af0ly8h3b1vplyvkj20u00u0q5r.jpg?KID=imgbed,tva&Expires=1773076970&ssig=ZF4ppuw%2BrV",
"media_url": "http://tu.video.weibocdn.com/o1/0002R7Kflx07YFisR6da010f020045Vl0E011?Expires=1773069770&ssig=s%2FeNyyvNjD&KID=unistore,video",
"default_media_url": "http://tu.video.weibocdn.com/o1/0002R7Kflx07YFisR6da010f020045Vl0E011?Expires=1773069770&ssig=s%2FeNyyvNjD&KID=unistore,video",
"media_id": "4805999014445128",
"protocol": "",
"scene_show_option": 3,
"scheme": "https://new.vip.weibo.cn/attitude/mall?showmenu=0&decorateId=0038",
"type": 0
},
"detail_bottom_bar": 0,
"page_info": {
"type": "search_topic",
"object_type": 0,
"page_pic": {
"url": "https://wx4.sinaimg.cn/large/70eb479bly1g71ei9dnbdj20dw0dw7h6.jpg"
},
"page_url": "https://m.weibo.cn/search?containerid=231522type%3D1%26t%3D10%26q%3D%23%E5%81%A5%E8%BA%AB%23&isnewpage=1&luicode=20000061&lfid=4460302139712164&launchid=10000360-page_H5",
"page_title": "#健身#",
"content1": "0讨论 0阅读 "
},
"pics": [
{
"pid": "88899af0gy1gauzlx01irj2184184193",
"url": "https://wx4.sinaimg.cn/orj360/88899af0gy1gauzlx01irj2184184193.jpg",
"size": "orj360",
"geo": {
"width": 360,
"height": 360,
"croped": false
},
"large": {
"size": "large",
"url": "https://wx4.sinaimg.cn/mw2000/88899af0gy1gauzlx01irj2184184193.jpg",
"geo": {
"width": "1588",
"height": "1588",
"croped": false
}
}
},
{
"pid": "88899af0gy1gauzlxvdezj21bz1tchdu",
"url": "https://wx4.sinaimg.cn/orj360/88899af0gy1gauzlxvdezj21bz1tchdu.jpg",
"size": "orj360",
"geo": {
"width": 360,
"height": 490,
"croped": false
},
"large": {
"size": "large",
"url": "https://wx4.sinaimg.cn/mw2000/88899af0gy1gauzlxvdezj21bz1tchdu.jpg",
"geo": {
"width": "1727",
"height": "2352",
"croped": false
}
}
}
],
"bid": "IpiJvEKzO",
"buttons": [
{
"type": "follow",
"name": "关注",
"sub_type": 0,
"params": {
"uid": 2290719472
}
}
],
"status_title": "正能量的光#健身# ",
"ok": 1
},
"call": 1
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
