# How to get all comments on a Weibo post

Pass the post's numeric ID and page with `data.next`, about 20 comments a page. Ten pages are 10 calls and $0.02, without a Weibo login or handling error 432.

Updated 2026-11-22

## Page through the comments

`status_id` is the numeric mid. A weibo.com link usually shows the short base62 code instead (such as `Q9xyzAbcd`); see our answer on converting it. The next page is a 17-digit `max_id`: it is returned as a string so it is not rounded, and goes back unchanged.

[Weibo comments API](https://xtikapi.com/apis/weibo/comments/list): `GET /v1/weibo/comments/list`, $0.002 a call

```bash
curl "https://xtikapi.com/v1/weibo/comments/list?status_id=5366312755008200" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python
import requests

URL = "https://xtikapi.com/v1/weibo/comments/list"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

params = {"status_id": "5366312755008200"}
items = []
for _ in range(10):  # one call per page
    for attempt in range(3):  # 5xx errors are not charged: retry
        response = requests.get(URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code < 500:
            break
    response.raise_for_status()
    data = response.json()["data"]
    items += data["items"]
    if not data.get("next"):  # null on the last page
        break
    params.update(data["next"])

print(len(items), "items")
```

```javascript
const URL = "https://xtikapi.com/v1/weibo/comments/list";
const HEADERS = { Authorization: "Bearer YOUR_API_KEY" };

let params = {"status_id":"5366312755008200"};
const items = [];
for (let page = 0; page < 10; page++) {
  let response;
  for (let attempt = 0; attempt < 3; attempt++) {
    // 5xx errors are not charged: retry
    response = await fetch(`${URL}?${new URLSearchParams(params)}`, { headers: HEADERS });
    if (response.status < 500) break;
  }
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const { data } = await response.json();
  items.push(...data.items);
  if (!data.next) break; // null on the last page
  params = { ...params, ...data.next };
}
console.log(items.length, "items");
```

Recorded response (lists keep the first two items):

```json
{
  "data": {
    "items": [
      {
        "id": "8330913613217597",
        "text": "Example text",
        "author": {
          "id": "1284083871",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 61,
          "description": "Example text"
        },
        "createdAt": "2026-11-18T21:30:54.000Z",
        "replyCount": 3
      },
      {
        "id": "8330979591036408",
        "text": "Example text",
        "author": {
          "id": "0257671969",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 12063,
          "description": "Example text"
        },
        "createdAt": "2026-11-19T01:12:56.000Z",
        "replyCount": 1
      }
    ],
    "has_more": true,
    "next": {
      "max_id": "13897360026835247"
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "weibo.comments.list",
    "normalized": true,
    "unavailable": [
      "likeCount"
    ],
    "billing": {
      "charged": true,
      "amount": 0.002,
      "balance": 4.98
    }
  }
}
```

## What the example costs

| Step | Calls | Price | Subtotal |
| --- | --- | --- | --- |
| Comments, 10 pages of about 20 | 10 | $0.002 | $0.02 |
| Total | 10 | | $0.02 |

## Good to know

- In our test on 2026-11-22 the first page held 22 comments and the second 20.
- In our test one comment on page two had already appeared on page one; dedupe by `id`.
- Replies under a comment come from `weibo.comment_replies.list`.
- Keep `max_id` as a string in your code: as a JavaScript number it loses its last digit.

## Endpoints

- [Weibo comments API](https://xtikapi.com/apis/weibo/comments/list): $0.002 a call

## Questions

### How much does this cost with XTikAPI?

The example here is 10 calls, $0.02 in total. Failed calls and timeouts are free, and a new account with a verified email gets $0.50 of trial balance.

### Why is max_id a string?

It has 17 digits, beyond what a JavaScript or JSON number holds exactly. As a number its last digit changes and the next page is wrong, so it stays a string end to end.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/guides/weibo-post-comments) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
