Baidu Tieba API: thread search, floors and replies

Based on the 2026-11-21 specification

Quick answer

The Baidu Tieba API has two asynchronous tasks. POST /tieba/search/task searches Tieba threads by keyword and posting date range (default the last 7 days) and, for each thread in range, collects the full first-floor text, reply and like counts, the forum name and the poster's IP location. POST /tieba/pushs/task collects every floor of one thread from the second floor on, with the in-floor replies under each floor. Poll each task with GET; once it is DONE the same response returns the records, newest first. One search query reaches at most about 31 pages (about 620 threads), and depth_capped tells you when the earlier part of the date range was not reached. Data is collected by web crawlers from content publicly published on Baidu Tieba.

API pages by capability

Data you get

Fields follow the 2026-11-21 specification. Until a task is DONE the poll returns only the task object; once DONE the same response carries task, total_count, data, page and pageSize. Records can carry more fields than listed here; descriptive fields such as meta_keywords, location and icon_url may be empty.

DataFieldsEndpoint
Threads from keyword search id, url, title, content, tm, datetime, tm_crawler, tm_update, author, author_id, type, ctype, source, sentiment, region, comment_count, like_count, share_count, metadata_img, metadata_videos GET /tieba/search/task/{task_id}
Search task status and counters task: id, keyword, status, start_date, end_date, max_pages, created_at, total, completed, pages_crawled, partial, timed_out, failed_pages, failed_articles, failed_ranges, deleted, depth_capped GET /tieba/search/task/{task_id}
Floors and in-floor replies of a thread id, post_id, author_id, author, push_type, region, content, tm, tm_crawler, sentiment GET /tieba/pushs/task/{task_id}
Reply task status and counters task: id, post_url, status, crawl_second_layer, created_at, total, completed, pages_crawled, reported_total, partial, timed_out, failed_pages, failed_batches, tid, title, forum GET /tieba/pushs/task/{task_id}

Endpoints

Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header. Parameters marked * are required.

MethodPathWhat it doesMain parameters
POST /tieba/search/task Create a thread keyword search task with an optional date range and page limit. keyword* end_date max_pages rerun start_date
GET /tieba/search/task/{task_id} Poll the search task; once DONE it returns the threads and total_count, up to 100 per page. task_id* page pageSize
POST /tieba/pushs/task Create a reply task from a thread URL: floors from the second on, optionally with in-floor replies. post_url* crawl_second_layer max_pages rerun
GET /tieba/pushs/task/{task_id} Poll the reply task; once DONE it returns the floors and replies, up to 1000 per page. task_id* page pageSize

How to get the data

  1. POST /tieba/search/task with keyword (1 to 100 characters) and optional start_date and end_date (YYYY-MM-DD, UTC+8, inclusive; default the last 7 days) and max_pages (0 to 31; 0 or omitted means 31, 20 threads per page). The task stops early once a whole page is older than start_date.
  2. Poll GET /tieba/search/task/{task_id}. Poll every 3 to 5 seconds and set an overall deadline. Statuses are INIT, RUNNING, DONE, PARTIAL, TIMED_OUT (no progress for more than 600 seconds) and FAILED. Only a DONE response carries data; the others return the flat task object, so read the status as task.status or, before DONE, status. A task fully succeeded when status is DONE and partial and timed_out are both false. deleted counts listed threads that were deleted or hidden by the time they were collected, which is not a failure.
  3. Once DONE, read the threads from data with page and pageSize (up to 100 per page). If depth_capped is true, Tieba ran out of search pages before the start of the range; split the range into smaller tasks.
  4. For a thread's discussion, POST /tieba/pushs/task with its /p/{thread id} URL on tieba.baidu.com or m.tieba.baidu.com. max_pages limits the pages of floors (0 to 500; 0 or omitted means 100, 30 floors per page) and crawl_second_layer (default true) adds in-floor replies. Read them with pageSize up to 1000.

curl examples

Create a keyword search task

curl -X POST https://api.infominer.io/api/v2/tieba/search/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "公路车", "start_date": "2026-06-01", "end_date": "2026-06-07", "max_pages": 3}'

Poll the task by ID

curl "https://api.infominer.io/api/v2/tieba/search/task/$TASK_ID?page=1&pageSize=100" \
  -H "auth-header: YOUR_API_KEY"

Create a reply task from a thread URL

curl -X POST https://api.infominer.io/api/v2/tieba/pushs/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_url": "https://tieba.baidu.com/p/10000000001", "crawl_second_layer": true, "max_pages": 2}'

Sample JSON

Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. These are not real posts.

Task creation response (Illustrative data)

{
  "id": "00000000-0000-4000-8000-000000000001",
  "keyword": "公路车",
  "status": "INIT",
  "start_date": "2026-06-01",
  "end_date": "2026-06-07",
  "max_pages": 3,
  "created_at": 1780880400,
  "total": 0,
  "completed": 0,
  "pages_crawled": 0,
  "deleted": 0,
  "depth_capped": false,
  "timed_out": false,
  "partial": false,
  "failed_pages": 0,
  "failed_articles": 0,
  "failed_ranges": 0
}

Poll response once the task is DONE (Illustrative data)

{
  "task": {
    "id": "00000000-0000-4000-8000-000000000001",
    "keyword": "公路车",
    "status": "DONE",
    "start_date": "2026-06-01",
    "end_date": "2026-06-07",
    "max_pages": 3,
    "created_at": 1780880400,
    "total": 2,
    "completed": 2,
    "pages_crawled": 1,
    "deleted": 0,
    "depth_capped": false,
    "timed_out": false,
    "partial": false,
    "failed_pages": 0,
    "failed_articles": 0,
    "failed_ranges": 0
  },
  "total_count": 2,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000001",
      "url": "https://tieba.baidu.com/p/10000000001",
      "title": "入门公路车预算五千,大家帮忙看看这两款",
      "content": "平时通勤加周末骑行,身高 175,主要在两款之间犹豫,想听听吧友的意见",
      "tm": 1780666200,
      "datetime": "2026-06-05 21:30:00",
      "tm_crawler": 1780880404,
      "tm_update": 1780880404,
      "author": "sample_user_1",
      "author_id": "0000000001",
      "type": [
        "骑行"
      ],
      "ctype": [
        "骑行"
      ],
      "source": "tieba",
      "sentiment": "Neutral",
      "region": "江苏",
      "comment_count": 3,
      "like_count": 5,
      "share_count": 0,
      "metadata_img": [],
      "metadata_videos": []
    },
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "url": "https://tieba.baidu.com/p/10000000002",
      "title": "公路车周末环湖骑行记录,风景很好",
      "content": "公路车周末环湖骑行记录,风景很好",
      "tm": 1780452000,
      "datetime": "2026-06-03 10:00:00",
      "tm_crawler": 1780880408,
      "tm_update": 1780880408,
      "author": "sample_user_2",
      "author_id": "0000000002",
      "type": [
        "骑行"
      ],
      "ctype": [
        "骑行"
      ],
      "source": "tieba",
      "sentiment": "Positive",
      "region": "浙江",
      "comment_count": 8,
      "like_count": 12,
      "share_count": 1,
      "metadata_img": [
        "https://tiebapic.baidu.com/forum/pic/item/sample_1.jpg"
      ],
      "metadata_videos": []
    }
  ],
  "page": 1,
  "pageSize": 100
}

How posts and comments link

A reply task is created from the thread URL. Every record has post_id, the document ID of the thread, which equals the id of the same thread in search results. push_type is comment for a floor and reply for an in-floor reply. The first floor, the thread itself, is not in the reply data; its text is the content of the thread returned by search. The task object carries tid, the thread's title and forum name, and reported_total, the reply count Tieba shows. data holds every collected reply of the thread, including replies collected by earlier tasks, so total_count can differ from task.completed.

History and limits

  • One search query reaches at most about 31 pages, about 620 threads. depth_capped is true when the earlier part of the date range was not reached; split the range into smaller tasks.
  • Search matches thread titles and first floors only; a thread whose keyword appears only in replies is not listed. A listed thread whose text does not contain the keyword verbatim may also be missing from data.
  • In-floor replies are capped at 600 per floor (20 pages of 30).
  • region (IP location) is always empty for in-floor replies; threads and floors carry it when Tieba shows it.
  • Collecting every floor and in-floor reply of a thread with thousands of floors can take several minutes or more, so set max_pages for large threads.
  • data is a keyword match over everything collected for the date range, including results of earlier tasks, so total_count can exceed task.completed. task.completed is what this task collected. Like and comment counts are as of collection. They are not refreshed automatically; create a new task for current numbers. How far back search can go is confirmed per project scope.
Collection: web crawlers collect content publicly published on each platform. Whether this suits your use depends on the purpose and jurisdiction and is for the buyer's legal team to assess; we can provide a description of sources and collection methods.

Delivery format

JSON. Search and comment tasks return their records in the poll response once DONE, paginated with page and pageSize (search up to 100 per page, comments up to 1000). Batch files or other delivery are confirmed per project scope.

Request a trial

In the form below, mention Baidu Tieba and tell us the keywords, forums or threads you want to follow, whether you need floors and in-floor replies, and the expected volume. We will confirm the scope and arrange a trial and an API key.

Fill in the form to request a trial. We confirm the scope and reply with trial and integration arrangements.

Fill in the request form

FAQ

How many threads does one Tieba search return?
At most about 31 pages of 20 threads, about 620 threads per query. When depth_capped is true the earlier part of the date range was not reached; split the range into smaller tasks.
Does Tieba search look inside replies?
No. Search matches thread titles and first floors only, so a thread whose keyword appears only in replies is not listed.
Why is the first floor missing from the reply task?
The first floor is the thread itself. Its full text is the content of the thread returned by the search task; the reply task returns the floors from the second floor on and the in-floor replies.
What do the HTTP error codes mean?
HTTP 400 means a malformed request (for example a missing keyword or a start_date after end_date), 401 a missing or invalid key, 403 a key without access to this platform, 404 an unknown task ID, and 422 a request the crawler service rejected, such as a URL from the wrong site or max_pages out of range; no task is created. Retry 500 and 502 with backoff, and 503 after Retry-After.
Is this a Baidu Tieba scraper API? How is the data collected?
Yes. LargitData collects content publicly published on Baidu Tieba with web crawlers and returns it as JSON through the API, so you do not run scrapers yourself. LargitData is not affiliated with Baidu and this is not Baidu's own API. Whether this suits your use depends on the purpose and jurisdiction and is for your legal team to assess; we can provide a description of sources and collection methods.