curl --request GET \
--url https://api.ondoperps.xyz/v1/spot/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ondoperps.xyz/v1/spot/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ondoperps.xyz/v1/spot/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/spot/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/spot/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/spot/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/spot/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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"
}Get Spot price history
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/spot/candles (Get Candles). Supply market (candles) or symbol (history), resolution, to, and either from or countback. Resolutions: 1, 5, 15, 60, 240, 1D, 1W; D/W aliases are accepted. to is inclusive.
curl --request GET \
--url https://api.ondoperps.xyz/v1/spot/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ondoperps.xyz/v1/spot/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ondoperps.xyz/v1/spot/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/spot/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/spot/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/spot/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/spot/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
TradingView symbol identifier
Bar resolution
Unix seconds, not milliseconds.
Unix seconds, not milliseconds.
Positive bar count ending at to; supply either from or countback.
x >= 1Response
TradingView UDF history response