# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/cex-io/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/cex-io/get-ohlcv \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-order-book \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-prices \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-spot-pairs-info \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-spot-ticker \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-ticker \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/cex-io/get-trade-history \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"since":"<string>","symbol1":"<string>","symbol2":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.