# Weibo Scraper - Hot Search, Trending Posts & Comments (`kmscrape/weibo-scraper`) Actor

Scrape Sina Weibo without login: hot search board (微博热搜) with categories, trending posts by category, post details with images/video, comments with likes, keyword suggestions with search counts, and public profiles. 新浪微博 热搜、热门微博、评论数据采集。

- **URL**: https://apify.com/kmscrape/weibo-scraper.md
- **Developed by:** [kfir messika](https://apify.com/kmscrape) (community)
- **Categories:** Social media, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 result items

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Weibo Scraper - Hot Search, Trending Posts & Comments

新浪微博 热搜榜、热门微博、微博评论与用户资料公开数据采集 — 无需登录。

Collect Weibo's public hot search board, trending posts, post details, comments, keyword suggestions, and public profile statistics. The actor obtains anonymous visitor cookies from Weibo and uses them for desktop web AJAX requests. It does not ask for account credentials or user cookies.

### Use cases

- Track current topics and categorized hot searches for China market research.
- Collect trending posts, text, engagement counts, images, video URLs, and comments.
- Discover public conversations through keyword suggestions and their search counts.
- Pick trending categories by name (科技 / Technology, 财经 / Finance, 社会 / Society, 体育 / Sports, ...) or numeric ID.
- Build feeds for AI agents / MCP workflows from structured public Weibo data.
- Look up public profile statistics from profile URLs or numeric UIDs.

### Input

| Field | Description |
|---|---|
| `hotSearch` | Fetch categorized Weibo hot search rows. Prefilled as `true`; schema default is `false`. |
| `trendingPosts` | Fetch trending posts. Defaults to `false`. |
| `trendingCategoryIds` | Optional trending category IDs. `4188` is Social and `2088` is Technology; leave empty for the main feed. |
| `postUrls` | Post URLs or IDs to fetch in detail. Supports `weibo.com/<uid>/<mblogid>`, `weibo.com/detail/<id>`, mobile detail/status URLs, and bare IDs. |
| `includeComments` | Fetch comments for supplied posts and trending posts. Defaults to `false`. |
| `maxCommentsPerPost` | Maximum comments per post; defaults to `20`. |
| `userUrls` | Public profile URLs or numeric user IDs. |
| `keywordSuggestions` | Keywords for Weibo's public search suggestion endpoint. |
| `maxItemsPerSource` | Maximum results for each source; defaults to `20`, prefilled to `10`. |
| `proxyConfiguration` | Optional Apify proxy configuration. |

Prefilled runs fetch 10 hot rows and should complete in under 60 seconds. Each hot, post, comment, user, or suggestion row is one `item-result` event. Summary and error rows are free. The actor stops producing charged rows after the PPE event charge limit is reached.

### Output examples

Examples are trimmed from live anonymous Weibo API responses captured on 2026-10-08. Counts, text, and media URLs change over time.

```json
{
  "type": "hot",
  "rank": 1,
  "word": "尊界通报刹车踏板断裂",
  "heat": 10090752,
  "label": "爆",
  "category": "民生新闻,汽车",
  "url": "https://s.weibo.com/weibo?q=%23%E5%B0%8A%E7%95%8C%E9%80%9A%E6%8A%A5%E5%88%B9%E8%BD%A6%E8%B8%8F%E6%9D%BF%E6%96%AD%E8%A3%82%23",
  "scrapedAt": "2026-10-08T13:50:00.000Z"
}
```

```json
{
  "type": "post",
  "id": "5351740955167466",
  "mblogid": "RlI19lGie",
  "url": "https://weibo.com/9054522804/RlI19lGie",
  "text": "门哥羡慕懂车帝能在十一期间买到三台新车[作揖][作揖] ​​​",
  "createdAt": "2026-10-08T05:38:57.000Z",
  "reposts": 4,
  "comments": 174,
  "likes": 1415,
  "pics": ["https://wx4.sinaimg.cn/large/009SLR0ogy1ihuw1ckp8dj30xk1cf4eo.jpg"],
  "videoUrl": null,
  "user": { "uid": "9054522804", "name": "尊川川", "verified": true, "followers": null },
  "source": "post"
}
```

```json
{
  "type": "comment",
  "id": "5351742742464342",
  "postId": "5351740955167466",
  "text": "这种人把小人的那种小聪明体现得淋漓尽致。",
  "likes": 126,
  "createdAt": "2026-10-08T05:46:03.000Z",
  "replyCount": 1,
  "user": { "uid": "5706227508", "name": "SomePeopleLikeMe" }
}
```

```json
{ "type": "suggestion", "keyword": "\u539f\u795e", "suggestion": "原神超话", "count": 500018873, "rank": 1 }
```

### Pricing

**$2.00 per 1,000 result rows** (`item-result` pay-per-event): hot topics, posts, comments, suggestions and profiles all count as one row each. Summary and error rows are free. A run with comments enabled produces many comment rows per post; use `maxCommentsPerPost` to control cost.

### FAQ

#### Do I need a Weibo login?

No. The actor requests Weibo-issued anonymous visitor cookies (`SUB` and `SUBP`) and uses a desktop browser user agent with `Referer: https://weibo.com/`.

#### What is not supported anonymously?

Keyword post search is login-gated. User timelines and fans/followers lists do not return usable anonymous data. The `keywordSuggestions` input returns public suggestions only; it does not search posts. Public profile details are available through `userUrls`.

#### Can comments be returned for every post?

The actor requests comments from Weibo's public comments endpoint and returns up to `maxCommentsPerPost`. Some posts may expose no comments or may be unavailable, and response availability can vary.

#### Why might a request fail?

Weibo can deny anonymous traffic or rate-limit a network. The actor preserves its paced requests, retries transient failures, and refreshes the visitor pair after risk responses. Error rows are free and include a short explanation.

#### Are results historical?

No. The actor returns data as Weibo serves it at run time; it does not provide historical snapshots.

# Actor input Schema

## `hotSearch` (type: `boolean`):

Fetch Weibo's categorized hot search ranking.

## `trendingPosts` (type: `boolean`):

Fetch public posts from Weibo's trending feed.

## `trendingCategoryIds` (type: `array`):

Optional trending feed categories: names like 科技, 财经, 社会, 娱乐 or Technology, Finance, Society, Sports, Gaming, or numeric IDs such as 2088. Leave empty for the main trending feed.

## `postUrls` (type: `array`):

Weibo post URLs or numeric IDs to fetch with comments and media details.

## `includeComments` (type: `boolean`):

Fetch public comments for supplied post URLs and trending posts.

## `maxCommentsPerPost` (type: `integer`):

Maximum comments returned for each post.

## `userUrls` (type: `array`):

Weibo public profile URLs or numeric user IDs to look up.

## `keywordSuggestions` (type: `array`):

Keywords to look up in Weibo's public search suggestions.

## `maxItemsPerSource` (type: `integer`):

Maximum hot, post, suggestion, or user rows returned per selected source.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy configuration for outbound requests.

## Actor input object example

```json
{
  "hotSearch": true,
  "trendingPosts": false,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "maxItemsPerSource": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "hotSearch": true,
    "includeComments": false,
    "maxCommentsPerPost": 20,
    "maxItemsPerSource": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("kmscrape/weibo-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 = {
    "hotSearch": True,
    "includeComments": False,
    "maxCommentsPerPost": 20,
    "maxItemsPerSource": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("kmscrape/weibo-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 '{
  "hotSearch": true,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "maxItemsPerSource": 10
}' |
apify call kmscrape/weibo-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kmscrape/weibo-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/NtwYi0Duhk7tfPC11/builds/6V4Y0ePcdGLqcOHRI/openapi.json
