> ## Documentation Index
> Fetch the complete documentation index at: https://sonar-cf3aeac7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get asset price history

> Get the USD price history of a cross-chain asset, newest point first.

Returns price points for an asset, identified by its numeric id. An asset is a cross-chain price identity; you get its id from `assetId` in token, market and wallet responses, or from [search](https://sonar-cf3aeac7.mintlify.site/api-reference/search/search.md) with `type=assets`. See [What is an asset?](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-ohlcv.md#what-is-an-asset).

This endpoint behaves exactly like [Get token price history](https://sonar-cf3aeac7.mintlify.site/api-reference/token/get-token-history.md), which looks up the token's asset and returns this same series. Use this endpoint when you already have the asset id.

## Query parameters

**id** `integer` *required*

Asset id. A positive integer, at most 2147483647.

**period** `string`

Fixed resolution. One of `5m`, `15m`, `1h`, `6h`, `1d`. Leave it out to get a mixed-resolution series (see below).

**from** `integer`

Start of the window, Unix epoch **milliseconds**. Must be less than or equal to `to`. Defaults to `to` minus the default range for the chosen `period` (see below).

**to** `integer`

End of the window, Unix epoch **milliseconds**. Defaults to now.

There is no `limit` and no `chain` parameter.

> [!WARNING]
>
> `from` and `to` are in **milliseconds**. A value in seconds is accepted but is read as a date in January 1970. Leave out parameters you don't use rather than sending them empty.

## Resolution and default range

With a `period`, each point is the **average** price over that bucket, and `volumeUSD` is the volume in the bucket. When `from` is omitted, the window goes back from `to` by:

| `period` | Default range |
| - | - |
| `5m` | 1 day |
| `15m` | 7 days |
| `1h` | 30 days |
| `6h` | 90 days |
| `1d` | 365 days |
| omitted | 365 days |

Without a `period`, the resolution depends on how old each point is (measured from now, not from `to`):

| Age of the point | Resolution |
| - | - |
| Under 24 hours | Raw price samples |
| 24 hours to 7 days | 15-minute averages |
| 7 days to 1 month | 1-hour averages |
| 1 to 3 months | 6-hour averages |
| Over 3 months | 1-day averages |

## Order and the 2000-point cap

* Points are sorted **newest first**. This is the opposite of the OHLCV endpoints, which return oldest first.
* At most **2000 points** are returned. If the window holds more, the newest 2000 are kept and the oldest are dropped.
* To cover a long range at a fine resolution, split it into several requests, or page back by setting `to` to just before the date of the last (oldest) point you received.

## Response

**status** `"success"`

Always `success` for a 2xx response.

**data** `TokenHistoryOutput`

**TokenHistoryOutput**

**assetId** `number`

The asset id.

**period** `string | null`

The requested `period` (`5m`, `15m`, `1h`, `6h` or `1d`), or `null` when it was omitted.

**history** `object[]`

Price points, **newest first**. An empty array when there is no data in the window.

**point**

**date** `string`

Time of the point, ISO 8601 (UTC). For averaged points, the start of the bucket.

**priceUSD** `number`

USD price: the sample, or the average price in the bucket.

**volumeUSD** `number | null`

USD volume for the point, when known.

## Errors

| Status | `code` | When |
| - | - | - |
| 400 | `INVALID_PARAMETERS` | `id` missing, not a positive integer or too large; `period` not in the list; or `from` after `to` (`from: from must be before to`). |
| 404 | `ASSET_NOT_FOUND` | No asset with this `id`. Message: `Asset not found`. |
| 500 | `INTERNAL_ERROR` | Unexpected server error. |

```bash cURL theme={null}
curl "https://api.example.com/api/v1/asset/history?id=2534&period=1h&from=1796292000000&to=1796299200000"
```

```javascript JavaScript theme={null}
const params = new URLSearchParams({
  id: "2534",
  period: "1h",
  from: String(Date.now() - 24 * 60 * 60 * 1000),
});

const res = await fetch(`https://api.example.com/api/v1/asset/history?${params}`);
const body = await res.json();
if (body.status !== "success") throw new Error(`${body.code}: ${body.message}`);

// Points arrive newest first; reverse for charting left to right
const points = [...body.data.history].reverse();
console.log(points);
```

```json 200 theme={null}
{
  "status": "success",
  "data": {
    "assetId": 2534,
    "period": "1h",
    "history": [
      { "date": "2026-12-03T12:00:00.000Z", "priceUSD": 3512.2, "volumeUSD": 6100045.9 },
      { "date": "2026-12-03T11:00:00.000Z", "priceUSD": 3509.7, "volumeUSD": 54000310.2 },
      { "date": "2026-12-03T10:00:00.000Z", "priceUSD": 3501.3, "volumeUSD": 61840220.5 }
    ]
  }
}
```

```json 404 theme={null}
{
  "status": "error",
  "statusCode": 404,
  "code": "ASSET_NOT_FOUND",
  "message": "Asset not found"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.