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

US federal spending by state API

US federal spending summed by state, county or country, filtered by industry, product code or keyword, from USAspending.gov.

GET /v1/economy/government-spend1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/economy/government-spend?naics=4811&geo=state",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"scope": "place_of_performance",
"geo_layer": "state",
"from_date": "2024-10-01",
"to_date": "2025-09-30",
"results": [
{
"shape_code": "WA",
"display_name": "Washington",
"aggregated_amount": 7069768.11,
"population": 7705281,
"per_capita": 0.92
},
{
"shape_code": "GA",
"display_name": "Georgia",
"aggregated_amount": 6901096.24,
"population": 10711908,
"per_capita": 0.64
},
"… 25 more"
]
}

Parameters

NameTypeDescription
naicsquerystringNAICS codes (2, 4 or 6 digits), comma-separated, up to 20.
pscquerystringProduct or service codes (1 to 4 characters), comma-separated, up to 20.
keywordquerystringFree text matched against award descriptions (3 to 120 characters).
from_datequerystringYYYY-MM-DD, from 2007-10-01. Defaults to the last complete federal fiscal year.
to_datequerystringYYYY-MM-DD.
geoquery"state" | "county" | "country"One of state, county, country.
scopequery"place_of_performance" | "recipient_location"One of place_of_performance, recipient_location.
award_typequery"contracts" | "grants" | "all"One of contracts, grants, all.
Response fields

200 with a EconomyGovernmentSpend, in Economy’s own JSON.

FieldTypeDescription
scopestring
geo_layerstring
from_datestring
to_datestring
resultsobject[]
Status codes
StatusMeaning
200Amounts by place, largest first.
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 data matches.
429Too many requests. Wait for Retry-After seconds.
503Economy is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Which years?

Any window from fiscal 2008; the last complete fiscal year by default.

Economy is a trademark of their publishers (Eurostat, the US Treasury, ImportYeti). We are not affiliated with or endorsed by their publishers (Eurostat, the US Treasury, ImportYeti).