bourse-quant
The official Python package for the Bourse API: stock trades of members of Congress, the President and the Cabinet, SEC Form 4 insider trades scored by the Bourse Conviction Score, 13F holdings, lobbying, federal contracts, the Coincidence Tracker, portfolio stress tests and full-history bulk files, returned as pandas DataFrames.
pip install bourse-quant # add [parquet] to read Parquet bulk files
export BOURSE_KEY=bk_... # free key: Bourse app -> Settings -> API key
import bourse
df = bourse.get_insider_trades("NVDA") # SEC Form 4, every page
buys = bourse.get_insider_trades(code="P", since="2026-10-01")
top = bourse.get_conviction(min_score=90) # Conviction Score 0-100 with reasons
congress = bourse.get_congress_trades(ticker="LMT", since="2025-01-01")
hits = bourse.get_coincidences(committee_match=True) # Congress trades next to federal contracts
ideas = bourse.insights() # strategies with historical return and drawdown risk
ids = bourse.symbology(ticker="AAPL") # CIK, CUSIP, ISIN, FIGI
risk = bourse.stress_test({"AAPL": 40, "MSFT": 30, "TLT": 30}) # API Pro / Enterprise / pay-as-you-go
risk["historical_scenarios_df"]
Any dataset works the same way:
bourse.get_dataset("warn-layoffs", state="TX", since="2026-01-01")
bourse.list_datasets().keys()
What you get in every row
filed_at_source_timestamp: when the SEC, the House, the Senate or another source published the filing (null when the source gives no time).processed_by_bourse_timestamp: when Bourse stored the record. Use both to avoid look-ahead bias in backtests.cik,cusip,isin,figion every row with a ticker.
Date and timestamp columns are parsed to timezone-aware pandas datetimes.
Reliability
The client pages through results (1,000 rows per request), retries on HTTP 429 with back-off, retries on 5xx and network errors, and raises bourse.BourseError(status, code, message) otherwise. client().remaining_today, client().plan and client().data_delay mirror the response headers. API responses are never served from a cache.
Async
import asyncio, bourse
async def main():
async with bourse.AsyncClient(concurrency=4) as b:
frames = await b.gather(b.insider_trades, ["NVDA", "AAPL", "MSFT"])
asyncio.run(main())
Bulk history (backtesting)
paths = bourse.download_bulk("congress", format="csv.gz") # API Pro
df = bourse.download_bulk("insiders", format="parquet", read=True) # Enterprise: Parquet from Amazon S3
Files are refreshed every night. Links are pre-signed and valid for one hour.
Webhooks
ok = bourse.verify_webhook(secret, request.headers["Bourse-Signature"], request.get_data())
Plans
- Free key: 1,000 requests a day, event data delayed 48 hours, personal use.
- Pay-as-you-go: $1 per 1,000 requests, live data, commercial license.
- API Pro: $499 a month, 250,000 requests a day, nightly CSV/NDJSON files, stress-test API.
- Enterprise: $1,000 a month, Parquet history on Amazon S3, 99.9% uptime SLA.
Reference: https://docs.bourse.pl · Status: https://status.bourse.pl · Terms: https://www.bourse.pl/legal/api/
Data comes from public filings. It is not investment advice. The code is MIT licensed.
Metadata
Release files for bourse-quant 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bourse_quant-1.0.0.tar.gz | 12.6 kB | Without provenance | Details for bourse_quant-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bourse_quant-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for bourse_quant-1.0.0-py3-none-any.whl |
Total release size: 22.5 kB
Release files / bourse_quant-1.0.0.tar.gz
| Download URL | bourse_quant-1.0.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9773fed85aade6cb49d70eceab410f584e787b28c4e278ba9e9d9a26cdc845fa
|
|
BLAKE2b-256 checksum How to use checksums |
4350fd68899d3c0a3258bf81859665a5f9ae66b5d7ef1714e901dbae3e53c3fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Release files / bourse_quant-1.0.0-py3-none-any.whl
| Download URL | bourse_quant-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e66e6554061f083f7843044bcfc0641e5f6c6d416d46f14778b0c75cc7c7347
|
|
BLAKE2b-256 checksum How to use checksums |
78a7207952b7ddb4a4cd9d8d089c1e9fc55b9ce7295903e3db48740fc6f798af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Security for bourse-quant 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.