# Financial Data API Guide for Prices, Fundamentals and COT

Source: https://finzdata.com/guides/financial-data-api

A practical guide to a financial data API for prices, fundamentals, COT, macro and alternative data with Python examples and backtesting notes.

Financial Data API

# Financial Data API for market data, fundamentals and backtesting

A financial data API provides programmatic access to market data, fundamentals, positioning and macro series as structured data. FinzData offers a market-data API and Python client that mirrors yfinance with Ticker, history and download returning pandas DataFrames, plus REST access at https://api.finzdata.com returning JSON or CSV. Parquet and bulk files are available on paid plans.

[Get a free API key](https://api.finzdata.com/) [See pricing](https://finzdata.com/shop) [Download free samples](https://finzdata.com/samples)

## What a financial data API is

A financial data API exposes prices, fundamentals, positioning and macro series over HTTP or a client library. Responses are typically JSON or CSV and can be loaded into pandas for analysis. FinzData provides both a REST API and a Python client installed with `pip install finzdata` and used as `import finzdata as yf`. The client mirrors yfinance with Ticker, history and download returning pandas DataFrames.

Use cases include backtesting, research notebooks, dashboards and ETL pipelines. The API supports daily, hourly, 5-minute and 1-minute bars, with prices stored as traded and splits and dividends published and applied on read via adjust='none'|'splits'|'all'.

## Core dataset categories

A financial data API is useful when it covers multiple categories with consistent identifiers and timestamps.

- **Prices.** 16,000+ US stocks going back more than 26 years with history starting January 2000 including delisted names for survivorship-free research, 231 ETFs. Daily, hourly, 5-minute and 1-minute bars.

- **Fundamentals.** SEC XBRL company facts point-in-time by filing date, financial statements, earnings release dates from 8-K Item 2.02 since 2004, daily point-in-time valuation from 2009 including P/E, P/B, P/S, EV/EBITDA, market cap and dividend yield.

- **Positioning.** CFTC Commitments of Traders legacy, disaggregated, financial futures and supplemental reports for 950+ futures markets with history since 1986 weekly, COT index 0-100 computed. 13F institutional holdings, FINRA short interest since 2017, SEC Form 4 insider trades.

- **Macro.** 18,000+ US macro series with every revision using FRED/ALFRED vintages.

- **Alternative data.** Dealer gamma exposure levels nightly.

## What matters for backtesting

Backtesting requires point-in-time correctness, survivorship-free history and consistent adjustments.

- Survivorship bias free prices with delisted names included.

- Adjustments applied on read so you can choose adjust='none'|'splits'|'all'.

- Point-in-time fundamentals by filing date, not restated values.

- Macro vintages to replicate decisions with data available at the time.

- Intraday bars with consistent timestamps for execution modeling.

FinzData stores prices as traded with splits and dividends published and applied on read. Fundamentals are point-in-time by filing date and valuation metrics are daily point-in-time from 2009.

## Quick start with Python

```
import finzdata as yf

# yfinance style
ticker = yf.Ticker("AAPL")
hist = ticker.history(start="2020-01-01", interval="1d")
print(hist.head())

# Client style
c = yf.Client()
prices = c.prices("AAPL", adjust="splits", start="2020-01-01")
fund = c.fundamentals(ticker="AAPL", concept="Revenue", as_of="2024-12-31")
val = c.valuation("AAPL", start="2024-01-01")
cot = c.cot(report="legacy", market="CORN")
macro = c.macro(id="GDP", as_of="2024-01-01")
si = c.short_interest("AAPL")
earn = c.earnings_dates("AAPL")
```

## Access and samples

Free tier includes last 12 months of every dataset, 1,000 API calls per day, no card required. Paid look-back bundles are $195 for the first 5 years, $95 for each further 5 years, plus $19.95 per month for daily updates. Institutional is $975 once plus $59.95 per month.

Explore live charts at [https://finzdata.com/explore](https://finzdata.com/explore). Free 10-row samples are at [https://finzdata.com/samples](https://finzdata.com/samples). Documentation is at [https://finzdata.com/docs](https://finzdata.com/docs) and pricing at [https://finzdata.com/pricing](https://finzdata.com/pricing).

## Frequently asked questions

### What is a financial data API?

A financial data API provides programmatic access to market data, fundamentals, positioning and macro series via HTTP or a client library, returning structured data such as JSON, CSV or pandas DataFrames for analysis and backtesting.

### What datasets does a financial data API typically include?

Prices, fundamentals, positioning and macro series. FinzData covers 16,000+ US stocks back to January 2000 including delisted names, 231 ETFs, intraday bars, SEC XBRL fundamentals point-in-time, CFTC COT, 13F holdings, short interest, 18,000+ macro series with revisions and dealer gamma.

### How do I avoid survivorship bias with a financial data API?

Use a source that includes delisted names and stores prices as traded with splits and dividends published and applied on read. FinzData provides survivorship-free history starting January 2000 with delisted names included.

### Can I use a financial data API for backtesting?

Yes. Backtesting requires point-in-time fundamentals, survivorship-free prices and macro vintages. FinzData provides point-in-time XBRL facts by filing date, daily point-in-time valuation from 2009 and macro series with every revision.

### Is there a Python client for a financial data API?

FinzData provides a Python client installed with pip install finzdata and used as import finzdata as yf. It mirrors yfinance with Ticker, history and download returning pandas DataFrames, and a Client class for prices, cot, macro, fundamentals, statements, valuation, short_interest and earnings_dates.

## Related

- [Market Data API](https://finzdata.com/market-data-api)

- [Stock API](https://finzdata.com/stock-api)

- [Valuation Data](https://finzdata.com/valuation-data)

- [Point-in-time fundamentals backtesting](https://finzdata.com/guides/point-in-time-fundamentals-backtesting)

- [Survivorship bias free stock data](https://finzdata.com/guides/survivorship-bias-free-stock-data)

- [Macro data vintages Python](https://finzdata.com/guides/macro-data-vintages-python)

[Get a free API key](https://api.finzdata.com/) [See pricing](https://finzdata.com/shop) [Download free samples](https://finzdata.com/samples)
🌐EnglishDeutschEspañolFrançaisItalianoPortuguês日本語简体中文한국어
