## GET /openapi/v1/derivatives/history

One crypto asset's perpetual funding rate, open interest and basis over time, all three in each
point, by day or by hour.

### Query parameters

| Parameter | Type | Default | Notes |
|:--|:--|:--|:--|
| `id` | integer | required | The asset id from `/assets`. An RWA id is a `404` here |
| `interval`, `time_start`, `time_end` | string | `1d`, none, now | See [History: what the endpoints share](#history-what-the-endpoints-share) |

### Response

```json
{
  "code": 0,
  "message": "success",
  "message_key": "SUCCESS",
  "result": {
    "id": 1,
    "interval": "1h",
    "points": [
      {
        "time": "2026-10-20T08:00:00Z",
        "funding_rate": "0.0001",
        "open_interest_usd": "8765432109.87",
        "index_basis": "0.00008"
      }
    ]
  }
}
```

#### Fields

| Field | Type | Notes |
|:--|:--|:--|
| `id`, `interval` | number, string | What you asked for |
| `points[].time` | string | RFC3339 UTC: the start of the hour, or midnight for a day |
| `points[].open_interest_usd` | string or `null` | Summed over the asset's perpetual contracts on the exchanges we collect |
| `points[].funding_rate`, `points[].index_basis` | string or `null` | Averaged over those contracts, weighted by their open interest. A contract whose basis is beyond a sanity cap is left out of the basis average only |

Each value is `null` when no contract had one in the period. Only perpetual contracts count, and
the contracts that count are chosen as on our website's charts. A daily point takes each value
at the last hour of the day that has it. New points arrive every hour, and the newest ones can still be revised for a while after; today's daily point
appears once the day is over. Where this history starts is in [Data methodology](#history).

### Examples

```bash
# Bitcoin's newest hourly funding rate, open interest and basis
curl -H "X-Api-Key: <your-api-key>" \
  "https://open-api.coinworldcap.com/openapi/v1/derivatives/history?id=1&interval=1h"
```

| HTTP status | `code` | When |
|:--|:--|:--|
| 400 | 40000 | `id` missing or not a positive integer; a parameter the shared history rules refuse |
| 404 | 40400 | No crypto asset with that `id` — it does not exist, or it is an RWA's id. An asset without perpetuals answers `200` with `points: []` |

There is no `metric` parameter: every point carries all three values. The other errors are in
[Errors](#errors).
