Market Data API
Get real-time market data including prices, order books, and trading pair information.
Higher Rate Limit
Market data endpoints have a higher rate limit of 30 requests/second compared to other endpoints.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET /api/sdk/market-data/prices | Get prices for all or specific assets | |
| GET /api/sdk/market-data/prices/:asset | Get price for a single asset | |
| GET /api/sdk/market-data/orderbook/:asset | Get order book for an asset | |
| GET /api/sdk/market-data/orderbooks | Get order books for multiple assets | |
| GET /api/sdk/market-data/trading-pairs | Get available trading pairs | |
| GET /api/sdk/market-data/stats/24h | Get 24-hour statistics |
The Price Object
{
"asset": "BTC",
"bid": 49950.00,
"ask": 50050.00,
"mid": 50000.00,
"last": 50010.00,
"change24h": 2.5,
"volume24h": 1250.5,
"high24h": 51000.00,
"low24h": 48500.00,
"updatedAt": "2024-01-15T10:30:00.000Z"
}
Attributes
| Attribute | Type | Description |
|---|---|---|
asset | string | Asset symbol |
bid | number | Best bid price |
ask | number | Best ask price |
mid | number | Mid price ((bid + ask) / 2) |
last | number | Last trade price |
change24h | number | 24-hour price change percentage |
volume24h | number | 24-hour trading volume |
high24h | number | 24-hour high price |
low24h | number | 24-hour low price |
updatedAt | string | Last update timestamp |
Get Prices
Get current prices for all assets or specific assets.
GET /api/sdk/market-data/prices
Required Scope: READ
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
assets | string | No | Comma-separated list of asset symbols |
Example Request
# Get all prices
curl -X GET https://api.zenotc.com/api/sdk/market-data/prices \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
# Get specific assets
curl -X GET "https://api.zenotc.com/api/sdk/market-data/prices?assets=BTC,ETH,SOL" \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
# Get all prices
prices = api_request("GET", "/api/sdk/market-data/prices")
# Get specific assets
prices = api_request("GET", "/api/sdk/market-data/prices?assets=BTC,ETH,SOL")
Response
{
"prices": [
{
"asset": "BTC",
"bid": 49950.00,
"ask": 50050.00,
"mid": 50000.00,
"last": 50010.00,
"change24h": 2.5,
"volume24h": 1250.5,
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"asset": "ETH",
"bid": 2495.00,
"ask": 2505.00,
"mid": 2500.00,
"last": 2502.00,
"change24h": 1.8,
"volume24h": 15000.0,
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]
}
Get Asset Price
Get the current price for a single asset.
GET /api/sdk/market-data/prices/:asset
Required Scope: READ
Path Parameters
| Parameter | Type | Description |
|---|---|---|
asset | string | Asset symbol (e.g., BTC) |
Example Request
curl -X GET https://api.zenotc.com/api/sdk/market-data/prices/BTC \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
price = api_request("GET", "/api/sdk/market-data/prices/BTC")
Response
Returns a single Price object.
Errors
| Code | Description |
|---|---|
| 404 | Asset not found |
Get Order Book
Get the order book for an asset.
GET /api/sdk/market-data/orderbook/:asset
Required Scope: READ
Path Parameters
| Parameter | Type | Description |
|---|---|---|
asset | string | Asset symbol |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
depth | integer | 10 | Number of price levels (1-50) |
Example Request
curl -X GET "https://api.zenotc.com/api/sdk/market-data/orderbook/BTC?depth=10" \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
orderbook = api_request("GET", "/api/sdk/market-data/orderbook/BTC?depth=10")
Response
{
"asset": "BTC",
"bids": [
{"price": 49950.00, "quantity": 5.0},
{"price": 49900.00, "quantity": 10.0},
{"price": 49850.00, "quantity": 8.5},
{"price": 49800.00, "quantity": 12.0},
{"price": 49750.00, "quantity": 6.0}
],
"asks": [
{"price": 50050.00, "quantity": 5.0},
{"price": 50100.00, "quantity": 8.0},
{"price": 50150.00, "quantity": 7.5},
{"price": 50200.00, "quantity": 15.0},
{"price": 50250.00, "quantity": 4.0}
],
"timestamp": "2024-01-15T10:30:00.000Z"
}
Order Book Entry
| Attribute | Type | Description |
|---|---|---|
price | number | Price level |
quantity | number | Total quantity at this price |
Get Multiple Order Books
Get order books for multiple assets in a single request.
GET /api/sdk/market-data/orderbooks
Required Scope: READ
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
assets | string | Yes | Comma-separated list of asset symbols |
depth | integer | No | Number of price levels (default 10) |
Example Request
curl -X GET "https://api.zenotc.com/api/sdk/market-data/orderbooks?assets=BTC,ETH&depth=5" \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
orderbooks = api_request("GET", "/api/sdk/market-data/orderbooks?assets=BTC,ETH&depth=5")
Response
{
"orderbooks": {
"BTC": {
"asset": "BTC",
"bids": [
{"price": 49950.00, "quantity": 5.0}
],
"asks": [
{"price": 50050.00, "quantity": 5.0}
],
"timestamp": "2024-01-15T10:30:00.000Z"
},
"ETH": {
"asset": "ETH",
"bids": [
{"price": 2495.00, "quantity": 50.0}
],
"asks": [
{"price": 2505.00, "quantity": 50.0}
],
"timestamp": "2024-01-15T10:30:00.000Z"
}
}
}
Get Trading Pairs
Get all available trading pairs and their specifications.
GET /api/sdk/market-data/trading-pairs
Required Scope: READ
Example Request
curl -X GET https://api.zenotc.com/api/sdk/market-data/trading-pairs \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
pairs = api_request("GET", "/api/sdk/market-data/trading-pairs")
Response
{
"pairs": [
{
"base": "BTC",
"quote": "USD",
"symbol": "BTC-USD",
"minQuantity": 0.001,
"maxQuantity": 100.0,
"quantityStep": 0.001,
"minPrice": 0.01,
"priceStep": 0.01,
"minNotional": 10.0,
"status": "active"
},
{
"base": "ETH",
"quote": "USD",
"symbol": "ETH-USD",
"minQuantity": 0.01,
"maxQuantity": 1000.0,
"quantityStep": 0.01,
"minPrice": 0.01,
"priceStep": 0.01,
"minNotional": 10.0,
"status": "active"
}
]
}
Trading Pair Attributes
| Attribute | Type | Description |
|---|---|---|
base | string | Base asset symbol |
quote | string | Quote asset symbol |
symbol | string | Trading pair symbol |
minQuantity | number | Minimum order quantity |
maxQuantity | number | Maximum order quantity |
quantityStep | number | Quantity increment |
minPrice | number | Minimum price |
priceStep | number | Price increment |
minNotional | number | Minimum order value |
status | string | active or inactive |
Get 24h Statistics
Get 24-hour trading statistics.
GET /api/sdk/market-data/stats/24h
Required Scope: READ
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
asset | string | No | Filter by asset symbol |
Example Request
# Get stats for all assets
curl -X GET https://api.zenotc.com/api/sdk/market-data/stats/24h \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
# Get stats for specific asset
curl -X GET "https://api.zenotc.com/api/sdk/market-data/stats/24h?asset=BTC" \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
stats = api_request("GET", "/api/sdk/market-data/stats/24h")
btc_stats = api_request("GET", "/api/sdk/market-data/stats/24h?asset=BTC")
Response
{
"stats": [
{
"asset": "BTC",
"open": 49000.00,
"high": 51000.00,
"low": 48500.00,
"close": 50000.00,
"volume": 1250.5,
"volumeUsd": 62525000.00,
"trades": 847,
"change": 1000.00,
"changePercent": 2.04,
"vwap": 49850.00
},
{
"asset": "ETH",
"open": 2450.00,
"high": 2550.00,
"low": 2400.00,
"close": 2500.00,
"volume": 15000.0,
"volumeUsd": 37500000.00,
"trades": 1523,
"change": 50.00,
"changePercent": 2.04,
"vwap": 2480.00
}
]
}
Statistics Attributes
| Attribute | Type | Description |
|---|---|---|
asset | string | Asset symbol |
open | number | Opening price (24h ago) |
high | number | Highest price in 24h |
low | number | Lowest price in 24h |
close | number | Current/closing price |
volume | number | Trading volume in base asset |
volumeUsd | number | Trading volume in USD |
trades | number | Number of trades |
change | number | Price change |
changePercent | number | Price change percentage |
vwap | number | Volume-weighted average price |