Developers · Guides · Quickstart
Go from no account to congressional stock-trade data in your terminal in a few minutes. Every example works as written once you put in your own key.
Updated October 9, 2026
Every data call spends credits, and new accounts start with none, so calls return 402 until you add some. Two ways in:
API plans and limits compares Core, Pro and Max.
If you sign up from this page, the welcome screen creates your first key. To make more, open Account → API Keys. Keys start with dc_ and are shown once, so copy yours straight away.
Send the key in the DC-API-Key header. This asks for the 3 most recently disclosed trades:
export DC_API_KEY="dc_your_key_here" # your key from Account → API Keys
curl -H "DC-API-Key: $DC_API_KEY" \
"https://api.disclosedcapitol.com/trades?limit=3"import os
import requests # pip install requests
API = "https://api.disclosedcapitol.com"
HEADERS = {"DC-API-Key": os.environ["DC_API_KEY"]}
r = requests.get(f"{API}/trades", headers=HEADERS, params={"limit": 3}, timeout=30)
r.raise_for_status()
for t in r.json():
print(t["disclosure_date"], t["politician_name"], t["trade_type"], t["ticker"])The response is a JSON array of trades, newest disclosure first:
[
{
"id": 294577,
"politician_id": 322,
"politician_name": "Maria Elvira Salazar",
"party": "R",
"state": "FL",
"chamber": "House",
"ticker": "BIIB",
"trade_type": "Sell",
"asset_type": "Stock",
"asset_description": "Biogen Inc. - Common Stock [UBS IRA Account]",
"amount_range": "$1,001 - $15,000",
"amount_low": 1001.0,
"amount_high": 15000.0,
"transaction_date": "2026-09-24",
"disclosure_date": "2026-10-07",
"days_to_disclose": 13,
"source": "house.gov",
"sector": "Healthcare",
"industry": "Drug Manufacturers - General",
"price_on_trade_date": 226.36,
"price_on_disclosure": 227.715
// ...plus return, alpha and option fields
}
// ...2 more trades
]amount_range is the dollar bracket from the filing; amount_low and amount_high are its bounds as numbers. The Congress trades as JSON guide lists every field.
A call costs a base charge set by the endpoint, 15 credits for trade data, plus 1 credit for each row it returns. The 3-trade call above cost 15 + 3 = 18 credits. The response carries the charge and your new balance in two headers:
curl -sS -D - -o /dev/null -H "DC-API-Key: $DC_API_KEY" \
"https://api.disclosedcapitol.com/trades?limit=3" | grep -i '^x-credits'x-credits-charged: 18
x-credits-remaining: 7482print(r.headers["X-Credits-Charged"]) # "18": 15 for the call + 1 per row
print(r.headers["X-Credits-Remaining"]) # your balance after this callFailed requests (any 4xx or 5xx) are not charged. Prices for every endpoint are public at https://api.disclosedcapitol.com/credits/endpoints (no key needed).
GET /trades returns trades disclosed in the last 30 days unless you say otherwise. These parameters narrow it down:
| Parameter | Example | What it does |
|---|---|---|
| ticker | NVDA or NVDA,MSFT | One ticker or a comma-separated list. |
| politician_id | 58 | One member's numeric id, or a comma-separated list. The Congress trades as JSON guide shows how to find it. |
| party | D | D, R or I. |
| chamber | senate | house, senate or executive. |
| state | CA | Two-letter state code. |
| trade_type | buy | buy, sell, exercise or expired: the labels in the Action column of the trades page, whatever wording the filing used. Like asset_type and sector, it leaves out trades whose ticker is "N/A". |
| asset_type | Stock | Asset kind, e.g. Stock or Option. |
| sector | Technology | Sector name, or a comma-separated list. |
| days | 90 | How far back to look, by disclosure date. Default 30, maximum 3650. |
| date_from, date_to | 2026-01-01 | An exact disclosure-date range (YYYY-MM-DD). Send both; together they replace days. |
| limit, offset | 100, 200 | Page size (default 25, maximum 1000) and how many rows to skip. |
| sort_by, sort_dir | transaction_date, asc | Sort field (default disclosure_date) and direction (default desc). |
# Senate purchases of NVDA or MSFT disclosed in the last 90 days.
# -G sends each -d as a query parameter.
curl -G -H "DC-API-Key: $DC_API_KEY" "https://api.disclosedcapitol.com/trades" \
-d ticker=NVDA,MSFT -d chamber=senate -d trade_type=buy -d days=90To collect more than one page, step offset until a page comes back short. Each page costs the 15-credit base plus 1 credit per trade on it.
def all_trades(**filters):
"""Yield every trade matching the filters, 100 per request."""
seen, offset = set(), 0
while True:
r = requests.get(
f"{API}/trades",
headers=HEADERS,
params={**filters, "limit": 100, "offset": offset},
timeout=30,
)
r.raise_for_status()
page = r.json()
for t in page:
# A filing that lands mid-run can shift rows between pages.
if t["id"] not in seen:
seen.add(t["id"])
yield t
if len(page) < 100:
break
offset += 100
# Every NVDA purchase disclosed in the last 90 days
for t in all_trades(ticker="NVDA", trade_type="buy", days=90):
print(t["disclosure_date"], t["politician_name"], t["amount_range"])| Status | Meaning | What to do |
|---|---|---|
| 402 | Your balance can't cover the call. | Start a plan or buy credits. The response says how many credits the call needed and links to top up. |
| 403 | No key, a revoked key, or the key sent in the wrong header. | Send it as DC-API-Key. An Authorization: Bearer header is not read. |
| 404 | Unknown politician id or slug, or trade id. | Check the id or slug. To find a member, call GET /politicians?search=pelosi. |
| 422 | A parameter is invalid, for example limit above 1000. | The response names the parameter. |
| 429 | Too many requests a minute for your plan, or the key's daily spend cap (25,000 credits by default) is reached. | For the per-minute limit, wait the seconds in the Retry-After header and retry. The daily cap resets at midnight UTC. |
Rate limits are per minute: 120 on Core, 240 on Pro and 600 on Max, and 60 for an account without a plan.
GET https://api.disclosedcapitol.com/v1/tools returns ready-made tool definitions, no key needed.The API is licensed for personal use and for news and media use (Terms Section 9.1). For any other use, email admin@disclosedcapitol.com for written permission.