Documentazione

Avvio rapido

From zero to data in seven steps. pip install finzdata, then pull pandas DataFrames ready for your backtest — or call the REST API directly.

Passo 1

Ottieni una chiave

Registrati su api.finzdata.com. Il free tier non richiede carta di credito e include 1,000 chiamate al giorno.

Passo 2

Installa

Installa il client Python ed esporta la tua chiave come variabile d'ambiente.

pip install finzdata
export FINZDATA_API_KEY=fz_...

Passo 3

Uso in stile yfinance

The client mirrors the yfinance interface: Ticker().history for one symbol, download for many.

import finzdata as yf

msft = yf.Ticker("MSFT")
df = msft.history(start="2020-01-01", auto_adjust=True)

both = yf.download(["MSFT", "AAPL"], start="2020-01-01")

Passo 4

COT e fondamentali

Use the client object for the non-price datasets. Fundamentals accept as_of for point-in-time queries.

import finzdata as yf

client = yf.Client()

cot = client.cot(report="legacy_fo", market="WHEAT")
f = client.fundamentals(ticker="AAPL", concept="Revenues", as_of="2023-06-30")

Passo 5

API REST

Authenticate with the X-API-Key header or the ?apikey= query parameter. Every endpoint returns JSON by default; add format=json|csv|parquet to change it.

curl -H "X-API-Key: fz_..." \
  "https://api.finzdata.com/v1/prices/daily?symbol=MSFT&start=2020-01-01"
/v1/cotRighe di posizionamento COT
/v1/cot/marketsElenco dei 431 mercati
/v1/prices/dailyBarre OHLCV giornaliere
/v1/prices/minuteIntraday OHLCV bars. interval=1min|5min|15min|30min|1hour (every bar size on every look-back bundle), adjust=none|all; end includes the whole day. Formato file e campioni
/v1/actionsSplit e dividendi
/v1/fundamentalsFatti societari XBRL SEC
/v1/futures/barsBarre futures per ogni contratto o continuo
/v1/gex/dailyGamma dealer point-in-time (GEX)
/v1/options/eodCatene opzioni end-of-day
/v1/ticks/{kind}Scambi tick
/v1/index/barsBarre indice
/v1/fx/barsBarre FX
/v1/crypto/barsBarre crypto
/v1/macroSerie macro per ogni vintage, inclusi elettricità, energia e carburanti
/v1/pulseCatalogo Global Macro Pulse
/v1/pulse/{name}Transiti navali, chiamate portuali, voli e traffico, pedaggi e congestione
/v1/datasetsMetadati dei dataset e copertura
/v1/meIl tuo piano e utilizzo

Rust

The official Rust client covers the same endpoints, async or blocking: cargo add finzdata (crates.io, docs.rs).

let fz = finzdata::Client::new()?;                       // reads FINZDATA_API_KEY
let es  = fz.futures_bars("ES", None, true, None, Some("1min"), Some("2024-01-02"), None).await?;
let gex = fz.gex("SPX", Some("2020-01-01"), None).await?;
let eur = fz.fx_bars("EURUSD", Some("1hour"), Some("2025-01-01"), None).await?;

Errori: 401 chiave mancante o non valida, 403 piano non include questi dati, 429 limite giornaliero di chiamate raggiunto.

Passo 6

Download bulk

For large pulls, submit a batch job with a JSON body, poll for completion, then download the zip. Links are valid for 7 days. Nightly full-history bundles are at GET /v1/bundles.

curl -X POST -H "X-API-Key: fz_..." \
  -H "Content-Type: application/json" \
  -d '{"dataset": "prices_daily", "symbols": ["MSFT"], "start": "2000-01-01", "format": "parquet"}' \
  https://api.finzdata.com/v1/batch

curl -H "X-API-Key: fz_..." \
  https://api.finzdata.com/v1/batch/JOB_ID
# -> {"status": "done", "download_url": "https://..."}

Passo 7

Riferimento API completo

Ogni parametro, campo di risposta e codice di errore è documentato su api.finzdata.com/docs.