An open-source alternative to Yahoo Finance's market data APIs
Defeat Beta API
An open-source alternative to Yahoo Finance's market data APIs with higher reliability.
See the example guide for detailed usage instructions, and try it out directly in an interactive environment using .
The list of changes can be found in the Changelog
Introduction
✅ High-Performance & Reliable Data Engine: Provides a stable, reproducible market data source fully hosted on Hugging Face’s yahoo-finance-data dataset—eliminating scraping issues and rate limits. Powered by DuckDB’s OLAP engine and the `cache_httpfs` extension, the system delivers sub-second analytical queries with full SQL compatibility, giving you a unified, high-performance workflow for large-scale financial data.
✅ Extended Financial Data: Includes TTM EPS, TTM PE, Market Cap, PS Ratio, PB Ratio, PEG Ratio, ROE, ROIC, WACC, ROA, Equity Multiplier, Assert Turnover, SEC Filings, Earnings call transcripts, Stock News, Revenue by segment and Revenue by geography etc. (continuously expanding).
✅ Automated DCF Valuation: Generate comprehensive Discounted Cash Flow (DCF) analysis with professional Excel output. Automatically calculates WACC, projects 10-year cash flows, estimates enterprise value and fair price, and provides buy/sell recommendations—all in a ready-to-use, fully editable spreadsheet.
✅ LLM-Powered Analysis: Use Large Language Models (LLMs) to analyze earnings call transcripts, quarterly financial changes, and quarterly forecasts to extract key data, understand metric changes, and interpret forecast drivers.
✅ MCP Server implementation: A MCP server implementation for defeatbeta-api, provides AI access analysis through MCP. Click here to discover more ways to use MCP.
✅ Skills implementation: A Skills implementation for defeatbeta-api, enhances AI financial analysis capabilities with professional workflows. Compatible with Claude.ai, Manus, and other AI platforms that support skills.
Quickstart
Installation
Install defeatbeta-api from PYPI using pip:
MacOS / Linux
$ pip install defeatbeta-api
Windows
⚠️ Requires WSL/Docker Due to dependencies on cache_httpfs (unsupported on Windows):
Option 1: WSL (Recommended)
- Install WSL
- In WSL terminal:
$ pip install defeatbeta-api
Option 2: Docker
- Install Docker Desktop
- Run in Linux container:
docker run -it python:latest pip install defeatbeta-api
Usage
Insta
Tools (3)
get_financial_dataRetrieve historical and current financial metrics including EPS, PE, Market Cap, and more.run_dcf_analysisPerform a Discounted Cash Flow analysis for a given stock ticker.get_earnings_transcriptAccess earnings call transcripts for a specific company.Configuration
{"mcpServers": {"defeatbeta-api": {"command": "python", "args": ["-m", "defeatbeta_api.mcp"]}}}