Metadata-Version: 2.5
Name: quantset
Version: 0.1.0
Summary: 52,000+ global stocks (67 countries, 64yr US history), 734 crypto pairs, live quotes, 40-factor stock screener, consensus estimates, ETF look-through, correlations, macro curves & SEC financials in one Python SDK.
Project-URL: Homepage, https://quantset.dev
Project-URL: Documentation, https://quantset.dev/docs/quickstart
Project-URL: Live API Playground, https://quantset.dev/docs/api
Project-URL: Switch from yfinance, https://quantset.dev/docs/switch/yfinance
Project-URL: Switch from FMP, https://quantset.dev/docs/switch/fmp
Project-URL: MCP for Claude & Cursor, https://quantset.dev/docs/agents
Project-URL: Repository, https://github.com/quantset/quantset-python
Project-URL: Issues, https://github.com/quantset/quantset-python/issues
Author-email: QuantSet <hello@quantset.dev>
License: MIT
Keywords: analyst-estimates,backtesting,crypto-api,earnings-calendar,etf-holdings,fmp-alternative,forex-api,market-data,mcp,pandas,polars,quantitative-finance,stock-market-api,stock-screener,treasury-yields,yfinance-alternative
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: pandas
Requires-Dist: pandas>=2; extra == 'pandas'
Provides-Extra: polars
Requires-Dist: polars>=1; extra == 'polars'
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# QuantSet — The Institutional Python SDK for Global Stocks, SEC EDGAR XBRL, 4,899 ETFs, Estimates & Macro

**Stop stitching together broken `yfinance` scrapers, `429 Too Many Requests` IP bans, YTD 10-Q cash-flow traps, and overpriced legacy data feeds.**

**[QuantSet](https://quantset.dev)** gives Python quants, backtests, and AI agents **90,000+ global listings across 67 countries** (US daily OHLCV back to **1962**, S&P 500 back to **1927**), **127M+ reconciled SEC EDGAR XBRL facts (`10-K`, discrete quarterly `10-Q`, `Form 13F`, `Form 4` w/ Rule 10b5-1 flags, segments & debt walls)**, **4,899 ETF look-through holdings (`175k+` N-PORT rows)**, **Wall Street consensus estimates**, a **40+ factor point-in-time stock screener**, **734 crypto pairs**, **42 ECB FX currencies**, **hourly & 5-minute intraday bars**, **multi-asset correlation & drawdown analytics**, and **live U.S. Treasury/TIPS/FRED macroeconomic curves**—all behind one fast, typed Python client with `.to_df()` Pandas/Polars support and built-in credit-budget controls.

Zero signup required to try: every install works **immediately out of the box** on benchmark US, London, Tokyo, India, ETF, index, macro, and crypto symbols (`mw_demo`).

**[Live Playground](https://quantset.dev/docs/api)** · **[60-Second Quickstart](https://quantset.dev/docs/quickstart)** · **[vs. yfinance](https://quantset.dev/docs/switch/yfinance)** · **[1-Line FMP Migration](https://quantset.dev/docs/switch/fmp)** · **[Claude & Cursor MCP](https://quantset.dev/docs/agents)**

---

## Credit estimates and receipts

```python
from quantset import Client

with Client(max_credits_per_request=10, workflow_id="daily-research") as client:
    planned = {"ticker": "NVDA", "limit": 251}
    quote = client.estimate_credit_cost("GET", "/prices", params=planned)
    read = client.get_with_receipt("prices", max_credits=quote["maximum_credits"], **planned)
    print(read.receipt.credit_cost, read.receipt.credits_remaining)
    history = client.price_history("NVDA", limit=250, max_pages=5, credit_budget=5)
```

`rate_card()` and `estimate_credit_cost()` are free. The price ceiling is enforced on the server. A budgeted paginated read sends the remaining budget on each call and leaves `next_cursor` when stopped early. Use `page_receipts` to reconcile combined history pages and `QuantsetError.receipt` to inspect a refused request.


## Install & Run in 15 Seconds (No API Key Needed to Start)

```sh
pip install "quantset[pandas]"   # or: pip install "quantset[polars]" / pip install quantset
```

```python
import quantset as qs

# Five daily bars in one price request
df = qs.prices("NVDA", limit=5).to_df()

# Batch live/daily quotes across US stocks, London, Tokyo & crypto in 1 request
quotes = qs.quotes(["NVDA", "AAPL", "global:SHEL.L", "global:1301.T", "crypto:BTCUSDT"]).to_df()

# Wall Street forward EPS/revenue consensus + quarterly revenue/cash-flow fundamentals
est = qs.estimates("NVDA", metric="eps").to_df()
inc = qs.income(["AAPL"], period="quarterly", limit_per_instrument=8).to_df()
```

Ready for the full **52,000+ symbol** universe and market-wide stock screening? Set `QUANTSET_API_KEY` (choose a prepaid pack or a monthly credit pool; consult the published rate card for batch and history costs). **[Get a full key →](https://quantset.dev/pricing)**

---

## Why Quants & Builders Move Off `yfinance` & Fragmented APIs

- **Zero `429 Too Many Requests` or cookie/crumb bans on AWS & GitHub Actions:** Clean REST contract with explicit `X-RateLimit-Remaining` and `Retry-After` headers.
- **Built-in quant primitives (not just raw bars):** Total-return series (dividends reinvested), peak-to-trough drawdowns, multi-asset USD correlation matrices, point-in-time historical P/E, and S&P 500 benchmark alpha out of the box.
- **40+ factor institutional screener:** Filter 14,000+ US listings by `ROIC`, `EV/EBITDA`, `EV/FCF`, `FFO` (for REITs), `SMA-50/200`, dividend-increase streaks, and net buyback share-count shrinkage.
- **Reverse ETF look-through (`4,899` funds):** See every stock inside an ETF *or* reverse-query which ETFs hold a stock and at what weight (`etf-exposures`).
- **Evidence-checked `adj_close` & zero fake zeros:** Splits and dividends are cross-checked against actual price gaps. Unverified or missing values return `None` (`null`)—never silently coerced to `0`.
- **1-line drop-in FMP compatibility:** Migrating an existing Financial Modeling Prep codebase? Swap the base URL and keep your `/stable/` or `/v3/` paths unchanged.

---

## Everything Under One Client

Pass a catalog ticker such as `NVDA` or `7203.T`. Use canonical IDs such as `global:SHEL.L`, `crypto:BTCUSDT` or `index:SPX` to select an exact listing. Ambiguous tickers return canonical candidates.

| What you're building | Built-in methods (`qs.*` & `client.*`) |
| --- | --- |
| **Prices, Intraday & Live Sessions** | `instruments`, `quotes`, `prices`, `intraday`, `snapshot`, `get("market-session", ticker="NVDA")` |
| **40-Factor Stock Screener & Peers** | `screener`, `fundamentals`, `get("peers", ticker="NVDA")` |
| **Quant Returns, Alpha & Correlations** | `get("total-return", ticker="NVDA")`, `get("drawdowns", ticker="NVDA")`, `get("analytics/correlations", ...)` |
| **Wall Street Estimates & Calendars** | `estimates`, `earnings`, `get("analyst-ratings", ticker="NVDA")`, `get("calendar/earnings")` |
| **ETFs, Splits, Dividends & Buybacks** | `etf_holdings`, `get("etf-exposures", ticker="NVDA")`, `corporate_actions` |
| **Macro, Yield Curves (TIPS/2s10s) & FX** | `treasury_yields`, `macro_series`, `macro`, `fx` |
| **Deep Financials, Segments & Insiders** | `income`, `balance_sheet`, `cash_flow`, `sec_facts`, `get("segments", ticker="NVDA")`, `get("insider-activity", ticker="NVDA")` |

```python
with qs.Client() as client:
    # Multi-asset USD correlation & volatility matrix
    corr = client.get("analytics/correlations", tickers=["NVDA", "AAPL", "crypto:BTCUSDT"])

    # U.S. Treasury curve (1M–30Y + 2s10s spread + TIPS real yields) & 42 ECB FX rates
    curve = client.treasury_yields(limit=5)
    fx = client.fx("EUR,GBP,JPY", latest_only=True)

    # Snapshot-pinned factor screen: high-ROIC net share-cannibals (full key)
    for page in client.paginate("screener", max_pages=3, min_roic=20, max_share_count_change_1y=-2, limit=100):
        print(page.snapshot_id, len(page.data))
```

## Pagination and errors

`prices()` reads one page. To assemble ascending history within a request budget, call
`price_history("NVDA", start="2024-01-01", limit=500, max_pages=4)`.
If the budget ends before the data, the result retains `next_cursor` and `snapshot_id`.

- Multi-page reads stay pinned to `snapshot_id` so nightly pipeline updates never corrupt a cross-sectional scan mid-loop.
- HTTP errors raise `qs.QuantsetError` (subclass of `httpx.HTTPStatusError`) with `exc.code`, `exc.detail`, `exc.field`, `exc.candidates` and `exc.retry_after`. For `snapshot_changed`, discard the partial result and restart at page one.

## Links

- **Website & Pricing:** [quantset.dev](https://quantset.dev)
- **Interactive API Reference:** [quantset.dev/docs/api](https://quantset.dev/docs/api)
- **Guides & Migration Playbooks:** [quantset.dev/docs/guides](https://quantset.dev/docs/guides)
- **Full LLM contract:** [api.quantset.dev/llms-full.txt](https://api.quantset.dev/llms-full.txt)
