Currencylayer
汇率和货币转换
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 汇率
简介
Currencylayer(APILayer 产品)提供 168 种货币的实时和历史汇率。认证是免费 API 密钥——与其他 APILayer API 一样,无效密钥返回 HTTP 200 且 "success": false(已实测)。
快速开始
实时汇率(替换 YOUR_KEY):
curl "http://api.currencylayer.com/live?access_key=YOUR_KEY¤cies=USD,CNY"
{
"success": true,
"timestamp": 1724300000,
"source": "USD",
"quotes": { "USDUSD": 1, "USDCNY": 7.2 }
}
历史数据:
curl "http://api.currencylayer.com/historical?access_key=YOUR_KEY&date=2024-01-01"
换算:
curl "http://api.currencylayer.com/convert?access_key=YOUR_KEY&from=USD&to=CNY&amount=100"
认证方式
- 在 currencylayer.com 注册 → 免费 API 密钥(邮件发送)。
- 通过
access_key查询参数携带。 - 无效密钥返回 200 +
"success": false(已实测)——请检查 JSON。
速率限制与注意事项
- 免费层:100 次请求/月(仅 USD 源)——额度小;付费档可扩展。
- 免费层源货币是 USD;
currencies=精简响应。 - API 走 http(部分档位 https 付费)——可用时用 https。
- 历史和换算端点在付费档(免费层仅实时)。
常见问题
Currencylayer 免费吗? 免费层:100 次/月;更多需要付费。
为什么 200 但 success:false?
APILayer 惯例——请检查响应体的 success 字段。
免费源货币是什么? USD。
汇率 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 1Forge Forex currency market data | API Key | Yes | Unknown | ↗ |
| Amdoren Free currency API with over 150 currencies | API Key | Yes | Unknown | ↗ |
| Bank of Russia Exchange rates and currency conversion | No auth | Yes | Unknown | ↗ |
| Currency-api Free Currency Exchange Rates API with 150+ Currencies & No Rate Limits | No auth | Yes | Yes | ↗ |
| CurrencyFreaks Provides current and historical currency exchange rates with free plan 1K requests/month | API Key | Yes | Yes | ↗ |