Prices
The Price Aggregation service provides aggregated cryptocurrency prices from multiple providers. Prices are calculated using median values with outlier filtering — prices more than 50% away from the initial median are excluded.
The price model
Each price response includes the aggregated median price along with min/max bounds and the number of contributing providers.
Properties
- Name
symbol- Type
- string
- Description
The cryptocurrency ticker symbol.
- Name
price- Type
- number
- Description
The median aggregated price across all providers.
- Name
providers- Type
- integer
- Description
Number of providers contributing to the aggregation.
- Name
min- Type
- number
- Description
Lowest price across all providers.
- Name
max- Type
- number
- Description
Highest price across all providers.
- Name
median- Type
- number
- Description
Median price (same as
price).
- Name
timestamp- Type
- string
- Description
ISO 8601 timestamp of the aggregation.
Get price for symbol
Get the aggregated price for a specific cryptocurrency symbol. The response includes both the aggregated price and individual provider prices.
Path parameters
- Name
symbol- Type
- string
- Description
Cryptocurrency symbol (e.g.,
"BTC","ETH").
Optional attributes
- Name
region- Type
- string
- Description
Filter providers by region (e.g.,
"US","AU"). Only providers available in the specified region are included in the aggregation.
Request
curl https://api.bitcompare.net/api/v1/prices/BTC
Response
{
"data": {
"symbol": "BTC",
"aggregated": {
"symbol": "BTC",
"price": 45000.50,
"providers": 3,
"min": 44950.00,
"max": 45100.00,
"median": 45000.50,
"timestamp": "2025-10-29T14:00:00Z"
},
"providers": [
{
"provider": "binance",
"symbol": "BTC",
"price": 45000.00,
"category": "price",
"updated_at": "2025-10-29T13:59:00Z"
},
{
"provider": "coinbase",
"symbol": "BTC",
"price": 45100.00,
"category": "price",
"updated_at": "2025-10-29T13:58:00Z"
},
{
"provider": "kraken",
"symbol": "BTC",
"price": 44950.00,
"category": "price",
"updated_at": "2025-10-29T13:57:00Z"
}
]
}
}
Get price summary
Get aggregated prices for all tracked symbols in a single request. Returns a map of symbol to price data.
Request
curl https://api.bitcompare.net/api/v1/prices/summary
Response
{
"data": {
"prices": {
"BTC": {
"symbol": "BTC",
"price": 45000.50,
"providers": 3,
"min": 44950.00,
"max": 45100.00,
"median": 45000.50,
"timestamp": "2025-10-29T14:00:00Z"
},
"ETH": {
"symbol": "ETH",
"price": 2500.75,
"providers": 3,
"min": 2495.00,
"max": 2510.00,
"median": 2500.75,
"timestamp": "2025-10-29T14:00:00Z"
}
},
"count": 2,
"timestamp": "2025-10-29T14:00:00Z"
}
}
WebSocket stream
Connect to the WebSocket endpoint for real-time price updates. Prices are broadcast every ~1 second when changes are detected.
See the WebSockets guide for connection details, message types, and reconnection strategies.
Connection
const ws = new WebSocket('wss://api.bitcompare.net/api/v1/prices/ws')
ws.addEventListener('message', (event) => {
const message = JSON.parse(event.data)
if (message.type === 'price_update') {
console.log('Updated prices:', message.data)
}
})
price_update message
{
"type": "price_update",
"data": [
{
"symbol": "BTC",
"price": 45050.25,
"volume": 12345,
"timestamp": 1730212801000,
"source": "binance",
"changePercent": 0.11,
"previousPrice": 45000.50
}
],
"timestamp": "2025-10-29T14:00:01Z"
}