Price history

OHLCV candles (1m, 1h or 1d, at most 1,000) for an asset.

# Price history

`GET https://api.rarebl.com/open/market/history`

OHLCV candles for an asset.

**Rate class:** read (5 requests per second, burst 20, per IP). **Available since:** Open API v2.

## Request

Send the parameters as query parameters (GET) or as a JSON object (POST with `Content-Type: application/json`). They are identical either way. No API key is needed: `X-API-KEY` is reserved and ignored.

Example: `curl "https://api.rarebl.com/open/market/history?asset=btc&quote=usd&interval=1h"`

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `asset` | string | Yes | An asset symbol. |
| `quote` | string | No | Quote currency. Default usd. One of: usd, eur, gbp, ghs, ngn. |
| `interval` | string | Yes | Candle size. One of: 1m, 1h, 1d. |
| `from` | string | No | Start time (ISO 8601). |
| `to` | string | No | End time (ISO 8601). |

## Responses

### API200 (HTTP 200): OK

Candles (a real reply).

```json
{
  "status": 1,
  "code": "API200",
  "message": "success",
  "data": {
    "candles": [
      {
        "ts": "2026-11-14T23:00:00.000Z",
        "open": "64136.4",
        "high": "64174.2",
        "low": "64068.4",
        "close": "64139.5",
        "volume": null
      },
      {
        "ts": "2026-11-15T00:00:00.000Z",
        "open": "64123.32",
        "high": "64469.5",
        "low": "63430.38",
        "close": "63478.34",
        "volume": null
      }
    ]
  },
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `data.candles[]` | object[] | `{ts, open, high, low, close, volume}`. |

### API400 (HTTP 400): Bad Request

A parameter is missing or malformed. `data.param` names it (here `interval`).

```json
{
  "status": 0,
  "code": "API400",
  "message": "Missing parameter: interval.",
  "data": {
    "param": "interval"
  },
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

### API429 (HTTP 429): Too Many Requests

Rate limited (read class: 5 requests per second, burst 20, per IP). A `Retry-After` header says how long to wait, in seconds.

```json
{
  "status": 0,
  "code": "API429",
  "message": "Too many requests. Please retry shortly.",
  "data": null,
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

## Notes

- At most 1,000 candles per call.
- Reference data, not Rarebl trading rates.

Back to the Rarebl AI documentation index