CEX APIcex.io ↗
Access CEX.io market data via API: live tickers, order books, trade history, OHLCV candles, and spot pair info for BTC, ETH, and more.
What is the CEX API?
This API exposes 7 endpoints covering CEX.io cryptocurrency market data, from real-time price snapshots to full order book depth. The get_ticker endpoint returns last price, bid, ask, 24h high/low, and volume for any trading pair, while get_ohlcv delivers 1-minute, 1-hour, and 1-day candlestick arrays for completed historical dates. Both the legacy REST and newer Spot Trading APIs are represented.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/1dd8fdd2-c4cf-435c-94b9-f27cfe6abb11/get_prices' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace cex-io-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""CEX.io Market Data API - Usage Example
Get your API key from: https://parse.bot/settings
"""
from parse_apis.cex_io_market_data_api import (
CexIo, Symbol1, Symbol2, Pair, PairNotFound,
)
client = CexIo()
# List current token prices — quick market snapshot
for token in client.tokenprices.list(limit=5):
print(token.base_name, token.price, token.change)
# Get legacy ticker for BTC/USD — last price, bid/ask, and 24h range
ticker = client.tickers.get(symbol1=Symbol1.BTC, symbol2=Symbol2.USD)
print(ticker.pair, ticker.last, ticker.bid, ticker.ask)
# Fetch order book depth for ETH/EUR
book = client.orderbooks.get(symbol1=Symbol1.ETH, symbol2=Symbol2.EUR, depth=10)
print(book.pair, "bids:", len(book.bids), "asks:", len(book.asks))
# Recent trades for XRP/USD
for trade in client.trades.list(symbol1=Symbol1.XRP, symbol2=Symbol2.USD, limit=3):
print(trade.tid, trade.type, trade.price, trade.amount)
# Spot ticker for a specific pair — typed error handling
try:
spot = client.spottickers.get(pair=Pair.BTC_USD)
print(spot.pair, spot.last, spot.volume_usd)
except PairNotFound as exc:
print(f"Pair not found: {exc.symbol1}/{exc.symbol2}")
print("exercised: tokenprices.list / tickers.get / orderbooks.get / trades.list / spottickers.get")
Retrieve current prices and market caps for all supported tokens as a quick snapshot from the marketing API. Returns one entry per base currency with its USD price, 24h change percentage, and market capitalization. No filtering or pagination - the full list is returned in a single response.
No input parameters required.
{
"type": "object",
"fields": {
"items": "array of token price objects with price, change, quote, baseName, base, and marketCap"
},
"sample": {
"data": {
"items": [
{
"base": "BTC",
"price": 62187.6,
"quote": "USD",
"change": 0.87,
"baseName": "Bitcoin",
"marketCap": 1244623751475
}
]
},
"status": "success"
}
}About the CEX API
Market Data Coverage
The API spans two generations of CEX.io market data endpoints. The legacy REST layer handles get_ticker, get_order_book, get_trade_history, and get_ohlcv. The Spot Trading layer adds get_spot_pairs_info and get_spot_ticker, which use a BASE-QUOTE pair format (e.g. BTC-USD) and return fields like bestBid, bestAsk, volumeUSD, and priceChangePercentage. A separate get_prices endpoint returns a flat snapshot of all supported tokens with price, marketCap, change, base, and baseName fields — useful for a quick cross-market scan without specifying a pair.
Order Books and Trade History
get_order_book accepts symbol1, symbol2, and an optional depth integer to cap the number of bid/ask levels returned. The response includes bids and asks as [price, amount] arrays alongside sell_total and buy_total aggregate figures. get_trade_history returns recent fills in reverse chronological order, each with type (buy or sell), date as a Unix timestamp string, amount, price, and a tid transaction ID. The since parameter accepts a tid to page through history, but note that tid values are pair-specific and non-transferable across pairs.
OHLCV Candles
get_ohlcv takes a date in YYYYMMDD format and a trading pair. It returns three candle resolutions in the same response: data1m, data1h, and a daily candle, each serialized as a JSON string array. The endpoint only returns data for completed historical days — requests for today or very recent dates return empty arrays. Omitting the date parameter defaults to 7 days prior to the current date.
Spot Pairs Metadata
get_spot_pairs_info returns constraint data for all tradeable pairs: baseMin, baseMax, baseLotSize, quoteMin, quoteMax, and precision settings. This is useful for validating order sizes before submitting trades or for building pair selection interfaces that respect exchange minimums.
The CEX API is a managed, monitored endpoint for cex.io — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when cex.io changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official cex.io API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Displaying a live BTC-USD price ticker with bid, ask, and 24h change using
get_ticker - Visualizing order book depth charts from
get_order_bookbids and asks arrays - Backtesting trading strategies against 1-minute OHLCV candles from
get_ohlcv - Building a market cap dashboard using
marketCapandpricefields fromget_prices - Monitoring recent fill activity and trade direction (buy/sell) via
get_trade_history - Validating order size constraints before execution using
baseMin/baseMaxfromget_spot_pairs_info - Aggregating spread data across all pairs using
bestBidandbestAskfromget_spot_ticker
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does CEX.io have an official developer API?+
What does `get_ohlcv` return and what are its date constraints?+
get_ohlcv returns three candle resolutions — data1m (1-minute), data1h (1-hour), and daily — all in a single response for the specified trading pair and date. The date parameter must be in YYYYMMDD format and must refer to a fully completed historical day. Requests for today's date or very recent dates return empty data arrays.Are `tid` values from `get_trade_history` usable across different trading pairs?+
since parameter accepts a tid to retrieve trades after a specific transaction, but tid values are pair-specific. A tid obtained from BTC-USD trade history cannot be used to page through ETH-USD history and will not return the expected results.Does this API cover authenticated endpoints like order placement or account balances?+
Can I retrieve OHLCV data for candle intervals other than 1-minute and 1-hour?+
get_ohlcv endpoint returns 1-minute (data1m), 1-hour (data1h), and 1-day candles in each response. Other intervals such as 4-hour or 15-minute candles are not currently returned. You can fork this API on Parse and revise it to derive or aggregate additional intervals from the available 1-minute data.