# Baidu Tieba Comments Scraper (`natanielsantos/baidu-tieba-comments-scraper`) Actor

Easily scrape comment data from Baidu Tieba posts. Get comment text, author data, images, like count, replies and more.

- **URL**: https://apify.com/natanielsantos/baidu-tieba-comments-scraper.md
- **Developed by:** [Nataniel Santos](https://apify.com/natanielsantos) (community)
- **Categories:** Social media, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 comments

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

## Baidu Tieba Comments Scraper

### ✨ Features

- 💬 Scrape comments and replies for each post
- ⚡ Fast and reliable scraping
- 🧑‍💻 Perfect for non-technical users
- 🔒 No need for authentication
- 🔄 Automatically handles retries for failed requests
- 📦 Outputs data in JSON format for easy integration with other tools

### 🎯 Who Is This For?

- Researchers looking to analyze trends and discussions on Baidu Tieba
- Marketers interested in understanding consumer sentiment and popular topics
- Data scientists seeking to build models based on Baidu Tieba data
- Anyone interested in exploring the rich content of Baidu Tieba for personal or professional reasons

### 💡 Input Parameters

- 🔗 `urls` - You can add direct URLs to scrape here. It should be a post URL
- 🔢 `postIds` - You can add direct post IDs here. The actor will scrape comments from these posts.
- 💬 `maxCommentsPerPost` - Maximum number of top-level comments to scrape per post.
- 💬 `maxRepliesPerComment` - Maximum number of replies to scrape per comment.
- ↕️ `sortCommentsBy` - Choose how to sort the comments when scraping a post. **popular** sorts by relevance to the post, **latest** sorts by date with the newest comments first, and **oldest** sorts by date with the oldest comments first.

##### ⚙️ Options and limits:

- ⚙️ `maxPosts` - Maximum number of posts to be scraped per search term, topic, profile or hot topic.

#### ⚙️ Input Examples

###### Example 1 - Scrape comments and replies for each post, with a maximum of 20 comments per post and 10 replies per comment, sorted by latest:

```json
{
    "urls": [
        { "url": "https://tieba.baidu.com/p/10860925843?fr=frs" }
    ],
    "maxCommentsPerPost": 20,
    "maxRepliesPerComment": 10
}
```

### 🗂️ Output Format

- `commentId` - The unique ID of the comment.
- `authorId` - The unique ID of the comment author.
- `images` - An array of image URLs attached to the comment.
- `mentions` - An array of objects representing users mentioned in the comment, each containing:
  - `name` - The name of the mentioned user.
  - `id` - The unique ID of the mentioned user.
- `content` - The text content of the comment.
- `createTime` - The timestamp of when the comment was created (in milliseconds since epoch).
- `createTimeUtc` - The UTC timestamp of when the comment was created.
- `agreeCount` - The number of likes or upvotes the comment has received.
- `disagreeCount` - The number of dislikes or downvotes the comment has received.
- `diffAgreeCount` - The difference between the number of likes and dislikes.
- `replyCount` - The number of replies to the comment.
- `authorName` - The name of the comment author.
- `authorNameShow` - The display name of the comment author.
- `authorAvatarUrl` - The URL of the comment author's avatar image.
- `authorLevel` - The level of the comment author.
- `authorLevelInForum` - The level of the comment author within the forum.
- `authorIsVerified` - A boolean indicating whether the comment author is verified.
- `authorGender` - The gender of the comment author.
- `authorLevelName` - The name of the level of the comment author.
- `ipAddress` - The IP address of the comment author.
- `replyToCommentId` - The unique ID of the comment that this comment is replying to (if applicable).

### 📤 Comments Output Format

```json
{
    "commentId": 153714041200,
    "authorId": 813941787,
    "images": ["https://tiebapic.baidu.com/forum/pic/item/3dfa828ba61ea8d3163f3506d10a304e251f5897.jpg?tbpicau=2026-07-27-05_da20a784d635c8cb0925b55cb2f36137"],
    "mentions": [
        {
            "name": "顽皮熊梁",
            "id": 3749198490
        }
    ],
    "content": "我也不看，印象最深的就是那句如果你是周星驰的铁杆粉丝，而且对剧本打磨没什么要求的可以去看[笑眼]",
    "createTime": 1783832869000,
    "createTimeUtc": "2026-07-12T05:07:49.000Z",
    "agreeCount": 5,
    "disagreeCount": 1,
    "diffAgreeCount": 4,
    "replyCount": 0,
    "authorName": "红汪汪dg",
    "authorNameShow": "知微知微",
    "authorAvatarUrl": "https://himg.bdimg.com/sys/portrait/item/tb.1.da70f27d.yMcd1lH2HLf32dkTxYF9tA?t=1784222695",
    "authorLevel": 13,
    "authorLevelInForum": 8,
    "authorIsVerified": false,
    "authorGender": "male",
    "authorLevelName": "银幕巨人",
    "ipAddress": "河南",
    "replyToCommentId": 153713866719
}
```

### 💲How much will scraping Baidu Tieba Comments cost you?

The pricing changes according to your Apify plan.

<table>
    <tr>
        <th>Plan</th>
        <th>Price</th>
    </tr>
    <tr>
        <td>Free</td>
        <td>&#36;5.00 / 1,000 comments</td>
    </tr>
    <tr>
        <td>Starter</td>
        <td>&#36;2 / 1,000 comments</td>
    </tr>
    <tr>
        <td>Scale</td>
        <td>&#36;1.50 / 1,000 comments</td>
    </tr>
    <tr>
        <td>Business</td>
        <td>&#36;1.00 / 1,000 comments</td>
    </tr>
</table>

💡 **Free Plan** users can scrape up to 50 comments per run, and 50 replies per comment per run. Upgrading to a paid plan will remove this limitation.

### 🧩 Integrations and Baidu Tieba Comments Scraper

Baidu Tieba Comments Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, [and more](https://docs.apify.com/integrations). Or you can use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs, e.g. get a notification whenever Baidu Tieba Comments Scraper successfully finishes a run.

### 🔌Using Baidu Tieba Comments Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the apify-client NPM package. To access the API using Python, use the apify-client PyPI package.

Check out the [Apify API reference](https://docs.apify.com/api/v2) docs for full details or click on the [API tab](https://apify.com/natanielsantos/baidu-tieba-comments-scraper/api) for code examples.

### 💬 Giving feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for Baidu Tieba Comments scraper or simply found a bug, please create an issue on the Actor’s [Issues tab](https://apify.com/natanielsantos/baidu-tieba-comments-scraper/issues/open) in Apify Console.
📧 Email: nathan.santos159@hotmail.com

# Actor input Schema

## `urls` (type: `array`):

You can add direct URLs to scrape here. It should be a post URL.

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

You can add direct post IDs here. The actor will scrape comments from these posts.

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

The maximum number of top-level comments to scrape per post.

## `maxRepliesPerComment` (type: `integer`):

The maximum number of replies to scrape per comment.

## `sortCommentsBy` (type: `string`):

Choose how to sort the comments when scraping a post. 'Most Relevant' sorts by relevance to the post, 'Latest' sorts by date with the newest comments first, and 'Oldest' sorts by date with the oldest comments first.

## Actor input object example

```json
{
  "maxCommentsPerPost": 0,
  "maxRepliesPerComment": 0,
  "sortCommentsBy": "popular"
}
```

# 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 = {
    "sortCommentsBy": "popular"
};

// Run the Actor and wait for it to finish
const run = await client.actor("natanielsantos/baidu-tieba-comments-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 = { "sortCommentsBy": "popular" }

# Run the Actor and wait for it to finish
run = client.actor("natanielsantos/baidu-tieba-comments-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 '{
  "sortCommentsBy": "popular"
}' |
apify call natanielsantos/baidu-tieba-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natanielsantos/baidu-tieba-comments-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/sIVkm0GrhRnKrDU0Z/builds/48p23HhCQwcinCsUF/openapi.json
