Get US federal spending by state, county or country
Get US federal spending summed by state, county or country for a date window, filtered by award type, industry (NAICS), product or service (PSC) and keyword.
Headers
Get your API keyAPI key (`sfk_...`)
What to sum by: `state` (default), `county` or `country` (spending abroad included).
one of: state, county, country
`place_of_performance` (default, where the work is done) or `recipient_location` (where the recipient is based).
one of: place_of_performance, recipient_location
Only this state, as a two-letter USPS code, e.g. `CA`. With `level=county`, its counties.
one of: AL, AK, AZ, AR, CA, CO, CT, DE, DC, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY, AS, GU, MP, PR, VI
`contracts` (default), `grants`, `loans`, `direct_payments`, `other` or `all`.
one of: contracts, grants, loans, direct_payments, other, all
NAICS industry codes, comma-separated, up to 20. Each has 2, 4 or 6 digits; a shorter code covers its whole family, e.g. `4811` (scheduled air transport) or `54`.
Federal product and service codes (PSC), comma-separated, up to 20. 1 to 4 characters; a shorter code covers its family, e.g. `D3` (IT services) or `R425`.
Text matched against award descriptions, e.g. `cybersecurity`. 3 to 120 characters.
min 3 chars · max 120 chars
Start of the window, `YYYY-MM-DD`, not before `2007-10-01`. Without `from` and `to`: the latest US federal fiscal year (1 October to 30 September) that ended at least 90 days ago. With only `from`: to today.
pattern: ^\d{4}-\d{2}-\d{2}$
End of the window, `YYYY-MM-DD`. With only `to`: the year up to that day.
pattern: ^\d{4}-\d{2}-\d{2}$
Endpoint-specific response payload.
one of: state, county, country
one of: place_of_performance, recipient_location
one of: contracts, grants, loans, direct_payments, other, all
Start of the window used, `YYYY-MM-DD`.
End of the window used, `YYYY-MM-DD`.
Sum of `amount` over every region returned, in US dollars.
Every region with spending in the window, largest amount first. Empty when nothing matched.
Region code: USPS state code, 5-digit county FIPS code or ISO 3166-1 alpha-3 country code. `unknown` holds obligations with no recorded location.
min 1 chars
Region name.
US dollars obligated in the window. Can be negative where de-obligations exceed new awards.
Population, when published for the region.
Dollars per resident, when the population is published.
Where the data comes from and how to credit it when you reuse it.
Who publishes the data, e.g. `Eurostat`.
min 1 chars
The publisher's dataset code, when it has one.
The dataset's title.
When the publisher last updated the data, ISO 8601.
Where the data can be viewed.
The terms the data is published under.
min 1 chars
Credit line the licence asks for when you reuse or publish the data.
min 1 chars
Metadata describing the request and billing outcome.
Unique request identifier for tracing this API call.
min 1 chars
Credits charged for this request.
≥ 0
Public API version that served the response.
one of: v1
Present, and `true`, only when the source couldn't be reached and this is the last good answer for the same request instead, up to 24 hours old. Absent on every live answer.
one of: true
When a stale answer (`stale: true`) was originally fetched (ISO 8601, UTC). Absent on every live answer.
Code example
curl "https://api.socialfetch.dev/v1/economy/government-spend?level=state&naics=4811" \
-H "x-api-key: YOUR_API_KEY"Responses
Federal spending summed by region.
Tourism spending
Get what residents of up to 10 European countries spend on trips by category (transport, accommodation, restaurants and more) and year, filtered by purpose,…
Government contracts
Search US federal contract awards by recipient, keyword, NAICS, PSC and state: amount, agency, dates, codes and places, up to 100 a page with a cursor.