OHLC candles
curl --request POST \
--url https://builder.prod.bedrock.ostium.io/v1/ohlc \
--header 'Content-Type: application/json' \
--data '
{
"pair": "BTC-USD",
"fromTimestampSeconds": 1710000000,
"toTimestampSeconds": 1710086400,
"resolution": "60"
}
'import requests
url = "https://builder.prod.bedrock.ostium.io/v1/ohlc"
payload = {
"pair": "BTC-USD",
"fromTimestampSeconds": 1710000000,
"toTimestampSeconds": 1710086400,
"resolution": "60"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
pair: 'BTC-USD',
fromTimestampSeconds: 1710000000,
toTimestampSeconds: 1710086400,
resolution: '60'
})
};
fetch('https://builder.prod.bedrock.ostium.io/v1/ohlc', 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://builder.prod.bedrock.ostium.io/v1/ohlc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pair' => 'BTC-USD',
'fromTimestampSeconds' => 1710000000,
'toTimestampSeconds' => 1710086400,
'resolution' => '60'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://builder.prod.bedrock.ostium.io/v1/ohlc"
payload := strings.NewReader("{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://builder.prod.bedrock.ostium.io/v1/ohlc")
.header("Content-Type", "application/json")
.body("{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://builder.prod.bedrock.ostium.io/v1/ohlc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"from": "BTC",
"to": "USD",
"time": 1710000000000,
"open": 97000,
"high": 97500,
"low": 96800,
"close": 97400
}
],
"lastRequestTimestamp": null
}{
"error": "Bad Request",
"message": "Validation failed",
"issues": []
}{
"error": "Payload Too Large",
"message": "request entity too large"
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Try again in 7s."
}{
"error": "Internal Server Error",
"message": "Internal Server Error"
}{
"error": "Failed to reach OHLC upstream."
}Prices
OHLC candles
Historical candles for one pair over a time range — chart history, and the backfill to sit behind the live stream.
pair is BASE-QUOTE (e.g. FTSE-GBP). resolution is a candle width in minutes, or 1D / 1W. Candle time is the open time in Unix milliseconds, while the request range is in seconds.
Rate limit: 100 requests per 10 seconds per IP. Read x-ratelimit-* for the live budget rather than assuming this figure.
POST
/
v1
/
ohlc
OHLC candles
curl --request POST \
--url https://builder.prod.bedrock.ostium.io/v1/ohlc \
--header 'Content-Type: application/json' \
--data '
{
"pair": "BTC-USD",
"fromTimestampSeconds": 1710000000,
"toTimestampSeconds": 1710086400,
"resolution": "60"
}
'import requests
url = "https://builder.prod.bedrock.ostium.io/v1/ohlc"
payload = {
"pair": "BTC-USD",
"fromTimestampSeconds": 1710000000,
"toTimestampSeconds": 1710086400,
"resolution": "60"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
pair: 'BTC-USD',
fromTimestampSeconds: 1710000000,
toTimestampSeconds: 1710086400,
resolution: '60'
})
};
fetch('https://builder.prod.bedrock.ostium.io/v1/ohlc', 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://builder.prod.bedrock.ostium.io/v1/ohlc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pair' => 'BTC-USD',
'fromTimestampSeconds' => 1710000000,
'toTimestampSeconds' => 1710086400,
'resolution' => '60'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://builder.prod.bedrock.ostium.io/v1/ohlc"
payload := strings.NewReader("{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://builder.prod.bedrock.ostium.io/v1/ohlc")
.header("Content-Type", "application/json")
.body("{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://builder.prod.bedrock.ostium.io/v1/ohlc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pair\": \"BTC-USD\",\n \"fromTimestampSeconds\": 1710000000,\n \"toTimestampSeconds\": 1710086400,\n \"resolution\": \"60\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"from": "BTC",
"to": "USD",
"time": 1710000000000,
"open": 97000,
"high": 97500,
"low": 96800,
"close": 97400
}
],
"lastRequestTimestamp": null
}{
"error": "Bad Request",
"message": "Validation failed",
"issues": []
}{
"error": "Payload Too Large",
"message": "request entity too large"
}{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Try again in 7s."
}{
"error": "Internal Server Error",
"message": "Internal Server Error"
}{
"error": "Failed to reach OHLC upstream."
}Body
application/json
Trading pair as BASE-QUOTE, e.g. BTC-USD or FTSE-GBP
Pattern:
^[A-Z0-9]+-[A-Z0-9]+$Range start as Unix seconds (not milliseconds)
Range end as Unix seconds (not milliseconds)
Candle width in minutes (e.g. "1", "60"), or "1D" / "1W"
Required string length:
1 - 10