# StableFinance API StableFinance wraps the Financial Datasets AI API (US equities fundamentals, prices, SEC filings, 13F, insider trades, central-bank rates) with x402 and MPP pay-per-request access. No Financial Datasets account required. Base URL: https://stablefinance.dev All data endpoints cost $0.02 per successful call. US stocks only — no crypto, options, FX, or international equities. Identifier rule: most company-scoped endpoints accept `ticker` OR `cik` (mutually exclusive); 13F accepts `ticker` OR `filer_cik`. ## Happy Paths ### Fundamental analysis on a single company 1. GET /api/company/facts?ticker=AAPL — metadata (sector, industry, CIK). 2. GET /api/financials?ticker=AAPL&period=annual&limit=5 — income, balance, cash flow. 3. GET /api/financial-metrics/snapshot?ticker=AAPL — live ratios, market cap. 4. GET /api/earnings?ticker=AAPL&limit=4 — recent quarterly results. ### Stock screener -> drilldown 1. POST /api/financials/search/screener — filter by fundamental criteria (gross_margin, revenue_growth, sector, etc.). 2. For each result: GET /api/prices/snapshot?ticker=... and GET /api/financial-metrics?ticker=...&period=ttm&limit=1. ### Cross-ticker line-item compare POST /api/financials/search/line-items with { line_items: ["revenue","free_cash_flow"], tickers: ["AAPL","MSFT","GOOGL"], period: "ttm", limit: 4 }. ### SEC filing research 1. GET /api/filings?ticker=AAPL&filing_type=10-K&limit=3 2. GET /api/filings/items?ticker=AAPL&filing_type=10-K&year=2024&item=Item-1A — extracted item-level text (e.g., Risk Factors). ### Insider-flow scanning GET /api/insider-trades?ticker=NVDA&filing_date_gte=2026-01-01&limit=200 — Form 4 transactions. Cross-reference with /api/prices. ### 13F follow-the-money 1. GET /api/institutional-holdings/investors?name=Berkshire — find filer CIK. 2. GET /api/institutional-holdings?filer_cik=...&limit=200 — positions held. ### Macro context 1. GET /api/macro/interest-rates/banks — supported central banks. 2. GET /api/macro/interest-rates/snapshot?bank=FED — current policy rate. ### As-reported financials (raw filer concepts, not normalized) GET /api/financials/as-reported?ticker=AAPL&period=annual&limit=4 — plus the per-statement variants under /as-reported (/income-statements, /balance-sheets, /cash-flow-statements). Same ticker|cik + period rules as the normalized statements. ### Index funds / ETFs 1. GET /api/index-funds/tickers — available fund tickers. 2. GET /api/index-funds?ticker=SPY — a fund's holdings. 3. GET /api/index-funds?holding=AAPL — the funds that hold a given security. Pass exactly one of `ticker` or `holding`. ## Conventions - **Period filters**: `report_period`, `report_period_gte/_lte/_gt/_lt` on financial, metrics, and 13F endpoints. - **Insider trades** uses `filing_date[_gte|_lte|_gt|_lt]` instead. - **Identifier exclusivity**: pass exactly one of `ticker` / `cik` (or `ticker` / `filer_cik` for 13F). Both omitted or both set returns 400. - **Pagination**: `limit` integer only; no cursors. Use date filters for windowing. - **`/api/prices`** requires `interval` (day|week|month|year) plus `start_date` and `end_date` in YYYY-MM-DD. ## Do Not Use For - Crypto, options, FX, indices, or international equities — not covered. - Realtime tick data — `/api/prices/snapshot` is the finest granularity. - Historical 13F backtesting beyond ~30 years.