Skip to main content
GET
/
2
/
token
/
price-history
Get token price history (sparkline)
curl --request GET \
  --url https://demo-api.mobula.io/api/2/token/price-history
{
  "data": {
    "priceHistory": [
      [
        123
      ]
    ],
    "address": "<string>",
    "chainId": "<string>"
  }
}
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
Timestamps are in MS (JavaScript timestamps).

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 instead.

GET Request (Single Token)

Query Parameters

ParameterTypeRequiredDescription
addressstringYesToken contract address
chainIdstringYesChain identifier (e.g., "ethereum", "base", "solana")
timeframestringNoTimeframe: 24h, 7d, 30d, 1y. Default: 24h

Example

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

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

FieldTypeDescription
priceHistorynumber[][]Array of [timestamp, price] tuples (24 points max)
addressstringToken contract address
chainIdstringChain identifier
errorstringError message if the token could not be fetched (batch only)

GET Response Example

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

POST Response Example

{
  "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

TimeframePointsBucket SizeDescription
24h241 hourLast 24 hours
7d24~7 hoursLast 7 days
30d24~30 hoursLast 30 days
1y24~15 daysLast 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)

Query Parameters

address
string
required
chainId
string
required
timeframe
enum<string>
default:24h
Available options:
24h,
7d,
30d,
1y

Response

200 - application/json

Token price history response

data
object
required