Metadata-Version: 2.5
Name: quantset
Version: 0.1.3
Summary: QuantSet (https://quantset.dev) — Institutional market data API for AI hedge funds, autonomous trading agents & quant backtests in Python: 90,000+ global stocks (67 countries, 64yr history), reconciled SEC EDGAR XBRL financials (10-K, 10-Q, 13F, Form 4), 4,899 ETF look-throughs, Wall Street consensus estimates, 40-factor screener, crypto, FX & macro curves.
Project-URL: Homepage, https://quantset.dev
Project-URL: Pricing and Sandbox, https://quantset.dev/#pricing
Project-URL: Documentation, https://quantset.dev/docs/quickstart
Project-URL: Live API Playground, https://quantset.dev/docs/api
Project-URL: SEC EDGAR XBRL Guide, https://quantset.dev/docs/guides/sec-edgar-xbrl-api
Project-URL: 13F and Form 4 Guide, https://quantset.dev/docs/guides/13f-insider-float-api
Project-URL: Analyst Estimates Guide, https://quantset.dev/docs/guides/analyst-estimates-upgrades-api
Project-URL: ETF and Treasury Guide, https://quantset.dev/docs/guides/etf-holdings-treasury-yield-api
Project-URL: Global Markets Guide, https://quantset.dev/docs/global-markets
Project-URL: Data Verification, https://quantset.dev/docs/data-quality
Project-URL: MCP for Claude and 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: ai-hedge-fund,analyst-estimates,backtesting,crypto-api,dcf-valuation,earnings-calendar,etf-holdings,financial-statements-api,forex-api,form-13f,fundamental-data,insider-trading-form-4,market-data,mcp,pandas,polars,quantitative-finance,sec-edgar-xbrl,stock-market-api,stock-screener,trading-agents,treasury-yields
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 — Build AI Hedge Funds, Autonomous Trading Agents & Quant Backtests in Python

**Power your AI hedge fund, autonomous equity research agents, systematic backtesters, and multi-asset trading platforms with provenance-stamped institutional market data.**

**[QuantSet](https://quantset.dev)** gives Python quants, AI agent builders, and trading systems **90,000+ global stocks across 67 countries** (64 years of survivorship-checked US daily OHLCV back to **1962**; S&P 500 to **1927**), **127M+ reconciled SEC EDGAR XBRL facts (`10-K`, discrete quarterly `10-Q`, `Form 13F`, `Form 4` w/ Rule 10b5-1 insider flags, segments & debt walls)**, **4,899 ETF look-through holdings (`175k+` N-PORT constituents)**, **Wall Street consensus estimates & price targets**, a **40+ factor point-in-time stock screener**, **734 crypto pairs**, **42 FX currencies**, **hourly & 5-minute intraday bars**, and **live U.S. Treasury / TIPS / FRED macroeconomic curves**—all in one fast, typed Python SDK with `.to_df()` Pandas & Polars support.

Zero signup required to try: 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)** · **[SEC EDGAR XBRL Guide](https://quantset.dev/docs/guides/sec-edgar-xbrl-api)** · **[Data Verification](https://quantset.dev/docs/data-quality)** · **[7 Buyside Agent Skills](https://github.com/quantset/skills)**

---

## 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

# 1. Batch quotes across New York, London, Tokyo & Crypto in one call
quotes = qs.quotes(["NVDA", "AAPL", "global:SHEL.L", "global:1301.T", "crypto:BTCUSDT"]).to_df()

# 2. 64-year split & dividend verified daily OHLCV -> Pandas/Polars DataFrame
prices = qs.prices("NVDA", limit=250).to_df()

# 3. Wall Street forward EPS/Revenue consensus + discrete quarterly SEC 10-Q income statements
est = qs.estimates("NVDA", metric="eps").to_df()
inc = qs.income(["NVDA", "AAPL"], period="quarterly", limit_per_instrument=8).to_df()
```

Unlock all **90,000+ global symbols**, 64-year backtest histories, and full-market factor screening with a `$19` Starter Pack or `$39/mo` Developer plan at **[quantset.dev/pricing](https://quantset.dev/pricing)**.

---

## What You Can Build With QuantSet

### 1. Autonomous AI Hedge Funds & Multi-Agent Valuation Desks
Feed LangGraph, CrewAI, AutoGen, or custom Claude/OpenAI agents clean, hallucination-free fundamental context, Wall Street consensus bars, and SEC filing citations:

```python
with qs.Client() as client:
    # One-call AI Agent Context Pack: snapshot multiples, 4Y financials, top 13F hedge-fund holders, peers & news
    context = client.get("context", ticker="us:NVDA")

    # Audit C-suite Form 4 open-market insider buying vs. pre-scheduled Rule 10b5-1 sales + 13F whales
    insiders = client.get("sec/insider-transactions", ticker="us:NVDA", limit=50)
    whales = client.get("institutional-ownership", ticker="us:NVDA", limit=25)
```

### 2. Zero-Lookahead Point-in-Time Factor Screening & Backtesting
Screen across 40+ valuation, quality, momentum, and shareholder-yield factors (`ROIC`, `EV/FCF`, `EV/EBITDA`, `FFO`, `SMA-200`, net buyback share shrinkage) pinned to an exact historical `as_of` date so your backtest never suffers from lookahead bias:

```python
with qs.Client() as client:
    # Find high-ROIC compounders actively cannibalizing their own share count
    winners = client.screener(
        min_roic=20,
        max_ev_to_fcf=25,
        max_share_count_change_1y=-2,
        limit=50,
    ).to_df()

    # Pull dividend-reinvested total return, max drawdowns & S&P 500 benchmark alpha
    tr = client.get("total-return", ticker="us:AAPL", limit=250)
    dd = client.get("drawdowns", ticker="us:AAPL", limit=250)
```

### 3. Multi-Asset Portfolio Risk & 4,899-ETF Look-Through Engines
Unpack any of 4,899 ETFs down to their exact Form N-PORT underlying stock weights—or flip it around to see every ETF holding a specific stock—plus true USD correlation matrices:

```python
with qs.Client() as client:
    # Which ETFs have the highest portfolio weight in NVDA right now?
    etf_crowding = client.get("etf-exposures", ticker="us:NVDA", limit=25).to_df()

    # Cross-asset USD correlation & volatility matrix across US equities, global stocks & crypto
    corr = client.get("analytics/correlations", tickers=["us:NVDA", "global:SHEL.L", "crypto:BTCUSDT"])
```

---

## Why Quants & AI Teams Build on QuantSet

- **Every US Financial Figure Reconciles to SEC EDGAR XBRL:** Carries `form` (`10-K`/`10-Q`), SEC `accession`, public filing date (`available_at` for point-in-time backtests), and direct `sec.gov` highlight citations.
- **True Discrete Quarters (Never YTD 10-Q Cash-Flow Traps):** Automatically separates Q2/Q3 year-to-date cash flows into true discrete 3-month quarters (`period_basis: "discrete_quarter"`).
- **3-Way Evidence-Checked `adj_close` & Zero Fake Zeros:** Splits and dividends are cross-checked against actual price gaps. Unreported line items return `None` (`null`)—never silently coerced to `0`.
- **Built-in Quant Primitives:** 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.
- **Deterministic Rate & Snapshot Headers:** Explicit `X-RateLimit-Remaining`, `Retry-After`, and `X-Warehouse-Snapshot-Id` headers for reliable production and CI/CD pipelines.

---

## Full Method Reference (`qs.*` & `client.*`)

| Domain | Built-in SDK Methods |
| --- | --- |
| **Global Quotes, 64Y History & Intraday** | `instruments`, `quotes`, `prices`, `price_history`, `intraday`, `snapshot`, `get("market-session", ticker="NVDA")` |
| **40-Factor Stock Screener & Peer Comps** | `screener`, `fundamentals`, `get("peers", ticker="NVDA")`, `get("context", ticker="NVDA")` |
| **Quant Returns, Alpha & Correlations** | `get("total-return", ticker="NVDA")`, `get("drawdowns", ticker="NVDA")`, `get("analytics/correlations", ...)` |
| **Wall Street Consensus, Targets & Earnings** | `estimates`, `earnings`, `get("analyst-consensus", ticker="NVDA")`, `get("analyst-ratings", ticker="NVDA")`, `get("calendar/earnings")` |
| **4,899 ETFs, Splits, Dividends & Buybacks** | `etf_holdings`, `get("etf-exposures", ticker="NVDA")`, `corporate_actions` |
| **Macro, Treasury/TIPS Curves & 42 FX Pairs** | `treasury_yields`, `macro_series`, `macro`, `fx` |
| **SEC XBRL Statements, Segments & Insiders** | `income`, `balance_sheet`, `cash_flow`, `sec_facts`, `get("segments", ticker="NVDA")`, `get("debt-maturities", ticker="NVDA")`, `get("insider-activity", ticker="NVDA")`, `get("institutional-ownership", ticker="NVDA")` |

---

## Snapshot-Pinned Pagination & Error Handling

- `price_history("NVDA", start="2020-01-01", limit=500, max_pages=10)` automatically paginates and returns oldest-first ascending bars pinned to one immutable `snapshot_id`.
- HTTP errors raise `qs.QuantsetError` (subclass of `httpx.HTTPStatusError`) with `exc.code`, `exc.detail`, `exc.field`, `exc.candidates`, and `exc.retry_after`.

## Technical Guides & Links

- **Homepage & Pricing:** [https://quantset.dev](https://quantset.dev)
- **Interactive API Reference (45+ Endpoints):** [https://quantset.dev/docs/api](https://quantset.dev/docs/api)
- **SEC EDGAR & XBRL Financial Statements API:** [https://quantset.dev/docs/guides/sec-edgar-xbrl-api](https://quantset.dev/docs/guides/sec-edgar-xbrl-api)
- **Form 13F Institutional Holdings & Form 4 Insiders API:** [https://quantset.dev/docs/guides/13f-insider-float-api](https://quantset.dev/docs/guides/13f-insider-float-api)
- **Analyst Consensus Estimates & Price Targets API:** [https://quantset.dev/docs/guides/analyst-estimates-upgrades-api](https://quantset.dev/docs/guides/analyst-estimates-upgrades-api)
- **ETF Holdings (4,899 Funds) & U.S. Treasury Yield Curve API:** [https://quantset.dev/docs/guides/etf-holdings-treasury-yield-api](https://quantset.dev/docs/guides/etf-holdings-treasury-yield-api)
- **Adjusted Close, Splits & Dividends Verification:** [https://quantset.dev/docs/guides/adjusted-close-splits-api](https://quantset.dev/docs/guides/adjusted-close-splits-api)
- **Global Stock Data API (67 Countries):** [https://quantset.dev/docs/global-markets](https://quantset.dev/docs/global-markets)
- **Data Verification & Provenance Methodology:** [https://quantset.dev/docs/data-quality](https://quantset.dev/docs/data-quality)
- **7 Buyside Skills for Claude Code & Cursor:** [https://github.com/quantset/skills](https://github.com/quantset/skills)
- **Full LLM Contract (`llms-full.txt`):** [https://api.quantset.dev/llms-full.txt](https://api.quantset.dev/llms-full.txt)
