# Weibo Scraper: Posts, Comments, Hot Search & Profiles (微博) (`dheerajitbhu/weibo-scraper`) Actor

Scrape Sina Weibo (新浪微博) without login: keyword search, hot search board (热搜), post details with full long text, paginated comments, user profiles and latest posts. $3 per 1,000 rows.

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

## Pricing

from $3.00 / 1,000 row scrapeds

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: Posts, Comments, Hot Search & Profiles (微博)

Scrape public data from **Sina Weibo (新浪微博)**, China's biggest microblog, with **no login and no cookie from you**. Search posts by keyword, pull the live **hot search board (热搜榜)**, get **post details with the full long text**, export **comments** with pagination, and read **user profiles** and their latest posts.

**$3 per 1,000 rows.** That's a fraction of the $35–75 per 1,000 that other Weibo actors charge. It runs on Apify's datacenter proxy by default and switches to residential automatically only if Weibo blocks the run.

> 中文简介：微博数据采集，无需登录、无需 Cookie。支持关键词搜索微博（综合/实时/热门）、微博热搜榜、微博详情（自动展开长文）、评论（分页）、用户资料（粉丝数、关注数、微博数、认证信息）和用户最新微博。每 1000 条 3 美元。

### What you can scrape

| Mode | What you get | Input |
|---|---|---|
| `search` | Posts for each keyword from Weibo's 综合, 实时 and 热门 tabs, merged and deduplicated | `searchQueries` |
| `hot_search` | The live hot search board: rank, keyword, heat, label (热/新/沸) | (none) |
| `post_detail` | One post with full text, counts, images, hashtags and author | `postUrls` |
| `post_comments` | Comments of posts, paged with Weibo's own cursor | `postUrls` |
| `user_profile` | Followers, following, post count, verification, bio | `userIds` |
| `user_posts` | A user's latest posts | `userIds` |

### Honest limits (no login)

Without a logged-in account Weibo serves **only the first result page**:

- about 10 posts per search tab, so up to about 30 unique posts per keyword per run;
- about 10 latest posts per user.

Schedule the actor (for example every hour) to build a continuous feed of new posts for a keyword. Comments, post details, profiles and the hot search board are not limited this way. This actor never logs in and never asks for your cookies.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Run start | $0.001 |
| Row (post, comment, user or hot-search entry) | **$0.003** ($3 per 1,000) |

Error rows are free. `maxChargeUsd` (default $5) stops the run cleanly before it goes over.

### Input examples

```json
{ "mode": "search", "searchQueries": ["小米", "比亚迪"], "includeComments": true, "maxComments": 20 }
```

```json
{ "mode": "hot_search", "maxResults": 50 }
```

```json
{ "mode": "post_comments", "postUrls": ["https://weibo.com/5673255066/RnhdwmDmz"], "maxComments": 200 }
```

```json
{ "mode": "user_profile", "userIds": ["1749127163", "https://weibo.com/u/1642909335"] }
```

### Output examples (real rows, 2026-10-18)

Post:

```json
{
  "type": "post", "source": "search", "id": "5355477305394531", "bid": "RnhdwmDmz",
  "url": "https://weibo.com/5673255066/RnhdwmDmz",
  "text": "你还别说，小米18Pro这个传奇一瞬，拍出来的效果真有那个味道。", "isLongText": false,
  "createdAt": "2026-10-18T13:05:52+00:00", "repostsCount": 2, "commentsCount": 16, "likesCount": 50,
  "hashtags": [], "imageUrls": ["https://wx2.sinaimg.cn/mw2000/006bWoNYly1ii6t6i20toj32dc3ieqv7.jpg"],
  "videoTitle": null, "retweetedPostId": null, "authorName": "i冰宇宙", "authorId": 5673255066,
  "authorVerified": true, "authorFollowers": 1724000, "searchQuery": "小米", "searchType": "top"
}
```

Comment:

```json
{ "type": "comment", "postId": "5355477305394531", "commentId": "5355484431519240", "text": "徕卡一瞬 http://t.cn/AXl1E3TO",
  "likesCount": 0, "replyCount": 1, "createdAt": "2026-10-18T13:34:11+00:00", "authorName": "HAOTIAN唐三", "authorId": 2902887573 }
```

Hot search:

```json
{ "type": "hot", "rank": 1, "keyword": "日本出现取消吃饭现象", "heat": 1306764, "label": "热", "isTopic": true,
  "url": "https://s.weibo.com/weibo?q=%23%E6%97%A5%E6%9C%AC%E5%87%BA%E7%8E%B0%E5%8F%96%E6%B6%88%E5%90%83%E9%A5%AD%E7%8E%B0%E8%B1%A1%23" }
```

User:

```json
{ "type": "user", "id": 1749127163, "name": "雷军", "profileUrl": "https://weibo.com/u/1749127163",
  "description": "小米董事长，金山软件董事长。业余爱好是天使投资。", "followers": 27337388, "following": 1647,
  "postsCount": 22162, "verified": true, "verifiedReason": "小米创办人，董事长兼CEO；金山软件董事长；天使投资人。" }
```

### Compact output for AI agents

Set **Output format** to `compact` and the run still pushes the same rows to the dataset
at the same price — nothing about billing changes. It additionally writes `OUTPUT_COMPACT`
to the run's key-value store: a lossless columnar JSON encoding of the same rows (one
column-name header plus one array per row, instead of repeating every key name on every
row), which is cheaper to hand to an LLM than the plain dataset JSON.

Measured on a real 119-row export of this actor's output (a mix of 22-key post rows and
10-key comment rows — see `benchmarks/compact-output/` in this repo for methodology and
all 5 actors' numbers; mixed-shape rows like this one are the least favorable case for a
columnar format, since the union header forces a "missing" marker into the shorter rows):

| Tokenizer | Pretty JSON | Minified JSON | Compact | vs Pretty | vs Minified |
|---|---:|---:|---:|---:|---:|
| cl100k_base (GPT-4/3.5) | 24,878 | 20,124 | 19,321 | 22.3% smaller | 4.0% smaller |
| o200k_base (GPT-4o) | 22,611 | 17,879 | 17,010 | 24.8% smaller | 4.9% smaller |

Decoding it back to the normal row objects is five lines of Python:

```python
def decode_columnar(payload):
    cols, marker = payload["columns"], payload["missing"]
    return [{c: v for c, v in zip(cols, row) if v != marker}
            for row in payload["rows"]]
```

### Privacy

Rows contain public content plus the author's public nickname and id only. This actor does not collect gender, location, IP region (发布于…) or avatars.

### Reliability

A self-test runs every day against the live Weibo endpoints. If Weibo blocks every request in a run, the run is marked **failed** instead of ending green with 0 rows, so your schedule alerts fire.

**关键词：** 微博爬虫, 微博采集, 微博热搜, 微博评论采集, 微博用户数据, Weibo API, Weibo scraper, Weibo hot search, Weibo comments.

# Actor input Schema

## `mode` (type: `string`):

What to scrape. No login or cookie is needed in any mode.

## `searchQueries` (type: `array`):

Used in 'search' mode. If left empty, the run uses 小米 as a sample keyword.

## `searchTypes` (type: `array`):

Any of: top (综合), realtime (实时), hot (热门). Without login Weibo returns the first page (about 10 posts) of each type; results are merged and deduplicated.

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

Used in 'post_detail' and 'post_comments'. Example: https://weibo.com/1749127163/RnhdwmDmz, a numeric mid, or the short id.

## `userIds` (type: `array`):

Used in 'user_profile' and 'user_posts'. Numeric uid or a weibo.com/u/<uid> link.

## `maxResults` (type: `integer`):

Upper bound. Without login Weibo returns about 10 posts per search type and about 10 latest posts per user.

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

In 'search' and 'post_detail': also return each post's comments as rows (type 'comment'). Each comment is a billed row.

## `maxComments` (type: `integer`):

Used in 'post_comments' and when 'Also scrape comments' is on. Comments are paged with Weibo's own cursor.

## `expandLongText` (type: `boolean`):

Fetch the full text of posts Weibo truncates (one extra request per long post, no extra charge).

## `outputFormat` (type: `string`):

Dataset rows are always pushed and charged the same either way. 'compact' additionally writes OUTPUT_COMPACT to the run's key-value store: a lossless columnar JSON encoding of the same rows that is far cheaper to feed to an LLM and decodes back to the exact same rows.

## `maxChargeUsd` (type: `number`):

Hard spending cap. The run stops cleanly before going over it; rows already delivered are kept.

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

Default: Apify datacenter proxy. If Weibo blocks it (HTTP 403/418/429), the run switches once to the RESIDENTIAL group automatically. Pick RESIDENTIAL to use it from the start.

## `requestIntervalSecs` (type: `number`):

Polite pacing. Faster pacing triggers Weibo's rate limits.

## Actor input object example

```json
{
  "mode": "search",
  "searchQueries": [
    "小米"
  ],
  "searchTypes": [
    "top",
    "realtime",
    "hot"
  ],
  "maxResults": 50,
  "includeComments": false,
  "maxComments": 20,
  "expandLongText": true,
  "outputFormat": "standard",
  "maxChargeUsd": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "requestIntervalSecs": 1
}
```

# Actor output Schema

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

Posts, comments, users and hot-search rows (field 'type').

# 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 = {
    "searchQueries": [
        "小米"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dheerajitbhu/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 = {
    "searchQueries": ["小米"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dheerajitbhu/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 '{
  "searchQueries": [
    "小米"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call dheerajitbhu/weibo-scraper --silent --output-dataset

```

## MCP server setup

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