CongressTrading API
Programmatic access to real-time congressional trading data. Integrate our feed directly into your algo-trading bots, research platforms, or news tickers.
Authentication
Authenticate your requests using your API key. You can pass it in the header (recommended) or as a query parameter.
curl "https://CongressTrading.app/api/trades" \
-H "x-api-key: YOUR_API_KEY"
/api/trades
Fetch the latest reported trades. Results are ordered by transaction date (newest first).
Parameters
| Name | Type | Description |
|---|---|---|
| ticker | string | Filter by stock symbol (e.g. NVDA) |
| politician | string | Partial match on name (e.g. Pelosi) |
| limit | int | Max records to return (default 100, max 1000) |
Example Response
[
{
"transaction_date": "2024-01-22",
"representative": "Nancy Pelosi",
"political_party": "Democrat",
"ticker": "NVDA",
"asset_name": "Nvidia Corp",
"transaction_type": "Purchase",
"transaction_price": 596.54
},
{
"transaction_date": "2024-01-20",
"representative": "Tommy Tuberville",
"political_party": "Republican",
"ticker": "TSLA",
"asset_name": "Tesla Inc",
"transaction_type": "Sale (Partial)",
"transaction_price": 212.10
}
]
/api/ask
Submit a natural language query to our Agent. The AI uses a hybrid RAG + Text-to-SQL engine to answer questions about congressional trading data.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| query | string | The natural language question (e.g., "What did Pelosi buy?"). |
Example Request
curl -X POST "https://CongressTrading.app/api/ask" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Which republican sold the most tech stocks?"}'
Example Response
{
"status": "success",
"query": "Which republican sold the most tech stocks?",
"answer_prose_html": "<p>Based on recent filings...</p>",
"usage_today": 12,
"limit_daily": 50
}
/api/export
Stream the last 1,000 trades as a CSV file. This endpoint is optimized for browser downloads or data pipelines.
This endpoint requires a valid session cookie (Premium/Premium+ tier). It is best accessed via a web browser or a session-authenticated script.