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": [
    {
      "v": 123,
      "o": 123,
      "h": 123,
      "l": 123,
      "c": 123,
      "t": 123
    }
  ]
}
Batch Support Available: This endpoint supports batch queries via POST method for fetching OHLCV data for up to 10 pools in a single request. Jump to Batch Query section
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: 1s, 5s, 15s, 30s, 1m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 1w. Default: 5m
fromnumberNoStart timestamp (ms). Default: 0
tonumberNoEnd timestamp (ms). Default: current time
amountnumberNoMaximum number of candles to return (max: 2000)
usdbooleanNoReturn USD prices. Default: true

Step-by-Step Tutorial and Video Walkthrough

  • Check out the guide: Here

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

  • 1s - 1 second
  • 5s - 5 seconds
  • 15s - 15 seconds
  • 30s - 30 seconds
  • 1m - 1 minute
  • 5m - 5 minutes
  • 15m - 15 minutes
  • 30m - 30 minutes
  • 1h - 1 hour
  • 4h - 4 hours
  • 6h - 6 hours
  • 1d - 1 day
  • 1w - 1 week

FAQ

Mobula’s period is not the same format as TradingView’s ResolutionString. Treat them as different contracts and map values in your datafeed before calling Mobula.Often maps cleanly (Mobula normalizes case):
  • Seconds: TV 1S, 5S, … → Mobula 1s, 5s, …
  • Minute numerals: 1, 5, 15, 301m, 5m, 15m, 30m
  • Hour-style minute counts: 601h; 2404h; 3606h; 72012h
  • Days / weeks: 1D1d, 1W1w
Important mismatch — TV 1M (one month):
TradingView uses 1M for one month. Mobula lowercases the string, so 1M becomes 1m, which means one minute, not one month. Never forward TV’s monthly resolution unchanged.
Not a direct match:
  • Tick bars (1T, 5T, …) — Mobula serves time-based OHLCV candles, not tick aggregation.
  • Unrecognized strings — fall back to a default period (commonly 1h for unknown non-empty values, or 5m when period is omitted on this endpoint).
Supported candle periods (canonical):
1s, 5s, 15s, 30s, 1m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 1w.
Aliases such as 5min or 601h are accepted by the API layer. Do not use 1month / TV-style monthly here: they normalize to 1M, which this OHLCV history service does not support.
Recommendation: Add an explicit tradingViewResolutionToMobulaPeriod(resolution) (or equivalent) in your integration instead of passing TV resolutions straight through.

Notes

  • Maximum 2000 candles per request. If no amount is specified and a date range is provided, the default cap is 2000. Without a date range, the default is 300 candles.
  • 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
chainId
string
required
from
to
period
string
amount
number | null
usd
default:true

Response

200 - application/json

Market OHLCV history response

data
object[]
required