接入教程
GET https://api.coinpaprika.com/v1/tickers/btc-bitcoin1. 无需密钥直接调用:
2. 全部币种列表:/v1/coins。
3. 历史K线:/v1/coins/btc-bitcoin/ohlcv/historical。
4. 交易所:/v1/exchanges。
5. 免费每月20000次,超出需注册获取更高额度。
Python 查询BTC行情
python
import requests
r = requests.get("https://api.coinpaprika.com/v1/tickers/btc-bitcoin")
d = r.json()
print(d["name"], d["quotes"]["USD"]["price"])
PHP 查询BTC行情
php
<?php
$d = json_decode(file_get_contents("https://api.coinpaprika.com/v1/tickers/btc-bitcoin"), true);
echo $d["quotes"]["USD"]["price"];
JavaScript 查询BTC行情
javascript
const d = await fetch("https://api.coinpaprika.com/v1/tickers/btc-bitcoin").then(r => r.json());
console.log(d.quotes.USD.price);
常见问题
免费额度是多少?
每月20000次调用,无需API Key;更高额度需注册。
历史数据多长?
提供最长15年的日线历史数据,可通过OHLCV历史端点查询。
Aitishiku.com