Get candlesticks for a pair address
curl --request GET \
--url https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv \
--header 'X-Api-Key: <api-key>'import requests
url = "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"pairAddress": "<string>",
"tokenAddress": "<string>",
"timeframe": "1min",
"currency": "usd",
"cursor": "<string>",
"result": [
{
"timestamp": "<string>",
"open": 123,
"close": 123,
"high": 123,
"low": 123,
"volume": 123,
"trades": 123
}
]
}Price API
OHLC by Pair Address
Gets the candlesticks for a specific pair address
GET
/
token
/
{network}
/
pairs
/
{address}
/
ohlcv
Get candlesticks for a pair address
curl --request GET \
--url https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv \
--header 'X-Api-Key: <api-key>'import requests
url = "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://solana-gateway.moralis.io/token/{network}/pairs/{address}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"pairAddress": "<string>",
"tokenAddress": "<string>",
"timeframe": "1min",
"currency": "usd",
"cursor": "<string>",
"result": [
{
"timestamp": "<string>",
"open": 123,
"close": 123,
"high": 123,
"low": 123,
"volume": 123,
"trades": 123
}
]
}This endpoint requires a pair address, not a token address. To find the pair addresses for a token, use the Token Pairs endpoint.
Authorizations
Path Parameters
The network to query
Available options:
mainnet, devnet The address to query
Example:
"So11111111111111111111111111111111111111112"
Query Parameters
The cursor to the next page
The starting date (format in seconds or datestring accepted by momentjs)
The ending date (format in seconds or datestring accepted by momentjs)
The interval of the candle stick
Available options:
1s, 10s, 30s, 1min, 5min, 10min, 30min, 1h, 4h, 12h, 1d, 1w, 1M The currency format
Available options:
usd, native The limit per page
Required range:
1 <= x <= 1000Response
200 - application/json
The page number
The pair address
The token address
The interval of the candle stick
Available options:
1s, 10s, 30s, 1min, 5min, 10min, 30min, 1h, 4h, 12h, 1d, 1w, 1M The currency format
Available options:
usd, native The cursor to the next page
An array of candlesticks
Show child attributes
Show child attributes

