日内汇率 API
通过 REST 获取支持货币对带时间戳的市场观测。15 分钟 USD/JPY 需 Pro API 密钥。
试用 15 分钟 USD/JPY 观测
curl "https://api.exchangerate.dev/v1/timeseries?base=USD&symbols=JPY&interval=15m&from=2026-09-14T12:00:00Z&to=2026-09-14T12:00:00Z" -H "Authorization: Bearer YOUR_API_KEY"{
"result": "success",
"base": "USD",
"symbols": ["JPY"],
"interval": "15m",
"from": "2026-09-14T12:00:00Z",
"to": "2026-09-14T12:00:00Z",
"data": [{
"timestamp": "2026-09-14T12:00:00Z",
"effective_at": { "JPY": "2026-09-14T12:14:58.972181Z" },
"rates": { "JPY": 154.582 },
"source": "live",
"source_type": "market",
"market_session": "open",
"derived_symbols": []
}],
"next_cursor": null,
"has_more": false,
"notice": "Indicative rates, not for settlement."
}固定示例于 2026-09-15 核实,来自 2026-09-14 12:00 UTC 时段。汇率仅供参考。timestamp 是时段起点;effective_at 是观测时间。
间隔与可用历史
/v1/timeseries 支持 1m、5m、15m、1h、4h 和日参考数据 1d,不支持 2h。不含 USD 的 SGD 交叉盘不支持 4h;USD/SGD 及反向支持。市场数据从 2026-09-14 开始采集。1m 保留 30 天,更大间隔没有计划到期删除。保留期限不代表已经积累了同样长度的历史。
| interval | 唯一货币对 | 单次请求最长时间 |
|---|---|---|
1m | 221 | 7 d |
5m | 221 | 31 d |
15m | 221 | 93 d |
1h | 221 | 366 d |
4h | 209 | 1830 d |
1d | 10296 | 1830 d |
缺失观测和交叉盘
历史交叉盘要求真实收盘观测位于同一 UTC 区间内,时间差不超过 5 秒。effective_at 使用较早的观测时间。不填补缺口;尚未结束的区间可能变化。1d 使用全目录的日参考数据。表中每个货币对只计一次,支持双向。
支持的时间窗口没有观测时返回 HTTP 200,包含 data: []、has_more: false 和 next_cursor: null。未知间隔返回 unsupported_interval;范围外货币对返回 unsupported_pair_interval 和 rejected_pairs(HTTP 400)。混合请求会整体拒绝。
身份验证与商业使用
数据接口支持匿名试用:每个 IP 每分钟 10 次、每小时 100 次。带密钥的请求使用账户月度额度。
| 计划 | 每月请求数 | 商业使用 |
|---|---|---|
| Free | 5,000 | 显示需附署名链接 |
| Basic | 100,000 | 是 |
| Plus | 300,000 | 是 |
| Pro | 1,000,000 | 是 |