Get Price History (TradingView)
curl --request GET \
--url https://api.ondoperps.xyz/v1/perps/historyimport requests
url = "https://api.ondoperps.xyz/v1/perps/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ondoperps.xyz/v1/perps/history', 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.ondoperps.xyz/v1/perps/history",
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.ondoperps.xyz/v1/perps/history"
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.ondoperps.xyz/v1/perps/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/perps/history")
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{
"s": "ok",
"t": [
1709640000,
1709643600
],
"o": [
226.8,
227.5
],
"h": [
228.1,
228.5
],
"l": [
226.5,
227
],
"c": [
227.5,
228
],
"v": [
12345.67,
9876.54
]
}{
"success": false,
"error": "Description of the error",
"error_code": "bad_query_param"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Market Data
Get Price History (TradingView)
Returns historical bar data in TradingView UDF format, as required by the TradingView charting library: a single object with parallel arrays keyed t, o, h, l, c, and v (values are numbers), plus a status field s. For a standard array-of-objects representation with full field names (open, high, low, close, volume), use GET /v1/perps/candles (Get Candles).
GET
/
v1
/
perps
/
history
Get Price History (TradingView)
curl --request GET \
--url https://api.ondoperps.xyz/v1/perps/historyimport requests
url = "https://api.ondoperps.xyz/v1/perps/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ondoperps.xyz/v1/perps/history', 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.ondoperps.xyz/v1/perps/history",
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.ondoperps.xyz/v1/perps/history"
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.ondoperps.xyz/v1/perps/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/perps/history")
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{
"s": "ok",
"t": [
1709640000,
1709643600
],
"o": [
226.8,
227.5
],
"h": [
228.1,
228.5
],
"l": [
226.5,
227
],
"c": [
227.5,
228
],
"v": [
12345.67,
9876.54
]
}{
"success": false,
"error": "Description of the error",
"error_code": "bad_query_param"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Query Parameters
TradingView symbol identifier
Bar resolution
Start Unix timestamp
End Unix timestamp
Response
TradingView UDF history response