Spot Snapshots
curl --request GET \
--url https://api.polyhistorical.com/v1/btc/spot/snapshots \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://api.polyhistorical.com/v1/btc/spot/snapshots"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://api.polyhistorical.com/v1/btc/spot/snapshots', 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.polyhistorical.com/v1/btc/spot/snapshots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$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.polyhistorical.com/v1/btc/spot/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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.polyhistorical.com/v1/btc/spot/snapshots")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyhistorical.com/v1/btc/spot/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"total": 123,
"limit": 123,
"offset": 123
}Binance Spot
Spot Snapshots
Get paginated historical Binance Spot BTC/USDT depth snapshots
GET
/
v1
/
btc
/
spot
/
snapshots
Spot Snapshots
curl --request GET \
--url https://api.polyhistorical.com/v1/btc/spot/snapshots \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://api.polyhistorical.com/v1/btc/spot/snapshots"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://api.polyhistorical.com/v1/btc/spot/snapshots', 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.polyhistorical.com/v1/btc/spot/snapshots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$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.polyhistorical.com/v1/btc/spot/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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.polyhistorical.com/v1/btc/spot/snapshots")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyhistorical.com/v1/btc/spot/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"total": 123,
"limit": 123,
"offset": 123
}Spot Snapshots
Returns paginated historical Binance Spot BTC/USDT depth snapshots captured by PolyHistorical.Requires a Pro or Enterprise plan. Historical spot snapshots are currently available for BTC/USDT.
Request
https://api.polyhistorical.com/v1/btc/spot/snapshots
Headers
string
required
Your API key. See Authentication.
Query parameters
integer
default:"100"
Number of snapshots to return (1-1000).
integer
default:"0"
Pagination offset.
integer
Filter snapshots from this UTC epoch timestamp in milliseconds.
integer
Filter snapshots up to this UTC epoch timestamp in milliseconds.
Response
array
Paginated list of snapshot objects.
integer
Total snapshots matching the filters.
integer
Requested result limit.
integer
Current pagination offset.
Example
cURL
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.polyhistorical.com/v1/btc/spot/snapshots?limit=100&offset=0"
Response
{
"data": [
{
"symbol": "BTCUSDT",
"time_epoch_ms": 1779730000000,
"coin_price": 77593.69,
"bids": [
{ "price": 77593.68, "quantity": 0.64379 }
],
"asks": [
{ "price": 77593.70, "quantity": 0.20000 }
],
"last_update_id": 94228633307
}
],
"total": 12345,
"limit": 100,
"offset": 0
}