curl --request GET \
--url https://sandbox.api.btdx.io/markets/historical \
--header 'authorization: <authorization>'import requests
url = "https://sandbox.api.btdx.io/markets/historical"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://sandbox.api.btdx.io/markets/historical', 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://sandbox.api.btdx.io/markets/historical",
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: <authorization>"
],
]);
$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://sandbox.api.btdx.io/markets/historical"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.btdx.io/markets/historical")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.btdx.io/markets/historical")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"_meta": {
"_primary_document": "apiKeys",
"_count": 123,
"_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
},
"_next_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
}
},
"documents": {
"markets": [
{
"id": "<string>",
"ownerAppId": "<string>",
"event": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"marketType": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"marketValue": "<string>",
"marketDiscriminator": "<string>",
"currencyId": "<string>",
"inPlayStatus": "NotApplicable",
"inPlayDelay": 123,
"crossMatchingEnabled": true,
"published": true,
"suspended": true,
"lockAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"marketLockAction": "None",
"eventStartAction": "None",
"status": "Initializing",
"marketOutcomes": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"eventExpectedStartTime": "2023-11-07T05:31:56Z"
}
],
"events": [
{
"id": "<string>",
"eventGroup": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"code": "<string>",
"expectedStartTime": "2023-11-07T05:31:56Z",
"active": true
}
],
"eventGroups": [
{
"id": "<string>",
"name": "<string>",
"subcategory": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"subcategories": [
{
"id": "<string>",
"name": "<string>",
"category": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"categories": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}{
"_meta": {
"_primary_document": "apiKeys",
"_count": 123,
"_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
},
"_next_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
}
},
"documents": {
"markets": [
{
"id": "<string>",
"ownerAppId": "<string>",
"event": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"marketType": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"marketValue": "<string>",
"marketDiscriminator": "<string>",
"currencyId": "<string>",
"inPlayStatus": "NotApplicable",
"inPlayDelay": 123,
"crossMatchingEnabled": true,
"published": true,
"suspended": true,
"lockAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"marketLockAction": "None",
"eventStartAction": "None",
"status": "Initializing",
"marketOutcomes": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"eventExpectedStartTime": "2023-11-07T05:31:56Z"
}
],
"events": [
{
"id": "<string>",
"eventGroup": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"code": "<string>",
"expectedStartTime": "2023-11-07T05:31:56Z",
"active": true
}
],
"eventGroups": [
{
"id": "<string>",
"name": "<string>",
"subcategory": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"subcategories": [
{
"id": "<string>",
"name": "<string>",
"category": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"categories": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}Fetch historical settled markets
Fetch historical (settled) markets, filtered by query type (settlement date or event start date). Optionally filter by event. Pagination is by offset using the selected queryType timestamp (settledAt or eventExpectedStartTime) and id as the primary and secondary offsets. Fetch the initial page without any offsets set, and use returned _next_offset values iteratively until _next_offset is null, or _count is 0.
curl --request GET \
--url https://sandbox.api.btdx.io/markets/historical \
--header 'authorization: <authorization>'import requests
url = "https://sandbox.api.btdx.io/markets/historical"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://sandbox.api.btdx.io/markets/historical', 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://sandbox.api.btdx.io/markets/historical",
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: <authorization>"
],
]);
$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://sandbox.api.btdx.io/markets/historical"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.btdx.io/markets/historical")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.btdx.io/markets/historical")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"_meta": {
"_primary_document": "apiKeys",
"_count": 123,
"_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
},
"_next_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
}
},
"documents": {
"markets": [
{
"id": "<string>",
"ownerAppId": "<string>",
"event": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"marketType": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"marketValue": "<string>",
"marketDiscriminator": "<string>",
"currencyId": "<string>",
"inPlayStatus": "NotApplicable",
"inPlayDelay": 123,
"crossMatchingEnabled": true,
"published": true,
"suspended": true,
"lockAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"marketLockAction": "None",
"eventStartAction": "None",
"status": "Initializing",
"marketOutcomes": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"eventExpectedStartTime": "2023-11-07T05:31:56Z"
}
],
"events": [
{
"id": "<string>",
"eventGroup": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"code": "<string>",
"expectedStartTime": "2023-11-07T05:31:56Z",
"active": true
}
],
"eventGroups": [
{
"id": "<string>",
"name": "<string>",
"subcategory": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"subcategories": [
{
"id": "<string>",
"name": "<string>",
"category": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"categories": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}{
"_meta": {
"_primary_document": "apiKeys",
"_count": 123,
"_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
},
"_next_offset": {
"offset": "2023-11-07T05:31:56Z",
"secondaryOffset": 123,
"limit": 123,
"sort": "ASC"
}
},
"documents": {
"markets": [
{
"id": "<string>",
"ownerAppId": "<string>",
"event": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"marketType": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"marketValue": "<string>",
"marketDiscriminator": "<string>",
"currencyId": "<string>",
"inPlayStatus": "NotApplicable",
"inPlayDelay": 123,
"crossMatchingEnabled": true,
"published": true,
"suspended": true,
"lockAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"marketLockAction": "None",
"eventStartAction": "None",
"status": "Initializing",
"marketOutcomes": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"eventExpectedStartTime": "2023-11-07T05:31:56Z"
}
],
"events": [
{
"id": "<string>",
"eventGroup": {
"_ref": "<string>",
"_ids": [
"<string>"
]
},
"name": "<string>",
"code": "<string>",
"expectedStartTime": "2023-11-07T05:31:56Z",
"active": true
}
],
"eventGroups": [
{
"id": "<string>",
"name": "<string>",
"subcategory": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"subcategories": [
{
"id": "<string>",
"name": "<string>",
"category": {
"_ref": "<string>",
"_ids": [
"<string>"
]
}
}
],
"categories": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}Headers
Header with the accessToken for the current session
Query Parameters
SettledDate, EventStartDate beginning of the date range filter (inclusive)
end of the date range filter (inclusive)
optional event id to filter results by
Value to offset the current page request by (inclusive)
Secondary offset value, i.e., if offset value is non-unique (exclusive)
Maximum number of elements to retrieve
Sorting criteria in the format: asc|desc. "
Default sort order is ascending.