# 🧪 All-in-One Weibo Scraper (`thenetaji/weibo-all-in-one-scraper`) Actor

Retrieve Weibo posts, comments, likers, profiles, account videos, searches, or hot-search entries from one Actor. Select a mode for the corresponding dataset.

- **URL**: https://apify.com/thenetaji/weibo-all-in-one-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.55 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## All-in-One Weibo Scraper

The Actor covers eight Weibo surfaces behind one mode selector: posts, their comments, their likers, profiles, an account's videos, account search, topic search, and the hot-search board. Pick the mode for the run and fill in the section belonging to it.

```json
{
  "scraperType": "postDetail",
  "mid": "https://m.weibo.cn/detail/5145994595795680",
  "maxItems": 100
}
```

### Modes and what each one needs

`scraperType` chooses the dataset and decides which of the fields below matters.

- **Post** — needs `mid`, a post ID or a link to the post. Returns one row: the text, publish time, client, images and the repost, comment and like counts. A video post also carries its stream URLs and duration.
- **Comments** — needs `mid`. Returns the comments on that post, one row each, with Weibo's own total for the thread.
- **Likers** — needs `mid`. Returns the accounts that liked the post, walking the liker list page by page. `page` sets which page it starts from.
- **Profile** — needs `uid`, a numeric user ID or a profile link. Returns one row: screen name, bio, location, gender, avatars, verification and its stated reason, and the follower, following and post counts.
- **Account videos** — needs `uid`. Returns the videos that account posted, walking the feed on its own cursor until it runs out.
- **Account search** — needs `query`. Returns matching accounts, one row each, in a single request.
- **Topic search** — needs `query`. Returns matching topics, walking the result pages. `page` sets which page it starts from.
- **Hot search board** — needs nothing at all. Returns the board as it stands right now, one row per entry.

`maxItems` applies to every mode and defaults to `100`; `0` disables the bound.

### Result fields

Rows differ by mode, and each mode fills only its own columns.

A post row carries `mid`, `text`, `text_length`, `created_at`, `source`, `pic_ids`, `reposts_count`, `comments_count`, `attitudes_count` and `user`, plus `is_video`, `video_stream_url`, `video_stream_url_hd` and `video_duration_seconds`. A profile row carries `uid`, `screen_name`, `description`, `location`, `gender`, `verified`, `verified_type`, `verified_reason`, `followers_count`, `friends_count`, `statuses_count`, `profile_image_url`, `avatar_hd` and `status_total_counter`.

The list modes — comments, likers, account videos, both searches, the board — pass each entry through exactly as the platform returns it, and add what the row was collected under: `mid`, `uid` or `query`, plus `page` where the mode pages by one.

`count` and `total_number` are not the same thing. `count` is how many rows came back on that page — a page size. `total_number` is Weibo's own catalogue total, and only the comment and liker lists carry one. If you want to know whether you have a whole thread, compare against `total_number`; `count` will always tell you that you do.

### A Weibo video is a post

There is no separate video record on Weibo, and no mode here pretends there is. A video is a post that happens to have a video on it, so the **Post** mode is how you fetch one, and it returns `is_video`, the stream URLs and the duration on the post itself. **Account videos** is the bulk form of the same thing: one account's video feed rather than one video.

### Where the paged modes stop

Only **account videos** paginates by cursor, and it is walked until a page comes back empty, with a cursor that stops moving as the backstop. **Likers** and **topic search** page by an ordinal page number and stop the same way, or when Weibo's own `total_number` has been reached.

**Comments**, **account search** and the **board** are one request each. Comments does return a field called `next_cursor_hint`, and a hint is precisely what it is: nothing says what to pass it back as and no second page has been seen returned from one, so this Actor does not spend your money guessing.

No mode stops on a `has_more` flag. On the sibling TikTok feed that flag stayed `true` through three consecutive empty pages with the cursor climbing 30, 60, 90, 120 — a run that trusted it would never stop, and would pay for the compute until the platform timed it out.

### Empty is an answer, and a failure is a failure

A deleted post, an account that has been closed, a post nobody has liked, a search that matches nothing: all of these come back empty rather than as errors. The run succeeds, those rows are not saved, and nothing is charged for them.

A run that genuinely could not reach the backend fails loudly instead, and so does a response in a shape this Actor does not recognise. An empty dataset from this Actor always means "there was nothing there" — it never quietly stands in for a request that went wrong.

### Related Actors

Six of the modes also ship on their own, for when a run only ever does one of them: the [Weibo Post Scraper](https://apify.com/thenetaji/weibo-post-scraper), the [Weibo Comments Scraper](https://apify.com/thenetaji/weibo-comments-scraper), the [Weibo Profile Scraper](https://apify.com/thenetaji/weibo-profile-scraper), the [Weibo User Videos Scraper](https://apify.com/thenetaji/weibo-user-videos-scraper), the [Weibo User Search Scraper](https://apify.com/thenetaji/weibo-user-search-scraper) and the [Weibo Hot Search Scraper](https://apify.com/thenetaji/weibo-hot-search-scraper). Likers and topic search live only here.

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

## `mid` (type: `string`):

A Weibo post ID (its mid), or a link to the post — m.weibo.cn/detail/<id>, m.weibo.cn/status/<id> or weibo.com/<uid>/<id>. The ID is pulled out of a link for you.

## `uid` (type: `string`):

A Weibo numeric user ID, or a link to the profile — weibo.com/u/<uid> or m.weibo.cn/u/<uid>. Weibo addresses accounts by this number, not by the screen name.

## `query` (type: `string`):

What to search for. Used by the user search and the topic search — one field, because a search term is one thing whichever board it is run against.

## `page` (type: `integer`):

Which page the paged modes start from. Leave at 1 unless you are picking a run back up part-way through a liker or topic list.

## `maxItems` (type: `integer`):

Maximum number of rows to save. Set 0 for no limit.

## Actor input object example

```json
{
  "scraperType": "postDetail",
  "mid": "5145994595795680",
  "uid": "1749127163",
  "query": "上海",
  "page": 1,
  "maxItems": 20
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "scraperType": "postDetail",
    "mid": "5145994595795680",
    "uid": "1749127163",
    "query": "上海",
    "page": 1,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/weibo-all-in-one-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 = {
    "scraperType": "postDetail",
    "mid": "5145994595795680",
    "uid": "1749127163",
    "query": "上海",
    "page": 1,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/weibo-all-in-one-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 '{
  "scraperType": "postDetail",
  "mid": "5145994595795680",
  "uid": "1749127163",
  "query": "上海",
  "page": 1,
  "maxItems": 20
}' |
apify call thenetaji/weibo-all-in-one-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/weibo-all-in-one-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/dzmbzEDn3A78F68dA/builds/YnGUxhN1dG3W5uink/openapi.json
