Stream real-time market prices into your app in minutes
With just a few lines of code, you can pull live BTC/USD rates, or any of thousands of crypto and fiat pairs, directly into your trading bot, dashboard, or analytics tool.
Instant access to aggregated data from hundreds of exchanges
Ultra-low latency and enterprise-grade reliability
Flexible formats (JSON, CSV, XML) and multiple protocols (REST, WebSocket, FIX)
Developer-first: simple authentication, rich metadata, and consistent symbology
CoinAPIās Market Data API delivers normalized, high-quality market data you can trust.
See documentationGet the latest BTC/USD exchange rate.
Real-Time Trades (WebSocket) ā streaming feed for trading bots & dashboards
Historical OHLCV Data (REST) ā perfect for backtesting & analytics
1import requests
2
3url = "https://rest.coinapi.io/v1/exchangerate/BTC/USD"
4headers = {"X-CoinAPI-Key": "YOUR_API_KEY"}
5
6response = requests.get(url, headers=headers)
7data = response.json()
8
9print(f"Time: {data['time']}")
10print(f"Base: {data['asset_id_base']}")
11print(f"Quote: {data['asset_id_quote']}")
12print(f"Rate: {data['rate']}")
13