# Weibo Post Detail Scraper (`opspilot.cc/weibo-post-detail-scraper`) Actor

Fetch one Weibo post's full detail plus up to 10 pages of comments (~150 total) with cursor-based pagination. Pass numeric postId (+ optional mid) from upstream feeds.

- **URL**: https://apify.com/opspilot.cc/weibo-post-detail-scraper.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Weibo Post Detail Scraper

Pull a single Weibo post + its first ~150 comments by `postId`. Built for marketing monitoring, brand mention triage, and dataset enrichment.

**One run = 1 detail request + N comments page requests.** Pass a `postId` (and optionally `mid`, `maxPages`). Pagination follows the upstream's `max_id` + `max_id_type` dual-field protocol (verified 2026-08-20) — no cookies, no auth tokens.

- **Actor ID:** `vgIzEKOSpFKlEDVo5`
- **Build:** `0.1.3`
- **Source:** A hosted Chinese social data API provider (Weibo endpoints)

### What it does

| Input | Output |
|---|---|
| `postId="5328347665010605"` + `mid="5328347665010605"` + `maxPages=1` (defaults) | 1 post-detail record (`kind: 'post_detail'`) + ~15 first-page comment records (`kind: 'comment'`). Pass `maxPages=10` to walk the full upstream thread (~150 comments). |

### Quick start

```json
{
  "postId": "5328347665010605",
  "mid": "5328347665010605",
  "maxPages": 1
}
```

Output dataset mixes post detail and comments, each tagged with `kind`:

```json
[
  {
    "kind": "post_detail",
    "post_id": "5328347665010605",
    "mid": "5328347665010605",
    "created_at": "Wed Aug 05 00:22:22 +0800 2026",
    "text": "现在拍戏都这么拼吗 [允悲] 女演员工伤 偷胯婆的微博视频",
    "text_length": 57,
    "source": "iPhone 17 Pro Max",
    "reposts_count": 142,
    "comments_count": 523,
    "attitudes_count": 1820,
    "user": { "user_id": 7491687377, "screen_name": "偷胯婆", "verified": true, "followers_count": "2.3万" },
    "rawData": { /* full upstream post object */ }
  },
  {
    "kind": "comment",
    "post_id": "5328347665010605",
    "comment_id": "5010203873098001",
    "floor_number": 1,
    "created_at": "Wed Aug 05 00:30:11 +0800 2026",
    "text": "心疼姐姐 [泪]",
    "user": { "user_id": 1234567890, "screen_name": "路人甲" },
    "rawData": { /* full upstream comment object */ }
  }
]
```

### Input fields

| Field | Required | Default | Notes |
|---|---|---|---|
| `postId` | yes | — | Numeric Weibo post id (string of digits, ≥6 chars). |
| `mid` | no | falls back to `postId` | Numeric Weibo mid; required by upstream for `fetch_post_comments`. |
| `maxPages` | no | `1` | 1..10. Each page returns ~15 comments; maxPages=10 ≈ 150 comments total. Pagination stops early when upstream has no more data. |

### Pricing

Free users are limited to **5 runs per day**. Paid users (`APIFY_USER_IS_PAYING=1`) have unlimited runs. The Actor itself adds no markup — you pay the upstream provider per request plus the standard Apify compute unit cost.

### Output

The Actor pushes one `kind: 'post_detail'` item + N `kind: 'comment'` items to the default dataset and writes a `SUMMARY` record to the default key-value store with run details (postId, mid, pagesFetched, requests, uniqueComments, totalCommentsFromUpstream, nextMaxId, nextMaxIdType, free-run counter, etc.).

### Use it together with the other Weibo Actors

This Actor is the **step ③ leaf node** of the 3-Actor Weibo MVP-2 set. Use it together with:

| Where in the pipeline | Actor | Console | Use it to |
|---:|---|---|---|
| before / step ① | [Weibo Hot Search Scraper](https://console.apify.com/actors/TF51J1LwZ2AayIXzd) | [Console](https://console.apify.com/actors/TF51J1LwZ2AayIXzd) | step ① — fetch the realtime hot list, get `post_id` of each trend |
| before / step ② | [Weibo Keyword Search Scraper](https://console.apify.com/actors/rXAua7eiA6jxRogdF) | [Console](https://console.apify.com/actors/rXAua7eiA6jxRogdF) | step ② — search posts by keyword, get `post_id` of each result |
| **after / step ③** | **Weibo Post Detail Scraper** (you are here) | (step ③ — leaf node) | step ③ — pass in one `post_id` from above, pull full post text + up to ~150 comments |

**You are here:** **Weibo Post Detail Scraper** — run this on its own for the upstream use case described above.

### Why this Actor exists

Apify has ~50,000 Actors and almost zero Weibo scrapers. This Actor is part of a planned **Weibo MVP-2** set (5 Actors covering hot search, keyword search, user profile, post detail + comments, and channel feed) that targets the gap.

### Source & credits

Data source: a hosted Chinese social data API provider (Weibo endpoints). The provider charges per upstream request; this Actor adds no markup.

### License

MIT

# Actor input Schema

## `postId` (type: `string`):

Numeric Weibo post id. web\_v2 endpoint (?id=...) returns the full post object.

## `maxPages` (type: `integer`):

Comment pages to fetch (1..10). Each page ~15 comments. Stops early if upstream returns empty max\_id.

## Actor input object example

```json
{
  "maxPages": 1
}
```

# Actor output Schema

## `dataset` (type: `string`):

Two kinds of items: `kind: post_detail` (one item per run) and `kind: comment` (up to maxPages × ~15 items). Each row preserves the original upstream record in rawData.

## `summary` (type: `string`):

Post id, pages fetched, comment count, next pagination token, error details.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("opspilot.cc/weibo-post-detail-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("opspilot.cc/weibo-post-detail-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call opspilot.cc/weibo-post-detail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/weibo-post-detail-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vgIzEKOSpFKlEDVo5/builds/tbXWgKbdBJNQ5sXYD/openapi.json
