# Sparkline price-ratio time series

Endpoint reference for the 1delta API. Index: https://docs.1delta.io/llms.txt · every endpoint: https://docs.1delta.io/llms-full.txt

---

### POST /v1/data/sparklines

- operationId: `sparkline-price-ratio-time-series`
- docs: https://docs.1delta.io/1delta-api/sparkline-price-ratio-time-series/
- markdown: https://docs.1delta.io/1delta-api/sparkline-price-ratio-time-series.md
- tags: Prices

Sparkline price-ratio time series

Returns price-ratio time series for the cross product of `currencies` × `quotes` over a configurable lookback window (default 24h).

**Request body:** `{ currencies: string[], quotes: string[], windowHours?: number }` where each ID is either a shorthand (`"usd"`, `"eth"`) or `"{chainId}-{address}"`. See the `SparklineRequest` schema.

**Response:** `{ windowHours, count, result }`. Each `result[i]` has `{ currency, quote, data }` where `data` is an array of `{ time, value }` points and `value = price(currency) / price(quote)`. Pairs with no data are omitted from `result` (so `count` ≤ `currencies.length × quotes.length`).

Useful for rendering small inline charts (token cards, asset selectors) without hitting the heavier snapshot endpoints.

**Request body** (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currencies` | string[] | yes | Currency identifiers. Use shorthand ("usd", "eth") or "{chainId}-{address}" format. |
| `quotes` | string[] | yes | Quote identifiers (same format as currencies) |
| `windowHours` | number | no | Lookback window in hours |

**Example request body**

```json
{
  "currencies": [
    "string"
  ],
  "quotes": [
    "string"
  ],
  "windowHours": 24
}
```

**Response `200`** — Sparkline data

| Field | Type | Description |
| --- | --- | --- |
| `success` | true |  |
| `data` | object |  |
| `data.windowHours` | number |  |
| `data.count` | integer | Number of non-empty sparkline pairs |
| `data.result` | object[] |  |
| `data.result[].currency` | string |  |
| `data.result[].quote` | string |  |
| `data.result[].data` | object[] | Informational payload. `null` when the endpoint only builds calldata. |
| `data.result[].data[].value` | number | Price ratio (currency / quote) |
| `data.result[].data[].time` | string |  |
| `actions` | null |  |

**Example response**

```json
{
  "success": true,
  "data": {
    "windowHours": 1,
    "count": 1,
    "result": [
      {
        "currency": "string",
        "quote": "string",
        "data": [
          {
            "value": 1,
            "time": "2026-01-01T00:00:00Z"
          }
        ]
      }
    ]
  }
}
```

**Response `429`** — Rate limited. Unauthenticated callers share a per-IP budget; send an `x-api-key` header to lift it. Retry with exponential backoff.

**Response `500`** — Unexpected server error. Safe to retry with backoff.

**Response `502`** — An upstream data source or protocol origin failed (`error.code` is `ORIGIN_FAILED`). `error.details` carries the per-origin status. This is also what a missing or malformed required parameter currently returns, rather than a 400.
