Baidu Tieba thread search API

Based on the 2026-11-21 specification

Quick answer

POST /tieba/search/task searches Tieba threads by keyword and posting date range (YYYY-MM-DD, UTC+8, inclusive; default the last 7 days), newest first. For each thread in range it also collects the full first-floor text, reply and like counts, the forum name and the poster's IP location. max_pages runs from 0 to 31 (0 or omitted means 31) at 20 threads per page, about 620 threads per query, and the task stops early once a whole page is older than start_date. Poll GET /tieba/search/task/{task_id}; once DONE the response carries task, total_count and data, up to 100 threads per page. Data is collected by web crawlers from content publicly published on Baidu Tieba.

What teams use it for

  • Follow what Tieba forums say about a product, brand or local issue.
  • Collect dated threads on a topic for research, with reply counts to find the busiest ones.
  • Pass thread URLs to the Tieba replies API to read the floors and in-floor replies.

Endpoints

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

MethodPathWhat it does
POST /tieba/search/task Create a thread keyword search task with an optional date range and page limit.
GET /tieba/search/task/{task_id} Poll the search task; once DONE it returns the threads and total_count, up to 100 per page.

Request parameters

POST /tieba/search/task

ParameterInTypeRequiredDefault / allowedDescription
keyword body string Yes Search keyword, 1 to 100 characters.
end_date body string No End date, inclusive (YYYY-MM-DD, UTC+8). Defaults to today.
max_pages body integer No 31 (max 31) Maximum result pages; 0 or omitted uses the default. 20 threads per page.
rerun body boolean No Accepted for consistency with other platforms; every POST creates a new task.
start_date body string No Start date, inclusive (YYYY-MM-DD, UTC+8). Defaults to 7 days ago.

GET /tieba/search/task/{task_id}

ParameterInTypeRequiredDefault / allowedDescription
task_id path string Yes Task ID returned when the task was created.
page query integer No 1 Page number, starting at 1.
pageSize query integer No 100 Threads per page, max 100.

Response fields

DataFieldsEndpoint
Threads (data) 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 (task) 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}

Code examples

curl: create the 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}'

curl: 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"

Python (requests): create, poll, read

import time
import requests

BASE_URL = "https://api.infominer.io/api/v2"
HEADERS = {"auth-header": "YOUR_API_KEY"}

# 1. Create the task
resp = requests.post(
    f"{BASE_URL}/tieba/search/task",
    headers=HEADERS,
    json={
        "keyword": "公路车",
        "start_date": "2026-06-01",
        "end_date": "2026-06-07",
        "max_pages": 3,
    },
    timeout=30,
)
resp.raise_for_status()
task = resp.json()

# 2. Poll until the task leaves INIT / RUNNING
for _ in range(120):
    resp = requests.get(
        f"{BASE_URL}/tieba/search/task/{task['id']}",
        headers=HEADERS,
        params={
            "page": 1,
            "pageSize": 100,
        },
        timeout=30,
    )
    resp.raise_for_status()
    result = resp.json()
    status = result.get("status") or result.get("task", {}).get("status")
    if status not in ("INIT", "RUNNING"):
        break
    time.sleep(15)
else:
    raise SystemExit("task still running; poll it again later")

task = result.get("task", result)
if status != "DONE" or task.get("partial") or task.get("timed_out"):
    raise SystemExit(f"task ended with status {status}; no complete result")

# 3. Read the records (use page / pageSize to fetch further pages)
for row in result.get("data", []):
    print(row.get("url"), (row.get("title") or "")[:60])

Sample response

Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. Fields follow the 2026-11-21 specification; the sample shows a subset of the fields.

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
}

Limits and notes

  • One 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, and a listed thread whose text does not contain the keyword verbatim may be missing from data.
  • deleted counts listed threads that were deleted or hidden by the time they were collected; it is not a failure.
  • Only a DONE poll carries data; PARTIAL, TIMED_OUT and FAILED return the task object alone. Treat a task as fully successful when status is DONE and partial and timed_out are both false.
  • data matches everything collected for the range, including earlier tasks' results, so total_count can exceed task.completed; task.completed is what this task collected.
  • Counts are as of collection and not refreshed automatically. 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.

More Baidu Tieba API pages

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

What does depth_capped mean?
Tieba ran out of search pages before the start of your date range, so the earlier part of the range was not reached. Split the range into smaller tasks.
Which forum does a thread come from?
type and ctype hold the forum name; the thread URL is https://tieba.baidu.com/p/{thread id}.
Does Tieba search look inside replies?
No. It matches thread titles and first floors only.
How is the data collected? Is this the official Baidu Tieba API?
By web crawlers, from content publicly published on Baidu Tieba. LargitData is not affiliated with Baidu Tieba and this is not Baidu Tieba'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.