Metadata-Version: 2.5
Name: beatandraise
Version: 0.1.0
Summary: Python client for the beatandraise.com SEC Filings API: the whole SEC EDGAR archive, 10-K/10-Q/8-K Items, XBRL financial statements, Form 4 insider trades and 13F holders.
Project-URL: Homepage, https://beatandraise.com/sec-filings-api
Project-URL: Documentation, https://beatandraise.com/sec-filings-api/docs
Project-URL: Guides, https://beatandraise.com/sec-filings-api/guides
Project-URL: API reference (OpenAPI), https://beatandraise.com/api/v1/openapi.json
Project-URL: Source, https://github.com/mchennupati/beatandraise-python
Author-email: Iterative Works GmbH <support@beatandraise.com>
License-Expression: MIT
License-File: LICENSE
Keywords: 10-k,10-q,13f,8-k,edgar,financial-statements,form-4,insider-trading,llm,sec,sec-api,sec-filings,xbrl
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# beatandraise: Python client for the SEC Filings API

Python client for the [beatandraise.com SEC Filings API](https://beatandraise.com/sec-filings-api), an SEC EDGAR API designed for LLMs. It covers:

- **The whole EDGAR archive.** Every filing since 1993, about 18.8 million, new filings within minutes, with every document as text.
- **10-K, 10-Q, 8-K and 20-F Items.** Risk Factors, MD&A, or any 8-K Item, found by its heading.
- **XBRL financial statements.** As the company presented them, with each line's tag and a link to the figure.
- **Ownership data.** Form 4 insider transactions, 13F institutional holders and portfolios, and shares outstanding with splits.
- **Every SEC XML form as JSON.** Form D, 144, 13D/G, N-PX and others.
- **Verification.** Checks for quotes, figures and citations against the filing.

Every result names the filing it came from. The package uses only the Python standard library and needs Python 3.9 or later.

```bash
pip install beatandraise
export BEATANDRAISE_API_KEY=bar_...   # free key: https://beatandraise.com/api-keys
```

## Quickstart

```python
from beatandraise import Client

api = Client()  # reads BEATANDRAISE_API_KEY

# Find a company and its latest 10-K
apple = api.search_companies("AAPL")
tenk = api.filings(cik="0000320193", form="10-K", limit=1)["filings"][0]
acc = tenk["accession_number"]

# Risk Factors (Item 1A) as text: the section itself, not the table of contents
risk_factors = api.item(acc, "1A")

# Income statement across the last five 10-Ks
history = api.financial_history(cik="0000320193", period="annual", statements="income", limit=5)

# Who owns it: % held by 13F filers, top holders, buyers and sellers
holders = api.institutional_holders("AAPL")
q = holders["quarters"][0]
print(q["period"], q["share_classes"][0]["pct_of_class"], "% held by", q["holders"], "13F filers")
```

## Examples

```python
# Insider sales and purchases, with the Rule 10b5-1 flag and footnotes
rows = api.insider_transactions(cik="0001045810", from_="2026-09-01", include_footnotes=True)["transactions"]
sales = [r for r in rows if r["transaction_code"] == "S"]

# 8-K officer changes (Item 5.02) across all companies, with the Item's text
events = api.filings(item="5.02", item_text="5.02", from_="2026-11-01", limit=25)

# Full-text search, one result per company
hits = api.search('"going concern"', form="10-K", year=2026, by_company=True)

# Lines in a filing that mention a term
lines = api.search_document("0000320193", acc, q="tariffs")

# Statement lines with XBRL concept, value in full units and a highlight link
stmts = api.statements("0000320193", acc, include_tags=True)

# Check a figure before you quote it
check = api.verify_figure("0000320193", acc, value="$478.8 billion", label="Net sales")

# Any endpoint by path
api.get("/fiscal-calendar", cik="0000320193")
```

Parameters named `from` in the API are `from_` in Python. Lists are sent comma-separated (`statements=["income", "cash_flow"]`).

## Methods

| Method | Endpoint |
|---|---|
| `filings(cik, form, from_, to, item, item_text, limit, offset)` | `GET /filings` |
| `search(q, form, cik, year, limit, page, by_company)` | `GET /search` |
| `search_companies(q)`, `company(cik)` | `GET /company/search`, `/company/{cik}` |
| `identifiers(ticker, cik, cusip)` | `GET /identifiers` |
| `sic(...)` | `GET /sic` |
| `fiscal_calendar(cik, fiscal_year, from_, to)` | `GET /fiscal-calendar` |
| `filing(acc)`, `filing_tables(acc)`, `files(acc)` | `GET /filing/{acc}`, `/filing/{acc}/tables`, `/files/{acc}` |
| `download(acc, filename)` (bytes) | `GET /files/{acc}/{filename}` |
| `document(cik, acc, filename, markdown=True)` (text) | `GET /document/{cik}/{acc}/{filename}` |
| `search_document(cik, acc, q, filename, context)` | `GET /document/search/...` |
| `items(acc)`, `item(acc, item)` (text) | `GET /items/{acc}`, `/items/{acc}/{item}` |
| `form_data(cik, form, ...)` | `GET /form-data` |
| `statements(cik, acc, include_tags)` | `GET /statements/{cik}/{acc}` |
| `financial_history(cik, period, statements, limit, fiscal_year, fiscal_period, include_tags)` | `GET /financial-history` |
| `insider_transactions(cik, from_, to, include_table_ii, include_footnotes)` | `GET /insider-transactions` |
| `shares_outstanding(cik, share_class, from_, to)` | `GET /shares-outstanding` |
| `holdings(cik, period)` | `GET /holdings/{cik}` |
| `institutional_holders(company, quarters, holder, detail)` | `GET /institutional-holders/{company}` |
| `verify_quote(cik, acc, filename, quote)` | `GET /document/verify/...` |
| `verify_figure(cik, acc, value, label, filename)` | `GET /document/verify-figure/...` |
| `figures(cik, acc, filename, near)` | `GET /document/figures/...` |
| `check_citations(text)` | `POST /check-citations` |
| `account()` | `GET /account` |

The full reference, with an example response for each endpoint, is the [OpenAPI spec](https://beatandraise.com/api/v1/openapi.json). You can also [try any request in the browser](https://beatandraise.com/sec-filings-api/try).

## Errors and limits

A refused request raises `beatandraise.APIError` with `.status` and `.body`. Requests refused for rate (429) or by a busy server (502-504) are retried twice, honouring `Retry-After`. The free plan includes 100 successful requests at up to 10 a second; Pro is unlimited at 20 a second. See [plans](https://beatandraise.com/sec-filings-api#plans).

## Using it from an LLM

To give Claude, ChatGPT, Cursor or Codex the same data with no code, add the MCP server at `https://mcp.beatandraise.com/mcp`. Setup for each client is at [beatandraise.com/mcp](https://beatandraise.com/mcp).

## Guides

- [Who owns a stock: 13F institutional holders by API](https://beatandraise.com/sec-filings-api/guides/13f-institutional-holders-api)
- [Get a 10-K's Risk Factors (Item 1A) by API](https://beatandraise.com/sec-filings-api/guides/10-k-risk-factors-api)
- [Insider trading data by API: Form 4 transactions as filed](https://beatandraise.com/sec-filings-api/guides/insider-trading-form-4-api)
- [Financial statements from SEC XBRL by API](https://beatandraise.com/sec-filings-api/guides/xbrl-financial-statements-api)

Questions: support@beatandraise.com. Data source: SEC EDGAR. Nothing here is investment advice.
