100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
daysqueryintegerWindow 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.

FieldTypeDescription
daysinteger
partystring | null
sectorstring | null
buysinteger
sellsinteger
rationumber | null
Status codes
StatusMeaning
200The counts.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No member, ticker or trade matches.
429Too many requests. Wait for Retry-After seconds.
503US 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).