Skip to main content
GET
/
2
/
market
/
ohlcv-history
Get market OHLCV history
curl --request GET \
  --url https://demo-api.mobula.io/api/2/market/ohlcv-history
{
  "data": [
    {
      "t": 123,
      "o": 123,
      "h": 123,
      "l": 123,
      "c": 123,
      "v": 123
    }
  ]
}
Timestamps are in MS (JavaScript timestamps).

Overview

This endpoint retrieves OHLCV candlestick data for a specific pool/market by its address. Use this when you know the pool address directly. Use GET for a single pool or POST for batch requests (up to 10 pools). For asset-based queries (by name, symbol, or token address), use Token OHLCV History instead.

GET Request (Single Market)

Query Parameters

ParameterTypeRequiredDescription
addressstringYesPool/market contract address
chainIdstringYesChain identifier (e.g., "ethereum", "base", "solana")
periodstringNoCandle resolution: 5m, 15m, 1h, 4h, 1d, 1w. Default: 5m
fromnumberNoStart timestamp (ms). Default: 0
tonumberNoEnd timestamp (ms). Default: current time
amountnumberNoMaximum number of candles to return
usdbooleanNoReturn USD prices. Default: true

Usage Example

curl -X GET "https://api.mobula.io/api/2/market/ohlcv-history?address=0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640&chainId=ethereum&period=1h"

POST Request (Batch)

Request Body

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

Example

curl -X POST "https://api.mobula.io/api/2/market/ohlcv-history" \
  -H "Content-Type: application/json" \
  -d '[
    { "address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640", "chainId": "ethereum", "period": "1h" },
    { "address": "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc", "chainId": "ethereum", "period": "1h" }
  ]'

Response Format

Response fields use abbreviated naming for optimal payload size:
FieldTypeDescription
tnumberCandle timestamp (ms)
onumberOpening price
hnumberHighest price during the period
lnumberLowest price during the period
cnumberClosing price
vnumberVolume during the period

GET Response Example

{
  "data": [
    {
      "t": 1754337900000,
      "o": 3245.67,
      "h": 3250.12,
      "l": 3240.00,
      "c": 3248.50,
      "v": 125000.50
    },
    {
      "t": 1754341500000,
      "o": 3248.50,
      "h": 3255.00,
      "l": 3245.00,
      "c": 3252.30,
      "v": 98500.25
    }
  ]
}

POST Response Example

{
  "data": [
    {
      "ohlcv": [
        {
          "t": 1754337900000,
          "o": 3245.67,
          "h": 3250.12,
          "l": 3240.00,
          "c": 3248.50,
          "v": 125000.50
        }
      ],
      "address": "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640",
      "chainId": "evm:1"
    },
    {
      "ohlcv": [],
      "address": "0x0000000000000000000000000000000000000000",
      "chainId": "evm:1",
      "error": "Pool not found"
    }
  ]
}

Period Options

  • 5m - 5 minutes
  • 15m - 15 minutes
  • 1h - 1 hour
  • 4h - 4 hours
  • 1d - 1 day
  • 1w - 1 week

Notes

  • Maximum 10 markets per POST request
  • Rate limit: 5 credits (GET), 10 credits (POST)
  • This endpoint uses real-time swap data combined with pre-aggregated OHLCV data for optimal performance

Query Parameters

address
string
required

Pool/market contract address

chainId
string
required

Chain identifier (e.g., 'ethereum', 'base', 'solana')

period
string

Candle resolution: 5m, 15m, 1h, 4h, 1d, 1w. Default: 5m

from
number
default:0

Start timestamp (ms)

to
number

End timestamp (ms). Default: current time

amount
number

Maximum number of candles to return

usd
boolean
default:true

Return USD prices. Default: true

Response

200 - application/json

OHLCV history response

data
object[]
required