跳到导航

怎么用 Web Search API 查新闻、论文、专利、商品或地点?为什么 news 没摘要、places 没 url?

以 Markdown 格式查看

在 POST /v1/web/search 中传入 type 即可切换 web(默认)、news、images、videos、scholar、patents、shopping、places 八种垂直搜索,无论选哪种类型或 max_results(1–10),单次成功费用均为 $0.005。不同类型字段不同:news 不返回 snippet(需要正文请用 POST /v1/web/read 读原文),places 不返回 url(官网和地址在 website、address、phone 字段里)。

8 种 type 的核心字段与筛选限制

type核心专属字段是否支持 time_range / include_domains / exclude_domains?
websnippet、published_at支持
newssource、published_at、image_url(无 snippet)支持
imagesimage_url、thumbnail_url、width、height、source支持
videossource、duration、published_at、image_url支持
scholarpublication_info、year、cited_by、pdf_url不支持(传入会报 400 bad_request)
patentspublication_number、priority_date、filing_date、grant_date、inventor、assignee、pdf_url不支持
shoppingsource、price、rating、rating_count、image_url不支持
placesaddress、latitude、longitude、rating、rating_count、category、phone、website(无 url)不支持

示例:检索学术论文

curl -sS https://api.beatapi.io/v1/web/search \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"retrieval augmented generation evaluation","type":"scholar","max_results":5}'
  • 中日韩语言自动识别:同时省略 country 和 language 时,中文、日文或韩文查询会自动按对应语言与地区检索。
  • 避免 400 bad_request:查 scholar、patents、shopping、places 时不要附带 time_range 或域名过滤参数。详见 BeatAPI Web Search API 与 Web Search API 参考。

相关文档

返回Web Search问题索引。