# 简单价格

**API:** Data API

**Endpoint:** `GET /v1/beta/coingecko/simple/price`

**Tags:** CoinGecko

字段名由计价货币构成——将 `vs_currencies` 设为 usd 时会得到 `usd`，并在设置对应的 `include_market_cap`、`include_24hr_vol`、`include_24hr_change` 和 `include_last_updated_at` 标志后，额外得到 `usd_market_cap`、`usd_24h_vol`、`usd_24h_change` 和 `last_updated_at`。当已知 id 且只需要当前数字时使用。需要排名、供应量或历史最高价数据时，请使用 `get_coingecko_coins_markets`；如果持有合约地址而非 id，请使用 `get_coingecko_simple_token_price_id`。

### 计费参考

- 计量方式：套餐资源单位。
- 参考请求估算：0.008 美元。
- 单位成本基准：0.0 美元。
- 资源单位：`provider_credit`。
- 成本基准不构成最终客户价格，即使为零也不例外。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `ids` | query | no | string, default: "bitcoin" | 代币 ID，查询多个代币时以逗号分隔。 *参见 [`/coins/list`](/reference/coins-list) |
| `include_24hr_change` | query | no | boolean | 包含 24 小时涨跌幅。 默认值：false |
| `include_24hr_vol` | query | no | boolean | 包含 24 小时交易量。 默认值：false |
| `include_last_updated_at` | query | no | boolean | 包含最后更新价格时间（UNIX 时间戳）。 默认值：false |
| `include_market_cap` | query | no | boolean | 包含市值。 默认值：false |
| `include_tokens` | query | no | string, enum: "top", "all" | 使用 `symbols` 查询时，指定 `all` 可包含所有匹配的代币。 默认的 `top` 返回按市值或成交量排名靠前的代币。 |
| `names` | query | no | string, default: "Bitcoin" | 代币名称，查询多个代币时以逗号分隔。 |
| `precision` | query | no | string, enum: "full", "0", "1", "2", "3", "4", … | 货币价格值的小数位数 |
| `symbols` | query | no | string, default: "btc" | 代币符号，查询多个代币时以逗号分隔。 |
| `vs_currencies` | query | yes | string, default: "usd" | 币种的目标计价货币；查询多个货币时以逗号分隔。 *参见 [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies) |

## Responses

### 200 — 代币价格

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: `Response860C3Ae68Ea5_SimplePrice` (`#/components/schemas/Response860C3Ae68Ea5_SimplePrice`)

Example:

```json
{
  "bitcoin": {
    "usd": 76975,
    "usd_market_cap": 1542226908349.8406,
    "usd_24h_vol": 29096603418.89408,
    "usd_24h_change": -1.4093297098441402,
    "last_updated_at": 1779092258
  }
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response860C3Ae68Ea5_SimplePrice

`#/components/schemas/Response860C3Ae68Ea5_SimplePrice`

```json
{
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "properties": {
      "usd": {
        "type": "number",
        "description": "目标货币下的价格"
      },
      "usd_market_cap": {
        "type": "number",
        "description": "目标货币下的市值"
      },
      "usd_24h_vol": {
        "type": "number",
        "description": "目标货币下的 24 小时交易量"
      },
      "usd_24h_change": {
        "type": "number",
        "description": "目标货币下的 24 小时价格涨跌幅"
      },
      "last_updated_at": {
        "type": "number",
        "description": "最后更新时间戳（UNIX 秒）"
      }
    }
  }
}
```
