Congress buy/sell ratio API
Buys against sells over a window, overall or for one party or sector.
GET /v1/uscongresstrades/stats/buy-sell1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/uscongresstrades/stats/buy-sell?days=90&party=democrat",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "days": 90, "party": "democrat", "sector": null, "buys": 554, "sells": 479, "ratio": 1.157}Parameters
| Name | Type | Description |
|---|---|---|
daysquery | integer | Window in days, 1 to 3650. Defaults to 30. |
partyquery | "democrat" | "republican" | "other" | democrat, republican or other. One of democrat, republican, other. |
sectorquery | "communication-services" | "consumer-discretionary" | "consumer-staples" | "energy" | "financials" | "health-care" | "industrials" | "information-technology" | "materials" | "real-estate" | "utilities" | One of communication-services, consumer-discretionary, consumer-staples, energy, financials, health-care, industrials, information-technology, materials, real-estate, utilities. |
Response fields
200 with a CongressBuySell, in US Congress trades’s own JSON.
| Field | Type | Description |
|---|---|---|
days | integer | |
party | string | null | |
sector | string | null | |
buys | integer | |
sells | integer | |
ratio | number | null |
Status codes
| Status | Meaning |
|---|---|
200 | The counts. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No member, ticker or trade matches. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | US Congress trades is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
What is the ratio?
Buys divided by sells; null when there are no sells.
US Congress trades is a trademark of 2iQ Research (Capitol Trades). We are not affiliated with or endorsed by 2iQ Research (Capitol Trades).