要获取比特币的实时行情数据,你可以使用一些在线API服务。以下是一些常用的比特币实时行情API接口:
1. CoinGecko API:
网址:https://www.coingecko.com/api/documentations/v3section/daily
示例请求:`GET https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=btc`
返回结果示例:
```json
[
{
"id": "bitcoin",
"symbol": "btc",
"name": "Bitcoin",
"current_price": 19900.57,
"market_cap": 377590710680.6,
"market_cap_rank": 1,
"total_volume": 7959885982.4,
"high_24h": 20075.6,
"low_24h": 19750.1,
"price_change_24h": -0.0125,
"price_change_percentage_24h": -0.064,
"market_cap_change_24h": -2377105222.5,
"market_cap_change_percentage_24h": -0.627,
"circulating_supply": 19084476.8,
"total_supply": 19084476.8,
"max_supply": 21000000,
"last_updated": "2023-03-01T00:03:10.924Z"