# P2B Exchange API
> Live spot market data from P2B (p2pb2b.com), a global crypto exchange, served straight from its public order books — no key on the data, nothing cached, nothing stored. Look up any market for its last price, best bid/ask and spread, 24h high/low, 24h change and base/quote volume; rank every spot market for a quote currency (USDT, BTC, ETH…) by 24h quote volume; list the tradable pairs with their base/quote and price precision; or pull live order-book depth with the running spread. Markets are addressed P2B-style as BTC_USDT (base and quote separated by an underscore). This is the P2B venue specifically — a distinct global exchange feed, separate from the other exchange APIs in the catalogue, so cross-venue arbitrage and price-discovery workflows can read each book on its own terms.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/p2b-api/..."
```

## Pricing
- **Free** (Free) — 18,000 calls/Mo, 3 req/s
- **Starter** ($9/Mo) — 240,000 calls/Mo, 10 req/s
- **Growth** ($25/Mo) — 1,150,000 calls/Mo, 25 req/s
- **Scale** ($59/Mo) — 4,200,000 calls/Mo, 50 req/s

## Endpoints

### Ticker

#### `GET /v1/ticker` — Ticker for one market

**Parameters:**
- `market` (query, optional, string) — Market as BTC_USDT Example: `BTC_USDT`
- `symbol` (query, optional, string) — Base asset (with quote=) Example: `ETH`
- `quote` (query, optional, string) — Quote asset Example: `USDT`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/p2b-api/v1/ticker?market=BTC_USDT&symbol=ETH&quote=USDT"
```

**Response:**
```json
{
    "data": {
        "ask": 62730.56,
        "bid": 62730.55,
        "base": "BTC",
        "last": 62730.56,
        "quote": "USDT",
        "market": "BTC_USDT",
        "source": "P2B",
        "spread": 0.01,
        "low_24h": 60783.62,
        "high_24h": 62996.51,
        "open_24h": 61716.02,
        "change_24h": 1014.54,
        "change_24h_pct": 1.64,
        "base_volume_24h": 2538.027895,
        "quote_volume_24h": 157185057
    },
    "meta": {
        "timestamp": "2026-06-11T07:48:53.414Z",
        "request_id": "1cffebb1-112c-47a3-9aeb-4c3b34fe53f8"
    },
    "status": "ok",
    "message": "Ticker retrieved successfully",
    "success": true
}
```

### Tickers

#### `GET /v1/tickers` — All markets for a quote ranked by 24h quote volume

**Parameters:**
- `quote` (query, optional, string) — Quote asset Example: `USDT`
- `limit` (query, optional, string) — Max results (1-400) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/p2b-api/v1/tickers?quote=USDT&limit=50"
```

**Response:**
```json
{
    "data": {
        "count": 119,
        "quote": "USDT",
        "source": "P2B",
        "tickers": [
            {
                "ask": 62730.56,
                "bid": 62722.38,
                "base": "BTC",
                "last": 62722.6,
                "quote": "USDT",
                "market": "BTC_USDT",
                "spread": 8.18,
                "low_24h": 60783.62,
                "high_24h": 62996.51,
                "open_24h": null,
                "change_24h": null,
                "change_24h_pct": 1.65,
                "base_volume_24h": 2538.036975,
                "quote_volume_24h": 157185686.71
            },
            {
                "ask": 4110.62,
                "bid": 4110.6,
                "base": "PAXG",
                "last": 4110.61,
                "quote": "USDT",
                "market": "PAXG_USDT",
                "spread": 0.02,
                "low_24h": 4026.92,
                "high_24h": 4191.61,
                "open_24h": null,
                "change_24h": null,
                "change_24h_pct": -1.91,
                "base_volume_24h": 25838.9814,
                "quote_volume_24h": 106367052.36
            },
            {
                "ask": 1654.19,
                "bid": 1654.18,
                "base": "ETH",
                "last": 1654.19,
                "quote": "USDT",
                "market": "ETH_USDT",
                "spread": 0.01,
                "low_24h": 1604.65,
                "high_24h
…(truncated, see openapi.json for full schema)
```

### Markets

#### `GET /v1/markets` — Tradable pairs with base/quote and precision

**Parameters:**
- `quote` (query, optional, string) — Filter by quote asset Example: `USDT`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/p2b-api/v1/markets?quote=USDT"
```

**Response:**
```json
{
    "data": {
        "count": 119,
        "quote": "USDT",
        "source": "P2B",
        "markets": [
            {
                "base": "1INCH",
                "quote": "USDT",
                "market": "1INCH_USDT",
                "base_precision": 1,
                "quote_precision": 4
            },
            {
                "base": "AAVE",
                "quote": "USDT",
                "market": "AAVE_USDT",
                "base_precision": 3,
                "quote_precision": 2
            },
            {
                "base": "AI4",
                "quote": "USDT",
                "market": "AI4_USDT",
                "base_precision": 1,
                "quote_precision": 8
            },
            {
                "base": "AIGENSYN",
                "quote": "USDT",
                "market": "AIGENSYN_USDT",
                "base_precision": 0,
                "quote_precision": 5
            },
            {
                "base": "ALPINE",
                "quote": "USDT",
                "market": "ALPINE_USDT",
                "base_precision": 2,
                "quote_precision": 4
            },
            {
                "base": "ALT",
                "quote": "USDT",
                "market": "ALT_USDT",
                "base_precision": 1,
                "quote_precision": 5
            },
            {
                "base": "APE",
                "quote": "USDT",
                "market": "APE_USDT",
                "base_p
…(truncated, see openapi.json for full schema)
```

### Book

#### `GET /v1/book` — Live order-book depth with running spread

**Parameters:**
- `market` (query, optional, string) — Market as BTC_USDT Example: `ETH_USDT`
- `limit` (query, optional, string) — Depth per side (1-100) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/p2b-api/v1/book?market=ETH_USDT&limit=20"
```

**Response:**
```json
{
    "data": {
        "asks": [
            {
                "price": 1654.08,
                "amount": 12.8372
            },
            {
                "price": 1654.13,
                "amount": 11.9086
            },
            {
                "price": 1654.24,
                "amount": 9.956
            },
            {
                "price": 1654.32,
                "amount": 9.2752
            },
            {
                "price": 1654.38,
                "amount": 7.5578
            },
            {
                "price": 1654.42,
                "amount": 13.3133
            },
            {
                "price": 1654.5,
                "amount": 9.4647
            },
            {
                "price": 1654.63,
                "amount": 7.949
            },
            {
                "price": 1654.67,
                "amount": 11.22
            },
            {
                "price": 1654.83,
                "amount": 8.0527
            },
            {
                "price": 1654.88,
                "amount": 8.1744
            },
            {
                "price": 1654.92,
                "amount": 11.6932
            },
            {
                "price": 1655.05,
                "amount": 10.3357
            },
            {
                "price": 1655.13,
                "amount": 11.342
            },
            {
                "price": 1655.24,
                "amount": 8.5415
            },
            {
           
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/p2b-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Pass markets as BTC_USDT (base and quote separated by '_'). 24h change is derived from the day's open price. quote_volume_24h is in the quote currency.",
        "source": "P2B public API (api.p2pb2b.com/api/v2/public, live)",
        "service": "p2b-api",
        "endpoints": {
            "GET /v1/book": "Live order-book depth — best bid/ask and spread (market=BTC_USDT, limit=20).",
            "GET /v1/meta": "This document.",
            "GET /v1/ticker": "Ticker for one market (market=BTC_USDT or symbol=BTC&quote=USDT).",
            "GET /v1/markets": "Tradable pairs with base/quote and precision (quote=USDT optional).",
            "GET /v1/tickers": "All spot markets for a quote ranked by 24h quote volume (quote=USDT, limit=50)."
        },
        "description": "Live spot market data from P2B (p2pb2b.com), a global crypto exchange. The ticker endpoint returns a market's last price, best bid/ask, 24h high/low, 24h change and base/quote volume; the tickers endpoint ranks every spot market for a quote currency by 24h quote volume; the markets endpoint lists tradable pairs with base/quote and precision; the book endpoint returns live order-book depth. Live, no key, nothing stored. A distinct global venue, separate from other exchange feeds.",
        "market_count": 181,
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-11T07:48:53.859Z",
        "request_id": "04baccea-5163-44b3-9db1-f532df702654"
    
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/p2b-api
OpenAPI spec: https://www.oanor.com/api/p2b-api/openapi.json
