Skip to content

Weibo Post Comments API (V1) ​

GET
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...

Retrieves comments for a Weibo post identified by MID, with optional maxId cursor pagination and time or hot sorting. Use it to review audience discussion, continue through comment pages, or support moderation and feedback analysis.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-API access token.
midquerystringYes-Weibo post mid.
sortquerystringNoTIMESort order for the result set.


Available Values:

- TIME: Time

- HOT: Hot
maxIdquerystringNo-Pagination cursor returned by the previous response.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUE'
text
I want to use the "Post Comments (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUE
API Endpoint: BASE_URL + /api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/weibo/post-comments-v1-en.json

Parameters:
- token (query): API access token. (Required)
- mid (query): Weibo post mid. (Required)
- sort (query): Sort order for the result set.

Available Values:
- `TIME`: Time
- `HOT`: Hot
- maxId (query): Pagination cursor returned by the previous response.

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.
python
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=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")
js
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=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`);
  }
}
java
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-post-comments/v1?token=YOUR_API_KEY&mid=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");
        }
    }
}
go
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-post-comments/v1?token=YOUR_API_KEY&mid=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
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=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).

Pagination and filters12 fields

data

Weibo post comments for the requested page, with preview replies and pagination information.

FieldTypeDescription
okintegerStatus flag inside the Weibo comment payload.
total_numberintegerTotal comment count reported for the post. The current page can contain fewer entries.
max_idintegerCursor for the next post comment page. Pass its exact decimal text as maxId for the same post and sort. Zero indicates no next cursor. This field can be absent in an empty response.
dataarrayFirst-level comments for the requested page. This array can be empty.
data[]objectOne top-level comment on the requested Weibo post.
rootCommentarrayAdditional root-comment array reported with the response. The array was empty in verified samples.
tip_msgstringDisplay hint for the comment list. The string can be empty.
trendsTextstringTrends-related display text reported with the comment list.
filter_grouparrayFilter choices returned for the comment list.
filter_group[]objectOne filter choice shown for the comment list.
filter_group[].titlestringDisplay label of the filter choice.
filter_group[].isDefaultintegerNumeric flag for whether this is the default filter choice.
Top-level comment15 fields

data.data[]

FieldTypeDescription
idintegerComment ID returned as an integer. Use idstr when preserving exact digits.
idstrstringExact comment ID as a string.
midstringComment’s own MID as a string. The request parameter mid identifies the post.
rootidintegerRoot comment ID reported for the thread, returned as an integer.
rootidstrstringExact root comment ID as a string.
floor_numberintegerComment position number reported within the thread.
created_atstringCreation time of the comment as platform-formatted text.
textstringRendered comment content. This text can contain HTML.
text_rawstringRaw comment text when supplied separately from the rendered content.
sourcestringSource label displayed with the comment.
source_allowclickintegerNumeric platform flag for whether the source label is clickable.
source_typeintegerType code reported for the comment source label.
disable_replyintegerNumeric platform flag indicating whether replies are disabled.
like_countsintegerLike count reported in the like_counts field.
isLikedByMblogAuthorbooleanWhether the Weibo post author liked the comment, when provided.
Top-level comment author45 fields

data.data[]

FieldTypeDescription
userobjectPublic profile information for the comment author.
user.idintegerNumeric ID of the Weibo user.
user.idstrstringExact Weibo user ID as a string.
user.screen_namestringDisplay name of the Weibo user.
user.profile_image_urlstringLink to the user’s profile image.
user.avatar_largestringLink to the large profile image.
user.avatar_hdstringLink to the high-resolution profile image.
user.cover_image_phonestringLink to the profile cover image for mobile.
user.profile_urlstringPath or link to the public Weibo profile.
user.domainstringCustom profile address segment, when available.
user.weihaostringWeibo profile short number. The string can be empty.
user.urlstringWebsite link published on the user’s profile. The string can be empty.
user.descriptionstringBiography displayed on the user’s profile.
user.locationstringLocation shown in the public profile.
user.genderstringGender code reported in the public profile.
user.verifiedbooleanWhether the profile is marked as verified.
user.verified_typeintegerVerification type code reported for the profile.
user.verified_type_extintegerAdditional verification type code, when available.
user.verified_reasonstringVerification description shown on the profile, when available.
user.followers_countintegerFollower count reported for the profile.
user.followers_count_strstringFollower count display text.
user.friends_countintegerNumber of accounts followed by the user.
user.statuses_countintegerPost count reported for the profile.
user.status_total_counterobjectStatus interaction counters reported for the profile.
user.status_total_counter.total_cnt_formatstring | integerFormatted interaction total, returned as text or an integer.
user.status_total_counter.comment_cntstringComment count in the profile counters, returned as text.
user.status_total_counter.repost_cntstringRepost count in the profile counters, returned as text.
user.status_total_counter.like_cntstringLike count in the profile counters, returned as text.
user.status_total_counter.total_cntstringTotal count reported in the profile counters, returned as text.
user.mbrankintegerWeibo membership rank reported for the profile.
user.mbtypeintegerPlatform membership type code for the profile.
user.svipintegerNumeric SVIP flag reported for the profile.
user.vvipintegerNumeric VVIP flag reported for the profile.
user.icon_listarrayIcons or badges shown for the profile.
user.icon_list[]objectOne profile badge or icon.
user.icon_list[].typestringType label reported for the profile icon.
user.icon_list[].dataobjectDisplay and membership details for the profile icon.
user.icon_list[].data.mbrankintegerMembership rank reported for the icon.
user.icon_list[].data.mbtypeintegerPlatform membership type code reported for the icon.
user.icon_list[].data.svipintegerNumeric SVIP flag in the icon metadata.
user.icon_list[].data.vvipintegerNumeric VVIP flag in the icon metadata.
user.icon_list[].data.valuestringText value reported for this profile icon.
user.icon_list[].data.icon_imgstringImage link for the profile icon.
user.icon_list[].data.titlestringDisplay title of the profile icon.
user.icon_list[].data.urlstringLink associated with the profile icon.
Topics, links and display33 fields

data.data[]

FieldTypeDescription
url_objectsarrayAdditional URL entries attached to the comment. This array can be empty.
pic_numintegerNumber of pictures reported for the comment.
topic_structarrayTopic labels and links attached to the comment.
topic_struct[]objectOne topic entry in the comment.
topic_struct[].titlestringDisplay title of the topic entry.
topic_struct[].topic_titlestringTitle text reported for the topic.
topic_struct[].topic_urlstringLink associated with the topic.
url_structarrayStructured links attached to the comment.
url_struct[]objectOne link entry in the comment.
url_struct[].url_titlestringDisplay title of the link.
url_struct[].url_type_picstringImage link for the icon associated with this link type.
url_struct[].ori_urlstringOriginal URL reported for the entry.
url_struct[].short_urlstringShort URL reported for the entry.
url_struct[].long_urlstringLong URL reported for the entry.
url_struct[].h5_target_urlstringLink to the web destination reported for the entry.
url_struct[].page_idstringPage identifier associated with the link.
url_struct[].url_typestringLink type code returned as a string.
url_struct[].object_typestringType label of the linked object.
comment_bubbleobjectDisplay information for the comment bubble decoration.
comment_bubble.idstringIdentifier of the comment bubble decoration.
comment_bubble.namestringDisplay name of the comment bubble decoration.
comment_bubble.start_colorstringStart color reported for the comment bubble.
comment_bubble.end_colorstringEnd color reported for the comment bubble.
comment_bubble.start_color_darkstringStart color for the comment bubble in dark mode.
comment_bubble.end_color_darkstringEnd color for the comment bubble in dark mode.
comment_bubble.icon_urlstringImage link for the bubble decoration icon.
comment_bubble.tag_textstringDisplay label associated with the bubble decoration.
hot_iconobjectDisplay information for the comment’s hot badge.
hot_icon.urlstringImage link for the hot badge.
hot_icon.wh_ratiostringWidth-to-height ratio of the hot badge image, returned as text.
more_infoobjectAdditional display text attached to the comment.
more_info.textstringDisplay text associated with the additional information.
more_info.highlight_textstringHighlighted portion of the additional display text.
Reply previews and counts4 fields

data.data[]

FieldTypeDescription
commentsarrayPreview replies attached to this comment. Additional replies may exist beyond the preview.
comments[]objectOne reply preview attached to a first-level comment.
total_numberintegerTotal reply count reported for this comment.
max_idintegerCursor reported with this comment’s reply preview. The post comment page cursor is the top-level max_id.
Preview reply24 fields

data.data[].comments[]

FieldTypeDescription
idintegerComment ID returned as an integer. Use idstr when preserving exact digits.
idstrstringExact comment ID as a string.
midstringComment’s own MID as a string. The request parameter mid identifies the post.
rootidintegerRoot comment ID reported for the thread, returned as an integer.
rootidstrstringExact root comment ID as a string.
floor_numberintegerComment position number reported within the thread.
created_atstringCreation time of the comment as platform-formatted text.
textstringRendered comment content. This text can contain HTML.
text_rawstringRaw comment text when supplied separately from the rendered content.
sourcestringSource label displayed with the comment.
source_allowclickintegerNumeric platform flag for whether the source label is clickable.
source_typeintegerType code reported for the comment source label.
disable_replyintegerNumeric platform flag indicating whether replies are disabled.
like_countsintegerLike count reported in the like_counts field.
url_objectsarrayAdditional URL entries attached to the comment. This array can be empty.
pic_numintegerNumber of pictures reported for the comment.
reply_commentobjectEmbedded comment that the preview reply responds to.
like_countintegerLike count reported in the like_count field of this reply.
is_mblog_authorbooleanWhether the reply author is the author of the Weibo post.
is_sub_cmtbooleanWhether the platform marks this entry as a subcomment.
blogger_iconsarrayBadges attached to the preview reply author.
blogger_icons[]objectOne displayed author badge.
blogger_icons[].namestringDisplay name of the author badge.
blogger_icons[].urlstringLink associated with the author badge.
Preview reply author41 fields

data.data[].comments[]

FieldTypeDescription
userobjectPublic profile information for the preview reply author.
user.idintegerNumeric ID of the Weibo user.
user.idstrstringExact Weibo user ID as a string.
user.screen_namestringDisplay name of the Weibo user.
user.profile_image_urlstringLink to the user’s profile image.
user.avatar_largestringLink to the large profile image.
user.avatar_hdstringLink to the high-resolution profile image.
user.cover_image_phonestringLink to the profile cover image for mobile.
user.profile_urlstringPath or link to the public Weibo profile.
user.domainstringCustom profile address segment, when available.
user.weihaostringWeibo profile short number. The string can be empty.
user.urlstringWebsite link published on the user’s profile. The string can be empty.
user.descriptionstringBiography displayed on the user’s profile.
user.locationstringLocation shown in the public profile.
user.genderstringGender code reported in the public profile.
user.verifiedbooleanWhether the profile is marked as verified.
user.verified_typeintegerVerification type code reported for the profile.
user.verified_type_extintegerAdditional verification type code, when available.
user.verified_reasonstringVerification description shown on the profile, when available.
user.followers_countintegerFollower count reported for the profile.
user.followers_count_strstringFollower count display text.
user.friends_countintegerNumber of accounts followed by the user.
user.statuses_countintegerPost count reported for the profile.
user.status_total_counterobjectStatus interaction counters reported for the profile.
user.status_total_counter.total_cnt_formatstring | integerFormatted interaction total, returned as text or an integer.
user.status_total_counter.comment_cntstringComment count in the profile counters, returned as text.
user.status_total_counter.repost_cntstringRepost count in the profile counters, returned as text.
user.status_total_counter.like_cntstringLike count in the profile counters, returned as text.
user.status_total_counter.total_cntstringTotal count reported in the profile counters, returned as text.
user.mbrankintegerWeibo membership rank reported for the profile.
user.mbtypeintegerPlatform membership type code for the profile.
user.svipintegerNumeric SVIP flag reported for the profile.
user.vvipintegerNumeric VVIP flag reported for the profile.
user.icon_listarrayIcons or badges shown for the profile.
user.icon_list[]objectOne profile badge or icon.
user.icon_list[].typestringType label reported for the profile icon.
user.icon_list[].dataobjectDisplay and membership details for the profile icon.
user.icon_list[].data.mbrankintegerMembership rank reported for the icon.
user.icon_list[].data.mbtypeintegerPlatform membership type code reported for the icon.
user.icon_list[].data.svipintegerNumeric SVIP flag in the icon metadata.
user.icon_list[].data.vvipintegerNumeric VVIP flag in the icon metadata.
Replied-to comment11 fields

data.data[].comments[].reply_comment

FieldTypeDescription
idintegerComment ID returned as an integer. Use idstr when preserving exact digits.
idstrstringExact comment ID as a string.
midstringComment’s own MID as a string. The request parameter mid identifies the post.
rootidintegerRoot comment ID reported for the thread, returned as an integer.
rootidstrstringExact root comment ID as a string.
floor_numberintegerComment position number reported within the thread.
created_atstringCreation time of the comment as platform-formatted text.
textstringRendered comment content. This text can contain HTML.
disable_replyintegerNumeric platform flag indicating whether replies are disabled.
url_objectsarrayAdditional URL entries attached to the comment. This array can be empty.
pic_numintegerNumber of pictures reported for the comment.
Replied-to comment author45 fields

data.data[].comments[].reply_comment

FieldTypeDescription
userobjectPublic profile information for the author of the replied-to comment.
user.idintegerNumeric ID of the Weibo user.
user.idstrstringExact Weibo user ID as a string.
user.screen_namestringDisplay name of the Weibo user.
user.profile_image_urlstringLink to the user’s profile image.
user.avatar_largestringLink to the large profile image.
user.avatar_hdstringLink to the high-resolution profile image.
user.cover_image_phonestringLink to the profile cover image for mobile.
user.profile_urlstringPath or link to the public Weibo profile.
user.domainstringCustom profile address segment, when available.
user.weihaostringWeibo profile short number. The string can be empty.
user.urlstringWebsite link published on the user’s profile. The string can be empty.
user.descriptionstringBiography displayed on the user’s profile.
user.locationstringLocation shown in the public profile.
user.genderstringGender code reported in the public profile.
user.verifiedbooleanWhether the profile is marked as verified.
user.verified_typeintegerVerification type code reported for the profile.
user.verified_type_extintegerAdditional verification type code, when available.
user.verified_reasonstringVerification description shown on the profile, when available.
user.followers_countintegerFollower count reported for the profile.
user.followers_count_strstringFollower count display text.
user.friends_countintegerNumber of accounts followed by the user.
user.statuses_countintegerPost count reported for the profile.
user.status_total_counterobjectStatus interaction counters reported for the profile.
user.status_total_counter.total_cnt_formatstring | integerFormatted interaction total, returned as text or an integer.
user.status_total_counter.comment_cntstringComment count in the profile counters, returned as text.
user.status_total_counter.repost_cntstringRepost count in the profile counters, returned as text.
user.status_total_counter.like_cntstringLike count in the profile counters, returned as text.
user.status_total_counter.total_cntstringTotal count reported in the profile counters, returned as text.
user.mbrankintegerWeibo membership rank reported for the profile.
user.mbtypeintegerPlatform membership type code for the profile.
user.svipintegerNumeric SVIP flag reported for the profile.
user.vvipintegerNumeric VVIP flag reported for the profile.
user.icon_listarrayIcons or badges shown for the profile.
user.icon_list[]objectOne profile badge or icon.
user.icon_list[].typestringType label reported for the profile icon.
user.icon_list[].dataobjectDisplay and membership details for the profile icon.
user.icon_list[].data.mbrankintegerMembership rank reported for the icon.
user.icon_list[].data.mbtypeintegerPlatform membership type code reported for the icon.
user.icon_list[].data.svipintegerNumeric SVIP flag in the icon metadata.
user.icon_list[].data.vvipintegerNumeric VVIP flag in the icon metadata.
user.icon_list[].data.valuestringText value reported for this profile icon.
user.icon_list[].data.icon_imgstringImage link for the profile icon.
user.icon_list[].data.titlestringDisplay title of the profile icon.
user.icon_list[].data.urlstringLink associated with the profile icon.

Response Example ​

Loading the response example...