DEV Community

Cover image for How I compressed 14 years of Bitcoin data into a single API call
z0art
z0art

Posted on

How I compressed 14 years of Bitcoin data into a single API call

Most Bitcoin APIs give you the same thing:
huge OHLC datasets, CSVs with thousands of rows, and hours of preprocessing before you can extract anything useful.

If you're a trader, analyst, or builder, you know the pain:
every project starts with the same repetitive steps — cleaning, slicing, calculating returns, volatility, monthly patterns, max drawdowns, etc.

So I built something different.

A single API call that compresses 14 years of Bitcoin data into a ready-to-use analysis, fully structured and instantly usable.

What the API returns;

`> {

"range": {
    "start": "2020-10-02",
    "end": "2022-09-03",
    "days": 702
},
"statistics": {
    "volatility": 0.038652022380676575,
    "max_drawdown": -0.7185358095700161,
    "mean_return_daily": 0.0016437746126558173,
    "median_return_daily": 0.0020777630413166825,
    "spike_days": 7
},
"monthly_analysis": {
    "best_months": [
        "2020-12",
        "2020-11",
        "2021-02"
    ],
    "worst_months": [
        "2022-01",
        "2022-06",
        "2021-05"
    ],
    "avg_monthly_return": 0.04820700358977892
},
"patterns": {
    "recurring_patterns": [
        "Q4 historically shows stronger upward momentum compared to Q2",
        "Sharp volatility clusters appear during protocol upgrades"
    ]
},
"events": {
    "notable_events": [
        {
            "date": "2021-11-14",
            "event": "Taproot Activation"
        }
    ]
},
"summary": "Between 2020-10-02 and 2022-09-03, Bitcoin exhibited a daily volatility of 0.0387, with a maximum drawdown of -0.7185. Average daily return was 0.001644 (median 0.002078). There were 7 spike days exceeding three times typical volatility. Average monthly return for the period was 0.0482. Several notable Bitcoin network events occurred within this interval, historically associated with changes in volatility patterns.",
"generated_at": "2025-12-07T17:05:46Z"`

You send a start and end date, and the API returns:

  1. volatility
  2. max drawdown
  3. daily return distribution
  4. best/worst months
  5. spike days
  6. recurring patterns
  7. a natural-language summary

Everything preprocessed and ready for dashboards, bots, research, or algo-trading.

Top comments (0)