Top-of-book history
curl --request GET \
--url https://api.routeur.app/v1/markets/{venue}/{id}/book/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.routeur.app/v1/markets/{venue}/{id}/book/history"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.routeur.app/v1/markets/{venue}/{id}/book/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.routeur.app/v1/markets/{venue}/{id}/book/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"at": "2023-11-07T05:31:56Z",
"observed_at": "2023-11-07T05:31:56Z",
"yes_depth_5c_usd": "0.4100",
"no_depth_5c_usd": "0.4100",
"changes": 123,
"source_currency": "USD",
"verification_observed_at": "2023-11-07T05:31:56Z",
"yes_bid_usd": "0.4100",
"yes_ask_usd": "0.4100",
"mid_usd": "0.4100",
"microprice_usd": "0.4100",
"spread_usd": "0.4100",
"imbalance": "0.4100"
}
],
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"step": "1s"
}{
"error": {
"code": "invalid_parameter",
"message": "Invalid or unsupported query parameter: limit."
}
}{
"error": {
"code": "api_key_required",
"message": "Send an API key in the X-API-Key header or as a Bearer token."
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Books
Top-of-book history
The top of the book over time: the best Yes bid and ask, mid,
microprice, spread, the USD within 5 cents of each side’s best bid,
and the imbalance, one point per step in which the top changed,
each the last state in its step, with how many changes the step saw.
The series is recorded per second of change and kept hot for 30 days;
at most 5,000 points per request, so a day at one-second resolution
needs several requests.
GET
/
v1
/
markets
/
{venue}
/
{id}
/
book
/
history
Top-of-book history
curl --request GET \
--url https://api.routeur.app/v1/markets/{venue}/{id}/book/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.routeur.app/v1/markets/{venue}/{id}/book/history"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.routeur.app/v1/markets/{venue}/{id}/book/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.routeur.app/v1/markets/{venue}/{id}/book/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"at": "2023-11-07T05:31:56Z",
"observed_at": "2023-11-07T05:31:56Z",
"yes_depth_5c_usd": "0.4100",
"no_depth_5c_usd": "0.4100",
"changes": 123,
"source_currency": "USD",
"verification_observed_at": "2023-11-07T05:31:56Z",
"yes_bid_usd": "0.4100",
"yes_ask_usd": "0.4100",
"mid_usd": "0.4100",
"microprice_usd": "0.4100",
"spread_usd": "0.4100",
"imbalance": "0.4100"
}
],
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"step": "1s"
}{
"error": {
"code": "invalid_parameter",
"message": "Invalid or unsupported query parameter: limit."
}
}{
"error": {
"code": "api_key_required",
"message": "Send an API key in the X-API-Key header or as a Bearer token."
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}