> ## 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 Token Price History

> Retrieve 24 TWAP price points for one or multiple tokens, ideal for sparkline/linechart rendering.

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

<Tip> Timestamps are in MS (JavaScript timestamps). </Tip>

### Overview

This endpoint retrieves **24 evenly-spaced TWAP (Time-Weighted Average Price) data points** for a token, designed for lightweight sparkline and linechart rendering. Use **GET** for a single token or **POST** for batch requests (up to 50 tokens).

For full OHLCV candlestick data with configurable periods, use [Token OHLCV History](/rest-api-reference/endpoint/token-ohlcv-history) instead.

## GET Request (Single Token)

### Query Parameters

| Parameter   | Type   | Required | Description                                                            |
| ----------- | ------ | -------- | ---------------------------------------------------------------------- |
| `address`   | string | Yes      | Token contract address                                                 |
| `chainId`   | string | Yes      | Chain identifier (e.g., `"ethereum"`, `"base"`, `"solana"`)            |
| `timeframe` | string | No       | Timeframe: `5m`, `15m`, `1h`, `24h`, `7d`, `30d`, `1y`. Default: `24h` |

### Example

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/token/price-history?address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&chainId=ethereum&timeframe=24h"
```

## POST Request (Batch)

### Request Body

Send an array of token queries directly, or an object with an `items` key (minimum 1, maximum 50 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/token/price-history" \
  -H "Content-Type: application/json" \
  -d '[
    { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "chainId": "ethereum", "timeframe": "24h" },
    { "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "ethereum", "timeframe": "7d" }
  ]'
```

## Response Format

| Field          | Type         | Description                                                  |
| -------------- | ------------ | ------------------------------------------------------------ |
| `priceHistory` | `number[][]` | Array of `[timestamp, price]` tuples (24 points max)         |
| `address`      | `string`     | Token contract address                                       |
| `chainId`      | `string`     | Chain identifier                                             |
| `error`        | `string`     | Error message if the token could not be fetched (batch only) |

### GET Response Example

```json theme={null}
{
  "data": {
    "priceHistory": [
      [1739545200000, 2845.32],
      [1739548800000, 2851.10],
      [1739552400000, 2838.45]
    ],
    "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "chainId": "evm:1"
  }
}
```

### POST Response Example

```json theme={null}
{
  "data": [
    {
      "priceHistory": [
        [1739545200000, 2845.32],
        [1739548800000, 2851.10]
      ],
      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "chainId": "evm:1"
    },
    {
      "priceHistory": [],
      "address": "0x0000000000000000000000000000000000000000",
      "chainId": "evm:1",
      "error": "No pool found for this token"
    }
  ]
}
```

### Timeframe Options

| Timeframe | Points | Bucket Size   | Description     |
| --------- | ------ | ------------- | --------------- |
| `5m`      | 24     | \~13 seconds  | Last 5 minutes  |
| `15m`     | 24     | \~38 seconds  | Last 15 minutes |
| `1h`      | 24     | \~2.5 minutes | Last hour       |
| `24h`     | 24     | 1 hour        | Last 24 hours   |
| `7d`      | 24     | \~7 hours     | Last 7 days     |
| `30d`     | 24     | \~30 hours    | Last 30 days    |
| `1y`      | 24     | \~15 days     | Last year       |

### Notes

* Always returns exactly **24 data points** (fewer if the token is newer than the timeframe)
* Prices are TWAP (time-weighted average) per bucket, not close prices
* Maximum 50 tokens per POST request
* Rate limit: 2 credits (GET), 10 credits (POST)


## OpenAPI

````yaml get /2/token/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 - Usage
    description: Per-key API and WebSocket usage history
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V2 - Prediction Markets
    description: >-
      Polymarket markets/events, wallet positions, and the full execution stack
      (auth, order build/submit/cancel, approvals, pUSD wrap/unwrap, deploy,
      deposit/withdraw, redeem). Alpha — see /api/2/pm/*.
  - 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/token/price-history:
    get:
      tags:
        - V2 - Token
      summary: Get token price history
      description: >-
        Retrieve TWAP price points for a token, ideal for sparkline/linechart
        rendering.
      parameters:
        - schema:
            type: string
            description: Token contract address
          required: true
          description: Token contract address
          name: address
          in: query
        - schema:
            type: string
            description: Blockchain chain ID (e.g., "evm:56", "solana:solana")
          required: false
          description: Blockchain chain ID (e.g., "evm:56", "solana:solana")
          name: chainId
          in: query
        - schema:
            type: string
            enum:
              - 5m
              - 15m
              - 1h
              - 24h
              - 7d
              - 30d
              - 1y
            description: Time range for price history
          required: true
          description: Time range for price history
          name: timeframe
          in: query
      responses:
        '200':
          description: Token price history response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      priceHistory:
                        type: array
                        items:
                          type: array
                          items:
                            type: number
                      address:
                        type: string
                      chainId:
                        type: string
                      error:
                        type: string
                    required:
                      - priceHistory
                      - address
                      - chainId
                required:
                  - data

````