Baidu APIbaidu.com ↗
Search Baidu News articles by keyword and fetch up to 50 ranked trending topics. Paginated results with titles, sources, summaries, and hot scores.
What is the Baidu API?
The Baidu API covers 2 endpoints that expose Baidu News article search and real-time trending topics from China's largest search engine. The search_news endpoint returns paginated article results — up to 10 per page — including title, source name, summary, relative timestamp, and optional image URL, while get_trending delivers up to 50 ranked hot topics with heat scores and trend change indicators.
curl -X GET 'https://api.parse.bot/scraper/e24b92b6-cc44-4a65-8054-59e07ee46255/search_news?query=%E7%A7%91%E6%8A%80' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace baidu-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Baidu News SDK — trending topics and news search."""
from parse_apis.baidu_com_api import BaiduNews, InputFormatInvalid
client = BaiduNews()
# Fetch today's top trending topics on Baidu.
for topic in client.topics.list(limit=5):
print(f"#{topic.rank} {topic.title} (score: {topic.hot_score})")
# Search news articles for a keyword, drill into the first result.
article = client.articles.search(query="科技", limit=1).first()
if article is not None:
print(f"{article.title} — {article.source}, {article.time}")
print(article.summary[:120])
# Paginate through more search results with a different query.
try:
for article in client.articles.search(query="人工智能", limit=5):
print(f"{article.title} [{article.source}]")
except InputFormatInvalid as e:
print(f"Invalid input: {e.message}")
print("exercised: topics.list / articles.search")
Search Baidu News for articles matching a keyword query. Returns paginated results with 10 articles per page. Each article includes title, URL, source name, relative time, summary text, and optionally an image URL. The total approximate result count and whether more pages are available are included in the response.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination (1-indexed). Each page returns up to 10 results. |
| queryrequired | string | Search keyword or phrase for news articles. |
{
"type": "object",
"fields": {
"page": "Current page number",
"query": "The search query echoed back",
"total": "Approximate total number of matching news articles, or null if unavailable",
"articles": "Array of news article objects with title, url, source, time, summary, and optionally image_url",
"has_more": "Whether additional pages of results are available"
},
"sample": {
"data": {
"page": 1,
"query": "科技",
"total": 108,
"articles": [
{
"url": "http://www.nbd.com.cn/articles/2026-09-01/4568571.html",
"time": "5小时前",
"title": "硬科技企业正在迁往成都",
"source": "每日经济新闻",
"summary": "据不完全统计,今年以来已有星际开发、析芒医疗、连芯科技..."
}
],
"has_more": true
},
"status": "success"
}
}About the Baidu API
News Search
The search_news endpoint accepts a required query string and an optional page integer (1-indexed) to paginate through results. Each response echoes back the query and current page, reports an approximate total article count (or null when Baidu does not surface one), and includes a has_more boolean so you can walk pages programmatically. Each item in the articles array carries a title, url, source (the publishing outlet name), a relative time string, a plain-text summary, and an optional image_url when Baidu attaches a thumbnail.
Trending Topics
The get_trending endpoint requires no input parameters and returns a topics array of up to 50 objects ranked by Baidu's real-time heat algorithm. Each topic object includes rank, title, description, hot_score, url (the Baidu search URL for that topic), image_url, hot_tag (a category label like "热" or "新"), and hot_change indicating whether the topic is rising, stable, or falling in rank. This makes it straightforward to track what subjects are dominating Chinese-language search at any given moment.
Coverage Notes
All content originates from Baidu's Chinese-language index. Article time fields are relative strings (e.g., "3小时前") rather than absolute timestamps. The total field is an approximation and can be null on some queries. Trending data reflects Baidu's own ranking signals and refreshes throughout the day.
The Baidu API is a managed, monitored endpoint for baidu.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when baidu.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official baidu.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Monitor Chinese-language news coverage of a brand, company, or topic using the
queryparameter insearch_news. - Build a dashboard of real-time Chinese internet trends by polling
get_trendingand trackinghot_scorechanges over time. - Identify which news sources are most active on a topic by aggregating the
sourcefield across paginatedsearch_newsresults. - Alert systems for PR or market research teams when a specific keyword appears in Baidu News results.
- Rank trending topics by
hot_changeto detect fast-rising subjects before they peak. - Aggregate news article thumbnails and summaries via
image_urlandsummaryfields for a Chinese-language news digest feed. - Cross-reference
hot_taglabels fromget_trendingto filter trending topics by category type.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Baidu offer an official developer API for news search or trending topics?+
What does the `get_trending` endpoint return beyond just topic titles?+
hot_score (Baidu's heat index), a hot_tag label (e.g., category or freshness indicator), a hot_change value showing rank movement, a description snippet, an image_url, and the url pointing to the Baidu search results page for that topic. Rank position is provided as an integer in the rank field.How does pagination work in `search_news`, and how do I know when to stop?+
page integer parameter starting at 1. Each response returns up to 10 articles and includes a has_more boolean. When has_more is false, there are no further pages. The total field gives an approximate count of matching articles, but it can be null on some queries, so has_more is the reliable signal for stopping pagination.Are absolute publication timestamps available for news articles?+
time field in search_news article objects is a relative string as Baidu displays it (for example, "2小时前"). Absolute ISO timestamps are not exposed. You can fork the API on Parse and revise it to add timestamp parsing or normalization if your use case requires absolute dates.Does the API support filtering news results by date range, language, or source outlet?+
search_news endpoint accepts only a query string and a page number; there are no built-in filters for date range, specific news source, or language. All results are from Baidu's Chinese-language index. You can fork the API on Parse and revise it to add filtering endpoints if you need more granular control.