> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Asset Price History

> Retrieve historical price data for one or multiple assets.

<Tip>
  **Batch Support Available**: This endpoint supports batch queries via POST method for fetching price history for up to 10 assets in a single request. [Jump to Batch Query section](#post-request-batch)
</Tip>

<Tip> Timestamps are in MS, it's JS timestamps. </Tip>

### Overview

This endpoint retrieves historical price data for assets. Use **GET** for a single asset or **POST** for batch requests (up to 10 assets).

<Info>
  **How to get the asset ID?**

  You can retrieve an asset's ID using:

  * The [Search endpoint](/rest-api-reference/endpoint/search) - search by asset name and get the ID from the response
  * The [All Assets endpoint](/rest-api-reference/endpoint/all) - list all assets with their IDs
</Info>

## GET Request (Single Asset)

### Query Parameters

| Parameter | Type   | Required | Description                                                                                |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------------ |
| `id`      | number | Cond.    | Mobula's internal asset ID. Either `id` or `address` must be provided.                     |
| `address` | string | Cond.    | Contract address. Either `id` or `address` must be provided.                               |
| `chainId` | string | Cond.    | Chain identifier (e.g., `"ethereum"`, `"base"`). **Required when using `address`**.        |
| `period`  | string | No       | Candle resolution. Supported: `5m`, `15m`, `1h`, `6h`, `1d`. Defaults to auto-granularity. |
| `from`    | number | No       | Start timestamp (ms). Defaults to `0` (epoch).                                             |
| `to`      | number | No       | End timestamp (ms). Defaults to current time.                                              |

### Example

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/asset/price-history?id=100001628&period=1h"
```

## POST Request (Batch)

### Request Body

Send an array of asset queries directly (minimum 1, maximum 10 per request). Each item uses the same parameters as the GET request.

### Example

```bash theme={null}
curl -X POST "https://api.mobula.io/api/2/asset/price-history" \
  -H "Content-Type: application/json" \
  -d '[
    { "id": 100001628, "period": "1h" },
    { "address": "0xc4ce8e63921b8b6cbdb8fcb6bd64cc701fb926f2", "chainId": "ethereum" }
  ]'
```

## Response Format

All response fields use **camelCase** naming convention:

| Field          | Type         | Description                                                  |
| -------------- | ------------ | ------------------------------------------------------------ |
| `priceHistory` | `number[][]` | Array of \[timestamp, price] tuples                          |
| `id`           | `number`     | Mobula's internal asset ID                                   |
| `name`         | `string`     | Asset name                                                   |
| `symbol`       | `string`     | Asset symbol                                                 |
| `chainId`      | `string`     | Chain identifier                                             |
| `address`      | `string`     | Contract address                                             |
| `error`        | `string`     | Error message if the asset could not be fetched (batch only) |

### GET Response Example

```json theme={null}
{
  "data": {
    "priceHistory": [
      [1754337900000, 0.00123456],
      [1754338200000, 0.00124567]
    ],
    "id": 100001628,
    "name": "Example Token",
    "symbol": "EXT",
    "chainId": "ethereum",
    "address": "0xc4ce8e63921b8b6cbdb8fcb6bd64cc701fb926f2"
  }
}
```

### POST Response Example

```json theme={null}
{
  "data": [
    {
      "priceHistory": [[1754337900000, 0.00123456]],
      "id": 100001628,
      "name": "Token A",
      "symbol": "TKNA"
    },
    {
      "priceHistory": [[1754337900000, 1.25]],
      "id": 100002000,
      "name": "Token B",
      "symbol": "TKNB",
      "chainId": "ethereum",
      "address": "0xc4ce8e63921b8b6cbdb8fcb6bd64cc701fb926f2"
    }
  ]
}
```

## Data Granularity

* 5 minutes for the last 7 days
* 6 hours for the last 30 days
* 1 day for the remaining of history

### Period Options

* `5m` for 5 minutes
* `15m` for 15 minutes
* `1h` for 1 hour
* `6h` for 6 hours
* `1d` for 1 day

## Notes

* Maximum 10 assets per POST request
* Rate limit: 5 credits (GET), 10 credits (POST)


## OpenAPI

````yaml get /2/asset/price-history
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula API
  description: >-
    Documentation of the Mobula API


    **Demo API**: The default server (demo-api.mobula.io) is a demo API with
    rate limits.

    For production use, please use api.mobula.io with an API key from
    https://admin.mobula.io
servers:
  - url: https://demo-api.mobula.io/api/
    description: Demo API (rate limited, for testing only)
  - url: https://api.mobula.io/api/
    description: Production API (requires API key)
security: []
tags:
  - name: V2 - Token
    description: Token details, price, security, ATH, and holder data
  - name: V2 - Market Data
    description: Market details, OHLCV history, and lighthouse metrics
  - name: V2 - Trades
    description: Token trades, enriched trades, and trade filters
  - name: V2 - Wallet
    description: Wallet positions, activity, trades, analysis, and labels
  - name: V2 - Assets
    description: Cross-chain asset details and price history
  - name: V2 - Swap
    description: Swap quoting and execution
  - name: V2 - Perps
    description: Perpetual futures quoting, execution, and positions
  - name: V2 - Bridge
    description: Cross-chain bridge quoting and intent status (Alpha Preview)
  - name: V2 - DeFi
    description: Bonding pools and pulse data
  - name: V2 - Search
    description: Universal fast search
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V1 - Market Data
    description: Market prices, history, sparklines, pairs, and multi-data
  - name: V1 - Wallet
    description: Wallet portfolio, transactions, history, and NFTs
  - name: V1 - Token
    description: First buyers
  - name: V1 - Trades
    description: Market trades by pair
  - name: V1 - Metadata
    description: Token metadata, categories, trendings, and news
  - name: V1 - Assets
    description: List all assets
  - name: V1 - Search
    description: Search for assets, tokens, and pairs
  - name: V1 - DeFi
    description: Bonding pool pulse data
  - name: V1 - Blockchains
    description: Blockchain listings, pairs, and stats
  - name: V1 - Webhooks
    description: Webhook management
  - name: V1 - Feed
    description: Custom feed creation
paths:
  /2/asset/price-history:
    get:
      tags:
        - V2 - Assets
      summary: Get asset price history
      description: Retrieve historical price data for a specific asset.
      parameters:
        - schema:
            type: string
            description: Token contract address
          required: false
          description: Token contract address
          name: address
          in: query
        - schema:
            type: string
            description: Blockchain chain ID (required when using address)
          required: false
          description: Blockchain chain ID (required when using address)
          name: chainId
          in: query
        - schema:
            type: number
            nullable: true
            description: Asset ID (alternative to address+chainId)
          required: false
          description: Asset ID (alternative to address+chainId)
          name: id
          in: query
        - schema:
            type: string
            description: Candle period (e.g., "5m", "1h", "1d")
          required: false
          description: Candle period (e.g., "5m", "1h", "1d")
          name: period
          in: query
        - schema:
            type: number
            nullable: true
            description: Start timestamp (unix seconds)
          required: false
          description: Start timestamp (unix seconds)
          name: from
          in: query
        - schema:
            type: number
            nullable: true
            description: End timestamp (unix seconds)
          required: false
          description: End timestamp (unix seconds)
          name: to
          in: query
      responses:
        '200':
          description: Asset price history response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      priceHistory:
                        type: array
                        items:
                          type: array
                          items:
                            type: number
                            nullable: true
                      id:
                        type: number
                      name:
                        type: string
                      symbol:
                        type: string
                      chainId:
                        type: string
                      address:
                        type: string
                      error:
                        type: string
                    required:
                      - priceHistory
                required:
                  - data

````