# Yahoo Finance 关键词搜索 API (yahoo_finance.search)

- Canonical page: https://everyinfra.com/yahoo-finance-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "yahoo_finance", "action": "search", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Billing unit: each element in `tickers` counts as one call; the number of elements you send sets the charge
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | Yahoo Finance 标的代码，例如 AAPL；不是公司名全文搜索，市场后缀须保留。search 返回报价与基本面，不是新闻或公司名搜索。 |
| tickers | not declared | no | not declared | 标的代码数组，存在时覆盖 keyword 的单目标输入；该数组不会应用到 history 等其他 action，建议明确使用大写代码及正确交易所后缀。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| symbol | 股票代码。 |
| sector | 所属板块。 |
| industry | 所属行业。 |
| market_cap | 市值。 |
| price | 价格数值，不含货币符号；币种见 currency。 |
| currency | 价格币种代码（如 CNY、USD）。price 存在但 currency 为 null 时不要假定币种。 |
| quote_type | 标的类型（股票 / ETF / 指数 / 加密货币等）。 |
| exchange | 所属交易所。 |
| pe_ratio | 市盈率。 |
| dividend_yield | 股息率。 |
| 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": "yahoo_finance",
  "action": "search",
  "params": {
    "keyword": "AAPL"
  }
}'
```

```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": "yahoo_finance",
        "action": "search",
        "params": {
            "keyword": "AAPL",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "yahoo_finance",
  "action": "search",
  "results": [
    {
      "id": "AAPL",
      "name": "Apple Inc.",
      "symbol": "AAPL",
      "sector": "Technology",
      "industry": "Consumer Electronics",
      "market_cap": 4977636933632,
      "price": 341.07,
      "quote_type": "EQUITY",
      "pe_ratio": 39.068733,
      "dividend_yield": 0.32,
      "platform": "yahoo_finance"
    }
  ],
  "count": 1,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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