# Capitol Trades Congress Stock Trades Scraper (`devilscrapes/capitol-trades-congress-stock-scraper`) Actor

Scrape US congressional stock trades from Capitol Trades: politician, party, chamber, state, issuer, ticker, trade and publication dates, owner, buy or sell, size range and price. Filter by politician, issuer, ticker or trade type and export to JSON or CSV.

- **URL**: https://apify.com/devilscrapes/capitol-trades-congress-stock-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Lead generation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Capitol Trades Congress Stock Trades Scraper

**💰 $2.55 / 1 000 trades**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Scrape US congressional stock trades from public STOCK Act disclosures: politician, party, chamber, state, issuer, ticker, trade and publication dates, owner, buy or sell, size range with numeric bounds, and price. Filter by politician, issuer, ticker or trade type and export to JSON or CSV.

</div>

***

### 🎯 What this scrapes

Every member of Congress who trades stocks has to disclose it, and the filings are scattered across House and Senate sites. This Actor reads the public disclosure feed on Capitol Trades and hands back one clean row per trade: who traded, which party, chamber and state, what issuer and ticker, when they traded and when it was published, whether it was a buy or a sell, the size bracket (with numeric min and max in USD) and the price. Narrow it by politician Bioguide id, issuer id, ticker or trade type, or just pull the latest feed. Data comes from public STOCK Act disclosures; Devil Scrapes is not affiliated with Capitol Trades.

### 🔥 What we handle for you

- 🛡️ **We rotate browser fingerprints** so the target sees a real browser, not a Python script.
- 🔁 **We retry with exponential backoff** on `408 / 429 / 5xx` and honour `Retry-After`, up to 5 attempts per page.
- 🌐 **We rotate proxy sessions** through Apify Proxy on every block.
- 🧊 **We keep the dataset clean** -- Pydantic-validated rows, ISO-8601 dates, stable trade ids.
- 🧱 **A failed page never kills the run** -- we skip it, keep going, and report it in the status message.
- 💰 **You pay only for results that land.** No matching trades, no row charges (only the small start fee).

### 💡 Use cases

- **Retail-signal and quant feeds** -- ingest congressional buys and sells with numeric size bounds as a raw factor.
- **Fintech newsletters and dashboards** -- surface the latest politician trades in a daily or weekly brief.
- **Political-finance journalism** -- pull every disclosed trade for one lawmaker by Bioguide id, with filing delay in days.
- **Watchlist monitoring** -- keep only the tickers you care about with the ticker filter.
- **Compliance and research** -- compare trade dates against publication dates across parties and chambers.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `politician_ids` | `array` | no | \[] | Bioguide ids (e.g. P000197). One query per id. Leave empty for all politicians. |
| `issuer_ids` | `array` | no | \[] | Capitol Trades issuer ids (digits). One query per id; combined with politician ids as a cross product. |
| `tx_type` | `string` | no | 'all' | Only buys, only sells, or all trades. |
| `name_contains` | `string` | no | '—' | Case-insensitive filter on politician or issuer name, applied to fetched rows. |
| `tickers` | `array` | no | \[] | Keep only rows whose ticker matches (e.g. NVDA or NVDA:US). |
| `max_pages` | `integer` | no | 3 | Page cap per query (96 rows per page). |
| `max_rows` | `integer` | no | 300 | Global cap on rows emitted; the run stops fetching once reached. |
| `proxy_configuration` | `object` | no | {'useApifyProxy': True} | Apify datacenter proxy by default. Residential is opt-in. |

#### Example input

```json
{
  "politician_ids": [
    "P000197"
  ],
  "max_pages": 1,
  "max_rows": 5,
  "proxy_configuration": {
    "useApifyProxy": true
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `trade_id` | `string` | Capitol Trades trade id. |
| `trade_url` | `string` | Absolute trade-detail URL. |
| `politician_id` | `string` | Bioguide id. |
| `politician_name` | `string` | Politician name. |
| `party` | `string` | Party. |
| `chamber` | `string` | House or Senate. |
| `state` | `string` | US state code. |
| `issuer_id` | `string` | Capitol Trades issuer id. |
| `issuer_name` | `string` | Issuer name. |
| `ticker` | `string` | Ticker as served, e.g. NOW:US. |
| `published_at` | `string` | ISO date the disclosure was published. |
| `published_raw` | `string` | Published cell text as served. |
| `traded_at` | `string` | ISO date of the trade. |
| `traded_raw` | `string` | Traded cell text as served. |
| `filed_after_days` | `integer` | Days between trade and filing. |
| `owner` | `string` | Owner: Joint, Spouse, Self, Child, Undisclosed. |
| `tx_type` | `string` | buy, sell or exchange. |
| `size_range` | `string` | Size bucket string, en dash preserved. |
| `size_min_usd` | `integer` | Lower bound of size bucket in USD. |
| `size_max_usd` | `integer` | Upper bound of size bucket in USD. |
| `price_usd` | `number` | Price per unit in USD. |
| `scraped_at` | `string` | ISO-8601 UTC scrape time. |

#### Example output

```json
{
  "trade_id": "20003802997",
  "trade_url": "https://www.capitoltrades.com/trades/20003802997",
  "politician_id": "S000168",
  "politician_name": "Maria Elvira Salazar",
  "party": "Republican",
  "chamber": "House",
  "state": "FL",
  "issuer_id": "2264488",
  "issuer_name": "Berkshire Hathaway Inc",
  "ticker": "BRK/B:US",
  "published_at": "2026-10-08",
  "published_raw": "Yesterday",
  "traded_at": "2026-09-24",
  "traded_raw": "24 Sept 2026",
  "filed_after_days": 13,
  "owner": "Undisclosed",
  "tx_type": "sell",
  "size_range": "1K–15K",
  "size_min_usd": 1000,
  "size_max_usd": 15000,
  "price_usd": 505.18,
  "scraped_at": "2026-10-09T03:49:55+00:00"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | One-off warm-up charge per run |
| `trade-row` | $0.0025 | PPE event |

Example: 1 000 trades at the rates above ≈ **$2.70**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Trade-level rows only -- politician profiles, issuer profiles and portfolio statistics are out of scope.
- Size is a disclosure bracket, not an exact dollar amount.
- Name and ticker filters are applied to fetched rows; use politician and issuer ids to narrow the pages fetched.
- Each run is capped by max pages per query and max rows, so large pulls take several runs or higher caps.

### ❓ FAQ

**Where does the data come from?**

From the public STOCK Act disclosures of US House and Senate members, as listed on Capitol Trades. Devil Scrapes is not affiliated with Capitol Trades.

**How do I find a politician's id?**

Use the Bioguide id, e.g. P000197 for Nancy Pelosi. It is the id in the politician's Capitol Trades profile link.

**Why is the size a range instead of an exact amount?**

Disclosures report value brackets, not exact amounts. We keep the bracket string as published and add size_min_usd and size_max_usd as integers so you can filter and sort.

**What does a null ticker or price mean?**

Some disclosed assets (municipal bonds, private funds, options) have no listed ticker or price. We return those rows with the field set to null rather than dropping them.

**What happens if my filters match nothing?**

The run succeeds with zero rows and a status message listing the filters searched. You pay only the small start fee.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Changelog

This Actor's version history is a separate document: https://apify.com/devilscrapes/capitol-trades-congress-stock-scraper/changelog.md

# Actor input Schema

## `politician_ids` (type: `array`):

Bioguide ids (e.g. P000197). One query per id. Leave empty for all politicians.

## `issuer_ids` (type: `array`):

Capitol Trades issuer ids (digits). One query per id; combined with politician ids as a cross product.

## `tx_type` (type: `string`):

Only buys, only sells, or all trades.

## `name_contains` (type: `string`):

Case-insensitive filter on politician or issuer name, applied to fetched rows.

## `tickers` (type: `array`):

Keep only rows whose ticker matches (e.g. NVDA or NVDA:US).

## `max_pages` (type: `integer`):

Page cap per query (96 rows per page).

## `max_rows` (type: `integer`):

Global cap on rows emitted; the run stops fetching once reached.

## `proxy_configuration` (type: `object`):

Apify datacenter proxy by default. Residential is opt-in.

## Actor input object example

```json
{
  "politician_ids": [],
  "issuer_ids": [],
  "tx_type": "sell",
  "tickers": [],
  "max_pages": 2,
  "max_rows": 150,
  "proxy_configuration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tx_type": "sell",
    "max_pages": 2,
    "max_rows": 150,
    "proxy_configuration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/capitol-trades-congress-stock-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tx_type": "sell",
    "max_pages": 2,
    "max_rows": 150,
    "proxy_configuration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/capitol-trades-congress-stock-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tx_type": "sell",
  "max_pages": 2,
  "max_rows": 150,
  "proxy_configuration": {
    "useApifyProxy": true
  }
}' |
apify call devilscrapes/capitol-trades-congress-stock-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/capitol-trades-congress-stock-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7id01LmSAPx9iW8d2/builds/smjOTSdC3mfiMOMXm/openapi.json
