Python quickstart
Fetch a market window into pandas in a few lines.
import requests
import pandas as pd
KEY = "pb_yourkey"
BASE = "https://polybk.com"
HEADERS = {"X-Api-Key": KEY}
# 1. what can this key access?
cov = requests.get(f"{BASE}/v1/coverage", headers=HEADERS).json()
print(cov["tier"], cov["streams"])
# 2. pick a window from today's BTC 5-minute markets
wins = requests.get(
f"{BASE}/v1/windows",
headers=HEADERS,
params={"symbol": "btc", "timeframe": 5},
).json()
window_start = wins["windows"][-1]
print("latest window:", window_start)
# 3. fetch rows
rows = requests.get(
f"{BASE}/v1/rows",
headers=HEADERS,
params={"symbol": "btc", "timeframe": 5, "window_start": window_start},
).json()
df = pd.DataFrame(rows["rows"], columns=rows["header"])
df["ts"] = pd.to_datetime(df["ts_unix"], unit="s", utc=True)
# best bid/ask over the window
print(df[["ts", "yes_bid", "yes_ask"]].tail())
Tips
- Empty cells are real observations — they mean "no update seen that second", never zero. See data schema.
- Use
feed_age_msto drop stale rows for live-quotes analyses. - Prefer
/v1/windows.csvwhen you want the whole window as one download. - The archive ships as month-partitioned Parquet — Pro and Archive customers can open it directly with
pd.read_parquetor DuckDB.