qstringआवश्यक
q
https://api.sandbase.ai/v1/api/baidu/newsBaidu News results for a keyword: headline, source, date, snippet and link.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
This API returns Baidu News search results for a keyword. Each result has a headline, source name, relative date, snippet, link and thumbnail. It needs one input, q, the search keyword.
source field.curl -X POST "https://api.sandbase.ai/v1/api/baidu/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "coffee"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | q |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"organic_results": [
{
"date": "8天前",
"link": "https://baijiahao.baidu.com/s?id=1880085169863886735&wfr=spider&for=pc",
"position": 1,
"snippet": "近日,《中国100咖啡指南(2026)》正式发布,贵阳4个咖啡品牌入选。其中,来自贵阳的咖啡品牌——Captain George 风味博物馆(上海太原路店)位列…",
"source": "贵阳发布",
"thumbnail": "https://t8.baidu.com/it/u=1035183366,940297393&fm=3035&app=3035&size=f242,162&n=…",
"title": "全国百佳,贵阳占4席!"
}
],
"pagination": {
"current": 1,
"next": "https://www.baidu.com/s?rtt=1&ie=utf-8&bsst=1&cl=2&wd=coffee&tn=news&x_bfe_rqs=0…",
"other_pages": {
"2": "https://www.baidu.com/s?rtt=1&ie=utf-8&bsst=1&cl=2&wd=coffee&tn=news&x_bfe_rqs=0…",
"3": "https://www.baidu.com/s?rtt=1&ie=utf-8&bsst=1&cl=2&wd=coffee&tn=news&x_bfe_rqs=0…"
}
},
"related_searches": [
{
"link": "https://www.baidu.com/s?rtt=1&ie=utf-8&bsst=1&cl=2&wd=luckincoffee&tn=news&x_bfe…",
"query": "luckincoffee"
}
],
"search_information": {
"total_results": 23
},
"top_searches": [
{
"link": "https://www.baidu.com/s?cl=2&wd=%E8%AE%A9%E6%AF%8D%E4%BA%B2%E6%B2%B3%E6%B0%B8%E7…",
"position": 1,
"text": "让母亲河永续惠泽子孙后代"
}
]
}
| Field | Meaning |
|---|---|
organic_results[].title | Headline of the news article. |
organic_results[].link | URL of the article. |
organic_results[].snippet | Short text excerpt from the article. Long text is cut with an ellipsis. |
organic_results[].source | Name of the outlet that published the article. |
organic_results[].date | Publication time as shown on the page, in relative form such as 8天前 (8 days ago). It is not an absolute timestamp. |
organic_results[].position | Rank of the result in the list, starting at 1. |
organic_results[].thumbnail | URL of the article's thumbnail image. |
pagination.current / pagination.next / pagination.other_pages | The current page number, the link to the next page, and links to other pages keyed by page number. |
related_searches[].query / related_searches[].link | A related search term and the Baidu link for it. |
search_information.total_results | Total result count reported for the query. |
q to any keyword. The example uses coffee, and Chinese keywords also fit the response, since results are in Chinese.pagination.next and pagination.other_pages point to Baidu search pages. Page numbers appear as keys, such as 2 and 3.date is relative text such as 6天前, so store the time you made the call if you need to work out the absolute date.top_searches list with position, text and link for each entry. It does not depend on your keyword in the sample.$0.015 per successful call. Failed calls are not charged.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
curl -X POST "https://api.sandbase.ai/v1/api/baidu/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "coffee"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
qstringआवश्यकq
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
कोई सेव response प्रकाशित नहीं किया गया है। इसका response देखने के लिए Playground में API चलाएँ।
और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
Baidu News Searchयह API Baidu | $0.015 प्रति कॉल | JSON |
Baidu | $0.03 प्रति कॉल | JSON |
Baidu | $0.03 प्रति कॉल | JSON |
Baidu | $0.01 प्रति कॉल | JSON |
Baidu | $0.03 प्रति कॉल | JSON |
Baidu | $0.03 प्रति कॉल | JSON |
प्रश्न
https://api.sandbase.ai/v1/api/baidu/news पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.015 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
आवश्यक: q (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। Baidu News Search SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से Baidu API access के लिए आवेदन करने की आवश्यकता नहीं है।