# Weibo search, hot search & post scraper ( 微博 ) (`data_dino/weibo-search`) Actor

Collect Weibo (微博) posts, hot-search board entries, timelines, comments, and user profiles. No login required for search and hot-search modes. Each run produces one dataset item per post or profile row.

- **URL**: https://apify.com/data_dino/weibo-search.md
- **Developed by:** [Data Dino](https://apify.com/data_dino) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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.

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 search, hot-search & post scraper

Search Weibo (微博) for posts, read the real-time hot-search board, pull post detail and comment threads, and inspect user profiles — in one Apify run. No login is needed for most modes.

### Why use this actor?

- **Keyword search** — search any topic (Chinese or English) and get structured post rows with text, timestamps, author, and engagement counts. Latin brand names are auto-localized to their Chinese alias (e.g. Nike → 耐克).
- **Hot-search board** — grab the live real-time trending board, or a delta that only reports entries new since your last run.
- **Posts & comments** — expand a list of post IDs into full text, comments, and comment replies.
- **User profiles** — inspect a user's profile (bio, verification, followers/following, posts).
- **Structured rows** — every item follows the same flat, query-friendly shape with a `mode` field indicating the row type.

### Input

All fields are optional; defaults search for `人工智能` (artificial intelligence) and return up to 10 posts.

| Field | Type | Default | Description |
|---|---|---:|---|
| `mode` | select | `search` | `search`, `post_details`, `post_comments`, `user_profile`, `hot_search`, `hot_search_delta`, `hot_timeline`, or `user_posts`. |
| `searchQuery` | string | `人工智能` | Keyword to search (mode=search). |
| `searchAliases` | array | `[]` | Extra terms (each its own string) merged into the search. |
| `autoLocalize` | boolean | `true` | Auto-add a Chinese alias for Latin brand names. |
| `searchDateFrom` | string | *(empty)* | Earliest post date, Beijing time (YYYY-MM-DD). |
| `searchDateTo` | string | *(empty)* | Latest post date, Beijing time (YYYY-MM-DD). |
| `userIds` | array | `[]` | Weibo user IDs or profile URLs (mode=user_profile / user_posts). |
| `postIds` | array | `[]` | Weibo post IDs, short codes, or URLs. |
| `maxResults` | integer | `10` | Stop after this many rows. |
| `maxComments` | integer | `20` | Max comments per post when comments are enabled. |
| `includeComments` | boolean | `false` | Also fetch each post's comment thread. |
| `includeReplies` | boolean | `false` | With includeComments, also fetch replies to comments. |
| `fetchFullText` | boolean | `true` | Expand truncated long posts. |
| `adFilter` | select | `all` | `all`, `exclude`, or `promo_only` promoted posts. |
| `includeAuthorProfiles` | boolean | `false` | Also emit a profile row per post author. |
| `sentimentAnalysis` | boolean | `false` | Tag each post with a lightweight sentiment score/label. |
| `deltaMode` | boolean | `false` | Only rows no earlier run delivered. |
| `delay` | number | `0.5` | Seconds between requests. |
| `maxSearchPages` | integer | `40` | Max search pages to walk (mode=search). |

#### Example input

```json
{
  "mode": "search",
  "searchQuery": "特斯拉",
  "maxResults": 20,
  "includeComments": true,
  "maxComments": 10
}
```

### Output

One dataset item per row. Each row has a `mode` field naming its shape:

- **search / post rows** — `id`, `mid`, `text`, `created_at`, `url`, `user`, `reposts_count`, `comments_count`, `likes_count`, and source metadata.
- **comment rows** — comment text, author, timestamp, reply-to post, and parent comment id.
- **profile rows** — user id, screen name, avatar, biography, verification, follower/following counts.
- **hot-search / timeline rows** — rank, keyword, heat, and board name.

Missing source values are returned as `null`.

### Practical limitations

- Weibo caps each search query's result window at ~1000 posts; `maxResults` and `maxSearchPages` bound how far a run walks.
- `user_posts` mode requires a logged-in cookie; the other modes work anonymously.
- Results reflect the public Weibo page at run time and may change.
- Use collected information in accordance with Weibo's terms and applicable privacy and data-use requirements.

# Actor input Schema

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

What to scrape: keyword search (default), post details/ids, post comment threads, a user's profile, the real-time hot-search board, a hot-search delta (new entries since the last run), the hot timeline, or one user's posts (needs a logged-in cookie).

## `searchQuery` (type: `string`):

Keyword to search (mode=search). Latin brand names are automatically given a Chinese alias (e.g. Nike → 耐克).

## `searchAliases` (type: `array`):

Extra terms to merge into the search (when mode=search), each as its own string.

## `autoLocalize` (type: `boolean`):

Automatically add a Chinese alias for Latin brand names so search matches the local Weibo vocabulary.

## `searchDateFrom` (type: `string`):

Earliest post date to search, Beijing time (YYYY-MM-DD). Optional.

## `searchDateTo` (type: `string`):

Latest post date to search, Beijing time (YYYY-MM-DD). Pages are walked back from this date. Optional.

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

Weibo user IDs or profile URLs (mode=user_profile / user_posts).

## `postIds` (type: `array`):

Weibo post IDs, short codes, or URLs (mode=post_details / post_comments).

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

Stop after this many rows. The search window is capped by Weibo at ~1000 posts per query.

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

Maximum comments to fetch per post when comments are enabled.

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

Also fetch each post's comment thread and emit one row per comment.

## `includeReplies` (type: `boolean`):

With includeComments, also fetch replies to comments.

## `fetchFullText` (type: `boolean`):

Expand truncated long posts to their full text.

## `adFilter` (type: `string`):

Keep all posts, exclude promoted posts, or keep only promoted posts.

## `includeAuthorProfiles` (type: `boolean`):

Also emit a profile row for each post author.

## `sentimentAnalysis` (type: `boolean`):

Tag each post row with a lightweight sentiment score and label.

## `deltaMode` (type: `boolean`):

Only emit rows no earlier run has delivered (state is kept per actor).

## `delay` (type: `number`):

Seconds to wait between requests. A small delay keeps runs stable.

## `maxSearchPages` (type: `integer`):

Maximum Weibo search pages to walk (mode=search).

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "人工智能",
  "searchAliases": [],
  "autoLocalize": true,
  "userIds": [],
  "postIds": [],
  "maxResults": 10,
  "maxComments": 20,
  "includeComments": false,
  "includeReplies": false,
  "fetchFullText": true,
  "adFilter": "all",
  "includeAuthorProfiles": false,
  "sentimentAnalysis": false,
  "deltaMode": false,
  "delay": 0.5,
  "maxSearchPages": 40
}
```

# Actor output Schema

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

All scraped Weibo rows, one item per row. Each row has a `mode` field naming its shape: search post, comment, profile, hot-search entry, or timeline entry. Common fields: id, mid, text, created_at, url, user, reposts_count, comments_count, likes_count, and mode-specific extras.

# 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("data_dino/weibo-search").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("data_dino/weibo-search").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 data_dino/weibo-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_dino/weibo-search"
        }
    }
}
```

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/XeUlGHcQWkateuDKn/builds/dezY0kzeXLdXLjvKy/openapi.json
