# 加密新闻 关键词搜索 API (crypto_news.search)

- Canonical page: https://everyinfra.com/crypto-news-api/search
- Endpoint: POST /api/v1/social with {"platform": "crypto_news", "action": "search", "params": {...}}
- Price: $0.004806 per call ($4.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

加密新闻关键词搜索按 `keyword` 找相关报道，`keyword` 长 2–100 字，例如 bitcoin ETF，默认 20 条，单次最多 100 条。每行有标题、摘要、发布媒体、原文链接、发布时间和关联项目 `project_name`。它回答「这个话题媒体都是怎么报道的」，适合追一个事件、一个项目或一项监管动态，也能看不同媒体对同一件事的覆盖。

结果按相关度排，不按时间，想要最新的就按 `published_at` 自己排序。这一页没有按媒体、按项目筛选的参数，只靠 `keyword` 缩小范围。`summary` 只有一两句话，全文看 `url`；`source` 是大写的媒体名。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=crypto_news&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 新闻搜索词，2–100 字，例如 bitcoin ETF；按相关度排，不按时间。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| summary | 文章摘要（一两句话），不是全文；全文看 url。 |
| source | 发布媒体名（大写，如 COINDESK、AMBCRYPTO）。 |
| url | 原文链接。 |
| published_at | 发布时间，ISO 8601 UTC。 |
| project_name | 文章关联的项目或主题名（如 Bitcoin、Ethereum）；没关联时没有。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "crypto_news",
  "action": "search",
  "params": {
    "keyword": "bitcoin ETF"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "crypto_news",
        "action": "search",
        "params": {
            "keyword": "bitcoin ETF",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "crypto_news",
  "action": "search",
  "results": [
    {
      "title": …,
      "summary": …,
      "source": …,
      "url": …,
      "published_at": …,
      "project_name": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `keyword` 有什么限制？

长度 2–100 字，例如 bitcoin ETF。它搜的是新闻，也没有按媒体或项目筛选的参数；想缩小范围，就把项目名和事件名一起写进词里。

### 怎么拿到最新的报道？

搜索结果按相关度排，不按时间，所以要按 `published_at` 自己排序；或者改用信息流，它按发布时间从新到旧，还可以只看一家媒体。两页返回的字段完全相同。

### `project_name` 为空是出错了吗？

不是。文章没有关联项目或主题时，这个字段整个没有；有值时是项目或主题名，例如 Bitcoin、Ethereum。读取时按缺省处理就行，按 `project_name` 分组还能看出结果主要落在哪几个项目上。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=crypto_news
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
