Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key

Get OHLCV by Pair Address Mainnet Only

Need a candlestick chart for your website?

Embed our free chart widget directly on your site in just a few clicks

Embed Chart
Solana Logo

Looking for OHLCV data on Solana?

Access OHLCV data by pair address on Solana using our API.

Explore Solana API
GEThttps://deep-index.moralis.io/api/v2.2/pairs/:address/ohlcv

Get the OHLCV candle stick by using pair address

PATH PARAMS
addressstringrequired
The pair address
QUERY PARAMS
chainstring
The chain to query
timeframestringrequired
The timeframe
currencystringrequired
The currency
fromDatestringrequired

The starting date (format in seconds or datestring accepted by momentjs)

  • Provide the param 'fromBlock' or 'fromDate'
  • If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
toDatestringrequired

The ending date (format in seconds or datestring accepted by momentjs)

  • Provide the param 'toBlock' or 'toDate'
  • If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.
limitnumber
The number of results to return
cursorstring
The cursor returned in the previous response (used for getting the next page)
Responses
200Returns the OHLCV data.
400Bad Request
404Not Found
429Too Many Requests
500Internal Server Error
API KEY
curl --request GET \
--url 'https://deep-index.moralis.io/api/v2.2/pairs/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f/ohlcv?chain=eth&timeframe=1h&currency=usd&fromDate=2025-01-01T10%3A00%3A00.000&toDate=2025-01-02T10%3A00%3A00.000&limit=25' \
--header 'accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY'
Response Example
{
"cursor": "string",
"page": 1,
"pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"tokenAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"timeframe": "1h",
"currency": "usd",
"result": [
{
"timestamp": "2024-02-14T00:00:00.000Z",
"open": 253.82,
"high": 255.14,
"low": 252.91,
"close": 253.95,
"volume": 23544.27541795,
"swaps": 48
}
]
}