Skip to content
📊

Historical Data

GET /v1/history

Returns historical data points for any metric_id available in the market snapshot. Configurable time window. Useful for charting, backtesting, and research.

Quick Test

curl "https://algotick.dev/v1/history"

Parameters

NameTypeRequiredDescription
metric_id string required The metric to query (e.g., btc_price, eth_basefee_gwei)
hours int optional Hours of history to return (default: 24, max: 720)

Response Schema

FieldTypeDescription
[].time_chain string ISO 8601 timestamp
[].value float Metric value at this timestamp
[].metric_id string The queried metric identifier

Live Response Preview

{}
Cached for 45s · Fetched from internal API

Code Examples

🐍 Python 📘 TypeScript
import requests
import pandas as pd

resp = requests.get("https://algotick.dev/v1/history",
                    params={{,
                        "metric_id": "btc_price",
                        "hours": 24,
                    }})
data = resp.json()

df = pd.DataFrame(data)
df["time_chain"] = pd.to_datetime(df["time_chain"])
print(f"BTC 24h range: ${{df['value'].min():,.0f}} – ${{df['value'].max():,.0f}}")
print(f"Data points: {{len(df)}}")
const params = new URLSearchParams({{,
  metric_id: "btc_price",
  hours: "24",
}});
const resp = await fetch(
  `https://algotick.dev/v1/history?${{params}}`
);
const data = await resp.json();

const prices = data.map(d => d.value);
console.log(`BTC 24h range: $${Math.min(...prices).toFixed(0)}` +
            ` – $${Math.max(...prices).toFixed(0)}`);
console.log(`Data points: ${data.length}`);

Common Use Cases

Chart renderingBacktestingTrend analysisCustom indicator construction

Related Resources

Don't just stare at the dashboard. Automate it.

Every metric on this page is available via our sub-millisecond API.
Build trading bots, backtest strategies, and power AI agents with institutional-grade data.

Explore API →

Continue the Research

📁 Data Library🍳 Cookbook🔑 API Overview📖 Playbooks