Weibo Post Details API (V1)
Retrieves details for a Weibo post identified by its post ID. Use it to look up a known post for content review, archiving, or related engagement analysis.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | API access token. |
id | query | string | Yes | - | Weibo post ID. |
Code Samples
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE'I want to use the "Post Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE
API Endpoint: BASE_URL + /api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/weibo/post-details-v1-en.json
Parameters:
- token (query): API access token. (Required)
- id (query): Weibo post ID. (Required)
Return format: safely handle JSON or text according to the actual Content-Type.
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 the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
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
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/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()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/weibo/get-weibo-detail/v1?token=YOUR_API_KEY&id=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}Response Fields
Key fields in a successful response (code = 0).
Post overview11 fields
data.status
The requested Weibo post.
| Field | Type | Description |
|---|---|---|
id | string | Numeric Weibo post identifier represented as a string. |
mid | string | Weibo message ID represented as a string. |
bid | string | Short alphanumeric identifier for the Weibo post. |
created_at | string | Post publication time in the original Weibo timestamp format. |
text | string | Post body as returned by Weibo. It may contain HTML markup. |
raw_text | string | Plain-text post body when Weibo provides it separately. |
textLength | integer | Post text length as reported by Weibo. |
source | string | Source label displayed for the post, when available. |
status_title | string | Title text displayed for the post. |
isLongText | boolean | Whether Weibo marks this post as long-form text. |
region_name | string | Region label displayed for the post. |
Engagement10 fields
data.status
| Field | Type | Description |
|---|---|---|
reposts_count | integer | Repost count reported by Weibo. |
comments_count | integer | Comment count reported by Weibo. |
attitudes_count | integer | Reaction count reported by Weibo. |
favorites_count | integer | Favorite count reported by Weibo. |
pending_approval_count | integer | Number of comments shown as pending approval. |
multi_attitude | array | Breakdown of reactions by type, when provided. |
multi_attitude[] | object | Reaction-count entry for one type. |
multi_attitude[].type | integer | Numeric code for the reaction type. |
multi_attitude[].count | integer | Count of reactions of that type. |
most_attitude_type | integer | Numeric type of the most common reaction reported by Weibo. |
Author20 fields
data.status.user
Public author information attached to the post.
| Field | Type | Description |
|---|---|---|
id | integer | Numeric Weibo user ID. |
screen_name | string | Displayed Weibo account name. |
description | string | Public profile description. |
profile_image_url | string | Profile avatar URL. |
avatar_hd | string | High-resolution avatar URL. |
profile_url | string | Profile link returned by Weibo. |
cover_image_phone | string | Profile cover image URL for the mobile view. |
verified | boolean | Whether Weibo marks the account as verified. |
verified_type | integer | Numeric account verification type recorded by Weibo. |
verified_type_ext | integer | Additional numeric account verification classification. |
verified_reason | string | Verification description displayed for the account. |
statuses_count | integer | Post count reported for the account. |
follow_count | integer | Number of accounts this account follows, as reported by Weibo. |
followers_count | string | Follower count returned as text. It may use an abbreviated display format. |
followers_count_str | string | Follower-count text provided for display. |
following | boolean | Whether the viewing account is marked as following this author. |
follow_me | boolean | Whether the author is marked as following the viewing account. |
gender | string | Gender code recorded on the public profile. |
mbrank | integer | Membership rank reported by Weibo. |
urank | integer | Account rank reported by Weibo. |
Pictures30 fields
data.status
| Field | Type | Description |
|---|---|---|
pic_num | integer | Picture count reported for the post. |
pic_ids | array | IDs of pictures attached to the post. The list may be empty. |
pic_ids[] | string | Weibo picture ID. |
thumbnail_pic | string | URL of the first picture at thumbnail size, when supplied. |
bmiddle_pic | string | URL of the first picture at medium size, when supplied. |
original_pic | string | URL in Weibo's original picture field, when supplied. |
pics | array | Details about attached pictures when Weibo includes them. |
pics[] | object | A picture attached to the post. |
pics[].pid | string | Weibo picture ID. |
pics[].size | string | Size label for this picture representation. |
pics[].url | string | URL of this picture representation. |
pics[].geo | object | Dimensions and crop indicator for the picture. |
pics[].geo.width | integer | Picture width in pixels. |
pics[].geo.height | integer | Picture height in pixels. |
pics[].geo.croped | boolean | Whether Weibo marks this picture as cropped. |
pics[].large | object | Larger picture representation, when provided. |
pics[].large.url | string | URL of the larger picture representation. |
pics[].large.size | string | Size label for this picture representation. |
pics[].large.geo | object | Dimensions and crop indicator for the picture. |
pics[].large.geo.width | string | Picture width in pixels, represented as text. |
pics[].large.geo.height | string | Picture height in pixels, represented as text. |
pics[].large.geo.croped | boolean | Whether Weibo marks this picture as cropped. |
pic_focus_point | array | Picture focal-area entries when provided. |
pic_focus_point[] | object | A focal area linked to one picture. |
pic_focus_point[].pic_id | string | Weibo picture ID. |
pic_focus_point[].focus_point | object | Focal area coordinates and size supplied by Weibo. |
pic_focus_point[].focus_point.left | integer | Left coordinate of the focal area. |
pic_focus_point[].focus_point.top | integer | Top coordinate of the focal area. |
pic_focus_point[].focus_point.width | integer | Width of the focal area. |
pic_focus_point[].focus_point.height | number | Height of the focal area. |
Content cards and video21 fields
data.status.page_info
Attached content card, such as a topic or a native video, when provided.
| Field | Type | Description |
|---|---|---|
type | string | Weibo card type label. |
object_type | integer | Numeric content object type recorded by Weibo. |
object_id | string | Weibo content object ID associated with the card. |
page_title | string | Title displayed for the content card. |
title | string | Title field returned with the content card. It may be empty. |
content1 | string | First text line returned for the content card. |
content2 | string | Second text line returned for the content card. |
page_pic | object | Image information for the content card. |
page_pic.pid | string | Weibo picture ID. |
page_pic.url | string | URL of the content-card image. |
page_pic.width | string | Picture width in pixels, represented as text. |
page_pic.height | string | Picture height in pixels, represented as text. |
video_orientation | string | Video orientation label supplied by Weibo. |
play_count | string | Playback count as display text. It can be abbreviated. |
media_info | object | Native video playback metadata when supplied. |
media_info.duration | number | Video duration reported by the playback metadata. |
media_info.stream_url | string | Video stream URL returned by Weibo. |
media_info.stream_url_hd | string | High-definition video stream URL returned by Weibo. |
urls | object | Available video URLs keyed by format. |
urls.mp4_hd_mp4 | string | High-definition MP4 URL when supplied. |
urls.mp4_ld_mp4 | string | Lower-definition MP4 URL when supplied. |
Visibility and comments13 fields
data.status
| Field | Type | Description |
|---|---|---|
is_paid | boolean | Whether Weibo marks this post as paid content. |
ad_marked | boolean | Whether Weibo marks the post as advertising. |
can_edit | boolean | Whether editing is available in the response context. |
favorited | boolean | Whether the post is marked as favorited in the response context. |
visible | object | Visibility settings returned with this post. |
visible.type | integer | Numeric visibility code reported by Weibo. |
visible.list_id | integer | Numeric ID of the associated visibility list. |
comment_manage_info | object | Comment settings reported for this post. |
comment_manage_info.comment_permission_type | integer | Numeric comment permission setting. |
comment_manage_info.approval_comment_type | integer | Numeric comment approval setting. |
comment_manage_info.comment_sort_type | integer | Numeric comment sorting setting. |
comment_manage_info.comment_anon_type | integer | Numeric anonymous commenting setting. |
forbid_bullet_screens | boolean | Whether bullet comments are marked as disabled. |
Original post10 fields
data.status.retweeted_status
The original post included with a repost, when available. Its author information can be null.
| Field | Type | Description |
|---|---|---|
id | string | Numeric Weibo post identifier represented as a string. |
mid | string | Weibo message ID represented as a string. |
bid | string | Short alphanumeric identifier for the Weibo post. |
created_at | string | Post publication time in the original Weibo timestamp format. |
text | string | Post body as returned by Weibo. It may contain HTML markup. |
textLength | integer | Post text length as reported by Weibo. |
source | string | Source label displayed for the post, when available. |
isLongText | boolean | Whether Weibo marks this post as long-form text. |
title | object | Title information attached to this post. |
title.text | string | Displayed title text. |
Original author20 fields
data.status.retweeted_status.user
Public author information attached to the post.
| Field | Type | Description |
|---|---|---|
id | integer | Numeric Weibo user ID. |
screen_name | string | Displayed Weibo account name. |
description | string | Public profile description. |
profile_image_url | string | Profile avatar URL. |
avatar_hd | string | High-resolution avatar URL. |
profile_url | string | Profile link returned by Weibo. |
cover_image_phone | string | Profile cover image URL for the mobile view. |
verified | boolean | Whether Weibo marks the account as verified. |
verified_type | integer | Numeric account verification type recorded by Weibo. |
verified_type_ext | integer | Additional numeric account verification classification. |
verified_reason | string | Verification description displayed for the account. |
statuses_count | integer | Post count reported for the account. |
follow_count | integer | Number of accounts this account follows, as reported by Weibo. |
followers_count | string | Follower count returned as text. It may use an abbreviated display format. |
followers_count_str | string | Follower-count text provided for display. |
following | boolean | Whether the viewing account is marked as following this author. |
follow_me | boolean | Whether the author is marked as following the viewing account. |
gender | string | Gender code recorded on the public profile. |
mbrank | integer | Membership rank reported by Weibo. |
urank | integer | Account rank reported by Weibo. |
Original attachments and video24 fields
data.status.retweeted_status
| Field | Type | Description |
|---|---|---|
pic_num | integer | Picture count reported for the post. |
pic_ids | array | IDs of pictures attached to the post. The list may be empty. |
page_info | object | Attached content card, such as a topic or a native video, when provided. |
page_info.type | string | Weibo card type label. |
page_info.object_type | integer | Numeric content object type recorded by Weibo. |
page_info.object_id | string | Weibo content object ID associated with the card. |
page_info.page_title | string | Title displayed for the content card. |
page_info.title | string | Title field returned with the content card. It may be empty. |
page_info.content1 | string | First text line returned for the content card. |
page_info.content2 | string | Second text line returned for the content card. |
page_info.page_pic | object | Image information for the content card. |
page_info.page_pic.pid | string | Weibo picture ID. |
page_info.page_pic.url | string | URL of the content-card image. |
page_info.page_pic.width | string | Picture width in pixels, represented as text. |
page_info.page_pic.height | string | Picture height in pixels, represented as text. |
page_info.video_orientation | string | Video orientation label supplied by Weibo. |
page_info.play_count | string | Playback count as display text. It can be abbreviated. |
page_info.media_info | object | Native video playback metadata when supplied. |
page_info.media_info.duration | number | Video duration reported by the playback metadata. |
page_info.media_info.stream_url | string | Video stream URL returned by Weibo. |
page_info.media_info.stream_url_hd | string | High-definition video stream URL returned by Weibo. |
page_info.urls | object | Available video URLs keyed by format. |
page_info.urls.mp4_hd_mp4 | string | High-definition MP4 URL when supplied. |
page_info.urls.mp4_ld_mp4 | string | Lower-definition MP4 URL when supplied. |
Original engagement and visibility18 fields
data.status.retweeted_status
| Field | Type | Description |
|---|---|---|
is_paid | boolean | Whether Weibo marks this post as paid content. |
ad_marked | boolean | Whether Weibo marks the post as advertising. |
can_edit | boolean | Whether editing is available in the response context. |
favorited | boolean | Whether the post is marked as favorited in the response context. |
visible | object | Visibility settings returned with this post. |
visible.type | integer | Numeric visibility code reported by Weibo. |
visible.list_id | integer | Numeric ID of the associated visibility list. |
visible.list_idstr | string | ID of the associated visibility list, represented as text. |
reposts_count | integer | Repost count reported by Weibo. |
comments_count | integer | Comment count reported by Weibo. |
attitudes_count | integer | Reaction count reported by Weibo. |
favorites_count | integer | Favorite count reported by Weibo. |
pending_approval_count | integer | Number of comments shown as pending approval. |
comment_manage_info | object | Comment settings reported for this post. |
comment_manage_info.comment_permission_type | integer | Numeric comment permission setting. |
comment_manage_info.approval_comment_type | integer | Numeric comment approval setting. |
comment_manage_info.comment_sort_type | integer | Numeric comment sorting setting. |
comment_manage_info.comment_anon_type | integer | Numeric anonymous commenting setting. |
Response information1 field
data
Weibo post details. This value can be null when a post is unavailable.
| Field | Type | Description |
|---|---|---|
canonical | string | Canonical link element supplied for the post, returned as HTML text. |