# CEX.IO — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access real-time cryptocurrency market data from CEX.io, including live prices, tickers, order books, trade history, and OHLCV candles for spot trading pairs. Monitor market movements and analyze trading opportunities with comprehensive pricing and order depth information across supported cryptocurrencies.

**Category:** Web3 & Onchain | **Website:** [cex.io/](https://cex.io/) | **Docs:** [parse.bot/marketplace/447ccff3-7930-49c6-add5-1ea72d66acb0/cex-io-api](https://parse.bot/marketplace/447ccff3-7930-49c6-add5-1ea72d66acb0/cex-io-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_ohlcv

Fetch OHLCV candlestick data for a trading pair for a specific date. Returns 1-minute, 1-hour, and 1-day candle arrays as JSON strings. Each candle is [timestamp, open, close, low, high, volume]. The date must be a completed historical day; current or very recent dates may return empty data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYYMMDD format. Must be a completed historical day (not today or very recent). Omitting defaults to 7 days ago. |
| `symbol1` | string | No | Base currency symbol (e.g. BTC, ETH, XRP, ADA, DOT, SOL). |
| `symbol2` | string | No | Quote currency symbol (e.g. USD, EUR, GBP, USDT). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_ohlcv \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","symbol1":"<string>","symbol2":"<string>"}'
```

### get_order_book

Fetch the current order book snapshot (bids and asks) for a trading pair from the legacy REST API. Each bid/ask is a [price, amount] pair. Supports depth limiting to control response size.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `depth` | integer | No | Maximum number of bid/ask price levels to return. |
| `symbol1` | string | No | Base currency symbol (e.g. BTC, ETH, XRP, ADA, DOT, SOL). |
| `symbol2` | string | No | Quote currency symbol (e.g. USD, EUR, GBP, USDT). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_order_book \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"depth":"<integer>","symbol1":"<string>","symbol2":"<string>"}'
```

### get_prices

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.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_spot_pairs_info

Get information about all available trading pairs from the Spot Trading API, including minimum/maximum order sizes, lot sizes, and precision settings. Returns the full catalog in a single response with no filtering or pagination.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_spot_pairs_info \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_spot_ticker

Get ticker data for a specific pair from the Spot Trading API. Returns best bid/ask, last price, volume, volume in USD, and 24h price change percentage for the requested trading pair.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `pair` | string | No | Trading pair in BASE-QUOTE format (e.g. BTC-USD, ETH-USD, XRP-USD, ADA-USD). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_spot_ticker \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pair":"<string>"}'
```

### get_ticker

Retrieve current ticker data for a specific trading pair from the legacy REST API. Returns last price, bid, ask, 24h volume, 30d volume, 24h high/low, and price change. The pair is specified by two separate currency symbols.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbol1` | string | No | Base currency symbol (e.g. BTC, ETH, XRP, ADA, DOT, SOL). |
| `symbol2` | string | No | Quote currency symbol (e.g. USD, EUR, GBP, USDT). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_ticker \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol1":"<string>","symbol2":"<string>"}'
```

### get_trade_history

Retrieve recent trade history for a trading pair from the legacy REST API. Returns the most recent trades in reverse chronological order. Each trade includes type (buy/sell), timestamp, amount, price, and a pair-specific transaction ID (tid). Use the tid as the since parameter to paginate forward.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `since` | string | No | Transaction ID (tid) to start from. Returns trades after this tid. Note: tid values are pair-specific and not portable across different trading pairs. |
| `symbol1` | string | No | Base currency symbol (e.g. BTC, ETH, XRP, ADA, DOT, SOL). |
| `symbol2` | string | No | Quote currency symbol (e.g. USD, EUR, GBP, USDT). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cex-io-api-447ccff3/get_trade_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"since":"<string>","symbol1":"<string>","symbol2":"<string>"}'
```
