Get pool OHLCV
curl --request GET \
--url https://api.swap.shield.fi/pools/{key}/ohlcvimport requests
url = "https://api.swap.shield.fi/pools/{key}/ohlcv"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.swap.shield.fi/pools/{key}/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://api.swap.shield.fi/pools/{key}/ohlcv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.swap.shield.fi/pools/{key}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.swap.shield.fi/pools/{key}/ohlcv")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swap.shield.fi/pools/{key}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"c": "<string>",
"granularity": "1m",
"h": "<string>",
"l": "<string>",
"o": "<string>",
"pool": "<string>",
"timestamp": 123,
"v": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"code": "<string>",
"ref": "<string>"
}Get pool OHLCV
Retrieve indexed open, high, low, close, and volume candles for a pool.
GET
/
pools
/
{key}
/
ohlcv
Get pool OHLCV
curl --request GET \
--url https://api.swap.shield.fi/pools/{key}/ohlcvimport requests
url = "https://api.swap.shield.fi/pools/{key}/ohlcv"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.swap.shield.fi/pools/{key}/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://api.swap.shield.fi/pools/{key}/ohlcv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.swap.shield.fi/pools/{key}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.swap.shield.fi/pools/{key}/ohlcv")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swap.shield.fi/pools/{key}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"c": "<string>",
"granularity": "1m",
"h": "<string>",
"l": "<string>",
"o": "<string>",
"pool": "<string>",
"timestamp": 123,
"v": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"code": "<string>",
"ref": "<string>"
}Path Parameters
Pool key
Query Parameters
Candle bucket
Available options:
1m, 5m, 15m, 30m, 1h, 6h, 12h, 1d Inclusive unix-second start
Exclusive unix-second end
raw (default) keeps stored token1-per-token0 prices; display inverts candles when the pool's canonical display orientation is flipped
Response
OHLCV candles for the range
Show child attributes
Show child attributes