搜索API · 新闻

面向AI智能体的新闻搜索API

覆盖主流媒体的实时新闻搜索,内置国家与日期过滤。专为晨间简报机器人、市场新闻智能体和任何需要将回答锚定在时事中的RAG管线而设计。

15 积分 / 调用60 次/分钟POST /api/search/news

实时试用新闻搜索

输入您的API密钥,对生产端点发起一次真实查询。

API Authentication Required
Enter your API key to access this service. All API calls require authentication.

还没有 API 密钥?

登录账户以创建和管理您的 API 密钥。

5 条示例查询 — 点击载入

API Integration Guide

Learn how to integrate this API into your applications with code examples and detailed documentation.

API Overview
带日期范围与国家过滤的实时新闻搜索。返回排序后的标题与可直接供下游LLM使用的清洁摘要。
POST
/api/search/news

Base URL

https://www.apipick.com

Full Endpoint

https://www.apipick.com/api/search/news
Parameters
Required and optional parameters for this API
query
required
string

Natural-language search query

max_num_results
optional
integer

1–5, default 5

relevance_threshold
optional
number

0.0–1.0 quality filter

country_code
optional
string

ISO country code (e.g. US, GB)

start_date
optional
string

ISO date YYYY-MM-DD

end_date
optional
string

ISO date YYYY-MM-DD

Code Examples
Copy and paste these examples to quickly integrate the API into your application

cURL Request

curl -X POST "https://www.apipick.com/api/search/news" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "query": "artificial intelligence regulation updates",
  "max_num_results": 5,
  "country_code": "US",
  "start_date": "2026-01-01"
}'
Replace YOUR_API_KEY with your actual API key
Response Example
Example response from the API

JSON Response

{
  "query": "artificial intelligence regulation updates",
  "results": [
    {
      "title": "Example result",
      "url": "https://example.com/article",
      "snippet": "Short excerpt of the page content…",
      "source_type": "web",
      "published_at": "2026-04-15",
      "score": 0.92
    }
  ],
  "result_count": 1,
  "credits_used": 15,
  "remaining_credits": 99
}
Integration Tips

Best Practices

  • • Always include x-api-key header
  • • Always handle errors gracefully
  • • Validate input data before sending
  • • Use HTTPS for secure communication
  • • Cache responses when appropriate

Response Headers

  • • Content-Type: application/json
  • • x-api-key: Required for authentication
  • • Status codes: 200 (success), 400 (error), 401 (unauthorized)
  • • No rate limiting applied

Rate Limits

⏱️

Request Rate

60req / min

Per API key, per endpoint. Sliding 60-second window.

🔀

Concurrency

3concurrent

Max simultaneous in-flight requests per API key.

Response Headers

X-RateLimit-LimitMaximum requests allowed per minute
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetSeconds until the current window resets
Retry-AfterSeconds to wait before retrying (only on 429)

429 Too Many Requests

HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 12

{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded: 60 requests/minute per API key. Retry after 12s.",
  "retry_after": 12
}

常见问题

结果有多新?

结果包含过去几分钟内被索引的文章。使用 start_date / end_date 来限定具体窗口,例如最近24小时获取突发新闻,或上一季度获取财报报道。

可以按国家过滤吗?

可以。country_code 接受ISO 3166-1 alpha-2代码(USGBJPDE……)。它会让结果偏向该国的来源。

与 /api/search/web 有何不同?

新闻端点针对带发布日期的新闻媒体来源调优,偏好时效性文章。/api/search/web 更适合一般参考类内容(文档、类Wikipedia、常青页面)。

有面向AI智能体的工具Schema吗?

有。GET /api/search/news/tool-schema 返回可直接粘贴到智能体代码中的OpenAI函数与Claude工具使用定义。