# Yahoo Finance Data API - Prices, Statements & Market Data

Open, no-auth HTTP API and MCP server exposing Yahoo Finance data via yfinance - historical prices (OHLCV, adjusted close), full financial statements (balance sheet, income, cash flow; annual and quarterly), detailed company info and market data for any ticker, in JSON and Excel-friendly formats. Built for AI agents first, humans second: every page here has a Copy-as-Markdown button so you can hand it straight to your agent.

Kind: REST / HTTP API, MCP Server (AI agents), Data API, Open - no auth
Base URL: https://yfin-h.tigzig.com
Docs: https://yfin-h.tigzig.com/docs  ·  OpenAPI: https://yfin-h.tigzig.com/openapi.json
Full page: https://www.tigzig.com/apis/yahoo-finance

## Overview

A financial-data extraction service over yfinance. Exposes Yahoo Finance financial statements, market data and OHLCV price histories for any ticker, two ways over one backend:
- REST + Swagger at yfin-h.tigzig.com/* - /get-all-prices/, /get-balance-sheet/, /get-income-statement/, /get-cash-flow/, /get-detailed-info/, /get-market-data/, quarterly variants, and Excel-friendly /excel/* endpoints.
- MCP for AI agent clients - the same data as tool calls (see below).

AI agents: open (no auth), listed in the RFC 9727 catalog at https://api.tigzig.com/.well-known/api-catalog ; OpenAPI at https://yfin-h.tigzig.com/openapi.json .

Most endpoints take a tickers query param (comma-separated for multiple symbols); price endpoints add start_date / end_date. Full parameter list in the API Endpoints section, or try them in Swagger: https://yfin-h.tigzig.com/docs

## MCP Server (for AI agents)

Connect an AI agent directly and let it pull statements and prices. No auth. Three transports:
- https://yfin-h.tigzig.com/v1/mcp/http - Streamable HTTP (recommended; MCP 2025-03-26).
- https://yfin-h.tigzig.com/v1/mcp/sse - SSE (legacy fallback).
- https://yfin-h.tigzig.com/mcp - original SSE endpoint (back-compat).

Add to Claude.ai: Settings -> Connectors -> Add custom connector -> paste the Streamable HTTP URL (fall back to SSE) -> approve. Same URLs work for Cursor, n8n, any MCP client.

## How it works

- Financial statements - balance sheet, income statement, cash flow; annual and quarterly; JSON or Excel-friendly.
- Market data - historical OHLCV with adjustments, market cap and share stats, detailed company info.
- FastAPI + fastapi-mcp (exposes FastAPI endpoints as MCP tools), Pydantic validation.
- Deployed on Coolify (Hetzner) behind Cloudflare.

## Build your own (open source)

Clone and run your own:
1. Clone https://github.com/amararun/shared-yfin-coolify
2. pip install -r requirements.txt
3. uvicorn main:app --reload - MCP at http://localhost:8000/mcp

Key dependencies: FastAPI, fastapi-mcp, yfinance, pandas.

Self-hosting a public MCP server is your responsibility for security - a public endpoint needs edge rate limiting, abuse detection, secret hygiene. Full checklist: https://www.tigzig.com/security

## API Endpoints (REST / HTTP)

Base URL: `https://yfin-h.tigzig.com`

### GET /excel/get-balance-sheet/
Get Balance Sheet Excel Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/excel/get-balance-sheet/?tickers=AAPL"
### GET /excel/get-cash-flow/
Get Cash Flow Excel Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/excel/get-cash-flow/?tickers=AAPL"
### GET /excel/get-income-statement/
Get Income Statement Excel Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/excel/get-income-statement/?tickers=AAPL"
### GET /excel/get-quarterly-cash-flow/
Get Quarterly Cash Flow Excel Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/excel/get-quarterly-cash-flow/?tickers=AAPL"
### GET /excel/get-quarterly-income-statement/
Get Quarterly Income Statement Excel Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/excel/get-quarterly-income-statement/?tickers=AAPL"
### GET /get-adj-close/
Get Adj Close Endpoint
Params:
  - `tickers` (query, required): 
  - `start_date` (query, required): 
  - `end_date` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-adj-close/?tickers=AAPL&start_date=2020-01-01&end_date=2024-12-31"
### GET /get-all-prices/
Get All Prices Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
  - `start_date` (query, required): Start date in YYYY-MM-DD format (e.g., '2023-01-01')
  - `end_date` (query, required): End date in YYYY-MM-DD format (e.g., '2023-12-31')
  - `format` (query): Response format: 'json' (default) returns nested JSON, 'tsv' returns compact tab-delimited string optimized for LLM context windows (~70% fewer tokens)
Example: curl "https://yfin-h.tigzig.com/get-all-prices/?tickers=AAPL&start_date=2020-01-01&end_date=2024-12-31&format=parquet"
### GET /get-balance-sheet/
Get Balance Sheet Endpoint
Params:
  - `tickers` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-balance-sheet/?tickers=AAPL"
### GET /get-cash-flow/
Get Cash Flow Endpoint
Params:
  - `tickers` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-cash-flow/?tickers=AAPL"
### GET /get-detailed-info/
Get Detailed Info Endpoint
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/get-detailed-info/?tickers=AAPL"
### GET /get-income-statement/
Get Income Statement Endpoint
Params:
  - `tickers` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-income-statement/?tickers=AAPL"
### GET /get-market-data/
Get Market Data
Params:
  - `tickers` (query, required): Comma-separated list of Yahoo Finance ticker symbols (e.g., 'AAPL,MSFT,GOOG')
Example: curl "https://yfin-h.tigzig.com/get-market-data/?tickers=AAPL"
### GET /get-quarterly-cash-flow/
Get Quarterly Cash Flow Endpoint
Params:
  - `tickers` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-quarterly-cash-flow/?tickers=AAPL"
### GET /get-quarterly-income-statement/
Get Quarterly Income Statement Endpoint
Params:
  - `tickers` (query, required): 
Example: curl "https://yfin-h.tigzig.com/get-quarterly-income-statement/?tickers=AAPL"
