const res = await fetch('https://app.trdrs.co/api/market/history?instrument=ESU6&tf=5m', {
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl 'https://app.trdrs.co/api/market/history?instrument=ESU6&tf=5m' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/market/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/market/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://app.trdrs.co/api/market/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://app.trdrs.co/api/market/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/market/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{
"instrument": "ESU6",
"tf": "5m",
"bars": [
{
"t": 1787581200,
"o": 6478.25,
"h": 6481.5,
"l": 6477.75,
"c": 6480.5,
"v": 12841
},
{
"t": 1787581500,
"o": 6480.5,
"h": 6483.25,
"l": 6479.5,
"c": 6482.75,
"v": 9973
},
{
"t": 1787581800,
"o": 6482.75,
"h": 6484,
"l": 6480.25,
"c": 6481.25,
"v": 11204
}
]
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Get price history
Returns OHLCV bars. Without a range, the most recent ~500 bars. from/to (epoch seconds) narrow the window. countBack asks for the last N bars at or before to and outranks from (the scroll-back page); an empty countBack answer carries noData: true, the stop-scrolling-back signal. stale: true marks a countBack answer served entirely from before the asked window (closed market), so a consumer never mistakes Friday bars for a live Saturday session. The instrument may be a spread expression over instruments (ES-NQ, 1/ESU6, (ES+NQ)/2): operators + - * / ^, parentheses, numeric literals, up to four instrument legs. The engine evaluates server-side over the bucket intersection of the legs (a spread bar exists only where every leg printed that bucket); spread bars carry volume 0. A string that matches a catalog symbol exactly (such as the slash pair BTC/USD) is always that symbol, never arithmetic.
const res = await fetch('https://app.trdrs.co/api/market/history?instrument=ESU6&tf=5m', {
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl 'https://app.trdrs.co/api/market/history?instrument=ESU6&tf=5m' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/market/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/market/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://app.trdrs.co/api/market/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://app.trdrs.co/api/market/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/market/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{
"instrument": "ESU6",
"tf": "5m",
"bars": [
{
"t": 1787581200,
"o": 6478.25,
"h": 6481.5,
"l": 6477.75,
"c": 6480.5,
"v": 12841
},
{
"t": 1787581500,
"o": 6480.5,
"h": 6483.25,
"l": 6479.5,
"c": 6482.75,
"v": 9973
},
{
"t": 1787581800,
"o": 6482.75,
"h": 6484,
"l": 6480.25,
"c": 6481.25,
"v": 11204
}
]
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
Your firm’s API key (the API calls this the tenant key; trdrs_sk_…), server-to-server only.
Query Parameters
Timeframe token, e.g. 1m / 4h / 1d / 100t
Epoch seconds, inclusive
Epoch seconds, inclusive