Disclosed CapitolDisclosedCapitol
Home
Plans
Chad AI
API
Sign InGet Pro

Never Miss a Trade

Get weekly trade alerts free.

Explore

  • Politician Trades
  • Politicians
  • Executive Branch
  • Companies
  • All Stocks A–Z
  • Leaderboard
  • Compare Politicians
  • Committee Portfolios
  • Chad AI

Money & Policy

  • Government Contracts
  • Lobbying
  • Legislation
  • Campaign Finance
  • Institutional (13F)
  • Whale Watch (13D)

Markets

  • Markets Overview
  • Top Companies
  • Insider Trends
  • Economic Indicators
  • Live News

Resources

  • API Access
  • Developers
  • Developer Guides
  • Data Export
  • Glossary
  • Methodology
  • Data Sources
  • How It Works

Company

  • About Us
  • Press
  • FAQ
  • Pricing
  • vs. Capitol Trades
  • Contact
  • Watchlist

Legal

  • Editorial Standards
  • Corrections
  • Disclaimers
  • Privacy
  • Terms
© 2026 Disclosed Capitol. All rights reserved.
TermsPrivacyDisclaimer
HomeTrades
Chad
WatchlistAccount

Developers · Guides · Trades as JSON

Congress trades as JSON: the Nancy Pelosi example

Every stock trade a member of Congress discloses is available from the API as JSON. This guide downloads Nancy Pelosi's, from lookup to CSV. Swap in any other member to do the same for them.

Updated October 9, 2026

You need an API key with credits. The API quickstart covers both; Core's 7-day free trial includes 7,500 credits. The examples read your key from the DC_API_KEY environment variable.

01Find the member's politician_id

Member pages on this site end in a slug: disclosedcapitol.com/politicians/nancy-pelosi. The API takes the same slug and returns the member's profile, including the numeric politician_id the trade endpoints use.

Shell
curl -H "DC-API-Key: $DC_API_KEY" \
  "https://api.disclosedcapitol.com/politicians/nancy-pelosi"
Response (abridged; data as of Oct 9, 2026)
{
  "politician_id": 58,
  "name": "Nancy Pelosi",
  "party": "D",
  "state": "CA",
  "chamber": "House",
  "slug": "nancy-pelosi",
  "bioguide_id": "P000197",
  "trade_count": 250,
  "enriched_trades": 218
  // ...plus performance stats: win rate, alpha, Sharpe ratio, portfolio return
}

Don't know the slug? GET /politicians?search=pelosi searches by name and returns {"politicians": [...], "total": ...} with the same fields. Either lookup costs 15 credits.

02Fetch the trades

GET /politicians/{id}/trades returns everything the member has disclosed, newest transaction first. limit sets the page size (default 25, maximum 1000) and offset skips rows.

Shell
curl -H "DC-API-Key: $DC_API_KEY" \
  "https://api.disclosedcapitol.com/politicians/58/trades?limit=2"
Response (abridged; real data as of Oct 9, 2026)
[
  {
    "id": 294530,
    "politician_id": 58,
    "ticker": "N/A",
    "politician_name": "Nancy Pelosi",
    "party": "D",
    "state": "CA",
    "chamber": "House",
    "trade_type": "Buy",
    "asset_type": "Stock",
    "asset_description": "REOF XXX, LLC",
    "amount_range": "$500,001 - $1,000,000",
    "amount_low": 500001.0,
    "amount_high": 1000000.0,
    "transaction_date": "2026-09-08",
    "disclosure_date": "2026-10-02",
    "days_to_disclose": 24,
    "source": "house.gov",
    "sector": null,
    "price_on_trade_date": null,
    "gain_30d": null
    // ...
  },
  {
    "id": 263708,
    "politician_id": 58,
    "ticker": "BE",
    "politician_name": "Nancy Pelosi",
    "party": "D",
    "state": "CA",
    "chamber": "House",
    "trade_type": "Buy",
    "asset_type": "Stock",
    "asset_description": "Bloom Energy Corporation Class A Common Stock",
    "amount_range": "$500,001 - $1,000,000",
    "amount_low": 500001.0,
    "amount_high": 1000000.0,
    "transaction_date": "2026-07-28",
    "disclosure_date": "2026-08-21",
    "days_to_disclose": 24,
    "source": "house.gov",
    "sector": "Industrials",
    "industry": "Electrical Equipment & Parts",
    "price_on_trade_date": 166.84,
    "price_on_disclosure": 201.45,
    "gain_30d": 34.55,
    "alpha_30d": 31.05,
    "current_return": 64.28,
    "days_held": 73
    // ...
  }
]

The first trade is an LLC interest with no public ticker, so ticker is "N/A" and the price and performance fields are null. A call costs 15 credits plus 1 per trade returned; this one cost 17.

03Filter by type, asset or date

To narrow the list, call GET /trades with politician_id and any of its filters:

Shell
# Her purchases disclosed in the last 365 days.
# -G sends each -d as a query parameter.
curl -G -H "DC-API-Key: $DC_API_KEY" "https://api.disclosedcapitol.com/trades" \
  -d politician_id=58 -d trade_type=buy -d days=365 -d limit=100

# Her option trades disclosed in the last 3 years, oldest first
curl -G -H "DC-API-Key: $DC_API_KEY" "https://api.disclosedcapitol.com/trades" \
  -d politician_id=58 -d asset_type=Option -d days=1095 \
  -d sort_by=transaction_date -d sort_dir=asc -d limit=100
  • days counts back from today by disclosure date and defaults to 30, so set it (up to 3650), or send date_from and date_to together (YYYY-MM-DD) for an exact range.
  • trade_type=buy and trade_type=sell match the Buy and Sell labels on the trades page, whatever wording the filing used.
  • Filtering by trade_type, asset_type or sector leaves out trades whose ticker is "N/A", such as the LLC interest above. GET /politicians/{id}/trades always includes them.
  • For option trades, GET /trades also fills option_type, strike_price and option_expiry.

The quickstart lists the main /trades filters, and the API reference has the rest.

04Download everything to CSV with Python

This script looks the member up, pages through all of their trades and writes a CSV:

Python
import csv
import os

import requests  # pip install requests

API = "https://api.disclosedcapitol.com"
HEADERS = {"DC-API-Key": os.environ["DC_API_KEY"]}


def get(path, **params):
    r = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=30)
    r.raise_for_status()
    return r


# 1. The slug from the member's page URL -> numeric politician_id
member = get("/politicians/nancy-pelosi").json()
pid = member["politician_id"]

# 2. Every disclosed trade, newest first, 100 per request
trades, seen, offset = [], set(), 0
while True:
    r = get(f"/politicians/{pid}/trades", limit=100, offset=offset)
    page = r.json()
    for t in page:
        if t["id"] not in seen:  # rows can shift if a new filing lands mid-run
            seen.add(t["id"])
            trades.append(t)
    if len(page) < 100:
        break
    offset += 100

left = r.headers["X-Credits-Remaining"]
print(f"{member['name']}: {len(trades)} trades, {left} credits left")

# 3. Save the columns you need
columns = [
    "transaction_date", "disclosure_date", "ticker", "asset_description",
    "trade_type", "amount_range", "amount_low", "amount_high",
]
with open("pelosi_trades.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=columns, extrasaction="ignore")
    writer.writeheader()
    writer.writerows(trades)

At the time of writing Nancy Pelosi has 250 disclosed trades, so the script makes 4 requests and costs 310 credits: 15 for the lookup, then 15 per page plus 1 per trade.

05Do the same for any member

Replace nancy-pelosi with another member's slug, the last part of their page URL on the politicians list. Senators and representatives work the same way. For every member's trades in one stock instead, call GET /tickers/{ticker}/trades, for example /tickers/NVDA/trades.

Trade fields

Each trade object has these fields. A field is null when it doesn't apply or isn't computed yet, such as a 30-day gain on a trade made last week.

FieldWhat it is
idThe trade's id in Disclosed Capitol.
politician_id, politician_name, party, stateWho made the trade.
chamberHouse, Senate or Executive.
tickerThe ticker, or "N/A" when the asset has no public ticker.
trade_typeThe transaction type as written on the filing.
asset_type, asset_descriptionThe kind of asset, and its name as written on the filing.
amount_range, amount_low, amount_highThe disclosed dollar range, as text and as numbers. Filings give ranges, not exact amounts.
transaction_date, disclosure_date, days_to_discloseWhen the trade happened, when it was disclosed, and the days in between.
sourceWhere it was filed: house.gov, senate.gov or oge.gov.
sector, industryThe company's sector and industry.
price_on_trade_date, price_on_disclosureThe share price on each date.
gain_7d, gain_30d, gain_60d, gain_90d, gain_1yrPerformance in percent over each window, starting from the transaction date.
alpha_30d, alpha_90d, alpha_1yrThe gain minus the S&P 500's return over the same window. *
public_gain_30d, public_gain_90d, public_gain_180dThe same performance measured from the disclosure date, when the trade became public.
public_alpha_30d, public_alpha_90d, public_alpha_180dThose public-date gains minus the S&P 500. *
current_return, current_alphaPerformance from the transaction date to the latest price, for trades from the last two years. *
days_heldDays since the transaction date, alongside current_return.
option_type, strike_price, option_expiryCall or put, strike and expiry for option trades. Filled by GET /trades.
conviction_scoreDisclosed Capitol's rating of how notable the trade is. *
peer_z_scoreHow the trade's 30-day gain compares with other members' trades in the same stock and direction within 30 days, as a z-score.
is_ma_affected1 when a merger or acquisition affected the stock's price history.

* Included with Core, Pro and Max. For a key on an account without a plan, these come back as null.

How prices, gains and alpha are calculated is on the Methodology page. The STOCK Act gives members up to 45 days to disclose a trade, so recent activity reaches the data with that lag.

Next steps

  • Webhook setup: get each new trade pushed to you as it's filed, instead of re-downloading (Pro and Max).
  • API reference: every endpoint, including member portfolios and committee data.
  • API plans and limits: credits and rate limits on Core, Pro and Max.

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.

Frequently asked questions

How do I get Nancy Pelosi's stock trades as JSON?
Call GET https://api.disclosedcapitol.com/politicians/58/trades with your API key in the DC-API-Key header. 58 is her politician_id, which GET /politicians/nancy-pelosi returns. The response is a JSON array of her disclosed trades, newest first.
Can I filter a member's trades to purchases only?
Yes. Call GET /trades with politician_id=58 and trade_type=buy. Also set days (up to 3650) or send date_from and date_to together, because GET /trades only looks back 30 days by default.
How much does it cost to download one member's trades?
15 credits per request plus 1 credit per trade returned. At the time of writing Nancy Pelosi has 250 disclosed trades; the lookup plus 3 pages of 100 costs 310 credits. Core's 7-day free trial includes 7,500.
Does this work for senators too?
Yes. Senators and representatives use the same endpoints. Each trade's chamber field says where it was filed.