Model or dataset
defeat-beta/defeatbeta-api avatar
defeat-beta/defeatbeta-api

defeatbeta-api: Yahoo Finance Market Data Without the Scraping and Rate Limits

An open-source alternative to Yahoo Finance's market data APIs with higher reliability.

788 stars62 forksPythonApache-2.0

At a glance

What is it?
defeatbeta-api is an Apache-2.0 licensed Python package that answers financial data queries with DuckDB over a Hugging Face hosted dataset, caching only the Parquet and JSON ranges a query needs. It suits quantitative and analyst work that outgrows the Yahoo Finance endpoints.
Who is it for?
defeatbeta-api fits an analyst or quant who needs price history, financial statements and valuation inputs without living with the rate limits and breakage of the Yahoo endpoints, and who can accept a dependency on a hosted dataset. It is the wrong choice if you need live tick data, since the source is a periodically updated dataset, and the wrong choice if your environment forbids outbound network access to the dataset host.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A market data source you query instead of scrape

defeatbeta-api is described as an open-source alternative to Yahoo Finance's market data APIs with higher reliability. The word alternative is doing specific work: the shape of the API stays familiar, a Ticker object with methods like price and quarterly_income_statement, but the data underneath comes from somewhere that does not punish you for asking. The stated reason is a high-performance and reliable data engine that provides a stable, reproducible market data source fully hosted on the Hugging Face yahoo-finance-data dataset, eliminating scraping issues and rate limits. Reproducible is the word that matters for research: a dataset with a version behind it can be pinned, so a result computed last quarter can be recomputed next quarter and land on the same numbers.

DuckDB over Parquet with a range-fetching local cache

The query engine is DuckDB, and the caching layer is described as a local file cache that fetches only the Parquet and JSON ranges needed by each query. That is the design decision that separates this from a bulk download. A full market history dataset is large, and pulling all of it to answer one question about one ticker is slow and wasteful. Fetching only the byte ranges a query touches means the first call is a partial download of the relevant slice and later calls hit the local copy, and DuckDB then runs the query over the local Parquet files as if they were a database. The package manifest confirms the shape: duckdb is pinned exactly, alongside pandas, requests with socks support, httpx with http2 and socks, fsspec for the filesystem layer, and urllib3. The HTTP stack matters here because range requests over a resumable connection are what make partial fetching practical.

The API surface, and how a Ticker call reads

You instantiate the Ticker class with a company ticker symbol, and the object exposes the data as methods.

python
import defeatbeta_api
from defeatbeta_api.data.ticker import Ticker
ticker = Ticker('TSLA')

The price method returns the daily history as a frame.

python
ticker.price()

And the statements are reached the same way, with a pretty-printed table for reading.

python
statement = ticker.quarterly_income_statement()
print(statement.print_pretty_table())

The output in the documentation is a pandas frame with a symbol, report date and the open, close, high, low and volume columns, running from 2010 into 2025 for the example ticker. The statements object has its own print_pretty_table method, and tabulate and rich are both in the dependency list, which is what the table rendering uses.

The data goes well beyond price history

The extended financial data list is where the package justifies itself against a plain price scraper. The documented measures include TTM EPS, TTM PE, market cap, the PS, PB and PEG ratios, ROE, ROIC, WACC, ROA, the equity multiplier and asset turnover, each available historically rather than as a single current value. There is also SEC filings, earnings call transcripts, stock news, revenue by segment and revenue by geography. The last two are the ones that cost real effort in any pipeline, because they come from filing documents rather than from a financial data feed, and having them broken out by segment and by geography is what a competitor or sector analysis actually needs. The list is described as continuously expanding, which is a fair description of a package chasing the long tail of valuation inputs.

DCF valuation that ends in a spreadsheet you can argue with

There is an automated DCF valuation that goes further than a number. It produces a comprehensive discounted cash flow analysis with professional Excel output, and it automatically calculates WACC, projects ten-year cash flows, estimates enterprise value and a fair price, and gives buy or sell recommendations, all in a ready-to-use and fully editable spreadsheet. The editable part is what makes it usable rather than a black box. A valuation delivered as a file you can open, change an assumption in and recompute is a valuation you can take into a meeting, whereas a returned fair value is a number you either trust or ignore. The openpyxl dependency is what produces the Excel output, and the WACC calculation it performs internally is the same measure listed among the extended data, so the inputs and the model come from the same source.

LLM analysis over transcripts, changes and forecasts

The package can send earnings call transcripts, quarterly financial changes and quarterly forecasts to a large language model to extract key data, understand what changed between quarters and interpret what is driving a forecast. The distinction between the three inputs is worth keeping straight. Transcripts are unstructured text where the useful signal is what management said. Quarterly financial changes are structured comparisons where the question is which line moved and why. Forecasts are forward-looking statements where the question is what the company itself expects. Feeding all three to a model with a task-specific prompt is a reasonable division of labour, and the dependencies show the shape of it: openai is pinned as a direct dependency and pysbd is there for sentence boundary detection, which is what you need before chunking transcripts for a model. The openai version is a floor rather than a pin, so a newer client can be used.

MCP server and skills for agent access

Two integrations are shipped alongside the Python API. There is an MCP server implementation that provides AI access to the analysis through the Model Context Protocol, and the documentation points at it for further ways of using MCP. There is also a skills implementation that enhances AI financial analysis with professional workflows, and it is described as compatible with Claude.ai, Manus and other AI platforms that support skills. The reason both exist is the same direction of travel as the LLM analysis feature: if an agent is going to do the analysis, the data access has to be reachable by an agent, and both MCP and skills are the two conventions agents use for that. The repository has matching mcp/ and skills/ directories with their own readme files, and the badge for the MCP server in the readme points at a public directory of published servers.

Installation, the DuckDB pin, and the change log

The package installs from PyPI with pip, and the badge declares Python 3.11 or newer, which the project metadata confirms with a requires-python of at least 3.11.

bash
$ pip install defeatbeta-api

Windows is supported natively since v0.0.60, and the note explains why that was a change worth calling out: the current dataset cache uses the same Python filesystem interface on Windows, macOS and Linux, so the cache is not a separate Windows implementation. The detail that deserves attention before you install is the DuckDB version. The documentation states that this source revision pins the official DuckDB development build 2.0.0.dev2610011535 for its query-waiting fix, while the package metadata lists duckdb as pinned to 1.5.3. So there are two versions in play across the project, a released one in the dependency list and a development one referenced for a specific fix, with an upgrade validation report under benchmark/reports. The changelog lives in CHANGELOG.rst, and the repository also ships notebooks, a benchmark directory and a test directory.

Editorial conclusion

defeatbeta-api fits an analyst or quant who needs price history, financial statements and valuation inputs without living with the rate limits and breakage of the Yahoo endpoints, and who can accept a dependency on a hosted dataset. It is the wrong choice if you need live tick data, since the source is a periodically updated dataset, and the wrong choice if your environment forbids outbound network access to the dataset host. Before you rely on it, pin the DuckDB version, because the source revision pins a specific development build for a query-waiting fix.

Frequently asked questions

How is defeatbeta-api different from calling Yahoo Finance directly?

The data comes from a Hugging Face hosted dataset queried with DuckDB rather than from the Yahoo endpoints, which the project describes as eliminating scraping issues and rate limits and providing a stable, reproducible source that can be pinned.

What does a local file cache change about the download size?

The local file cache fetches only the Parquet and JSON ranges each query needs, so a first call downloads the relevant slice rather than the whole dataset, and later calls run against the local copy through DuckDB.

Does defeatbeta-api produce a discounted cash flow valuation?

Yes. It generates a DCF analysis with Excel output, calculating WACC, projecting ten-year cash flows, estimating enterprise value and fair price, and giving buy or sell recommendations in a fully editable spreadsheet.

Can an AI agent use defeatbeta-api?

Yes. The repository ships an MCP server implementation for AI access to the analysis, plus a skills implementation with professional workflows that is compatible with Claude.ai, Manus and other platforms supporting skills.

Which DuckDB version does defeatbeta-api need?

The project metadata pins duckdb to 1.5.3, and the documentation notes that this source revision also pins the official DuckDB development build 2.0.0.dev2610011535 for its query-waiting fix, with an upgrade validation report in the benchmark directory.

Official sources

  1. defeat-beta/defeatbeta-api on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/defeat-beta-defeatbeta-api.svg)](https://hysenlabs.com/projects/defeat-beta-defeatbeta-api)

Was this useful?