Economy

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.

GET/v1/economy/government-spend
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
9
levelstringquery

What to sum by: `state` (default), `county` or `country` (spending abroad included).

one of: state, county, country

scopestringquery

`place_of_performance` (default, where the work is done) or `recipient_location` (where the recipient is based).

one of: place_of_performance, recipient_location

statestringquery

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

awardTypestringquery

`contracts` (default), `grants`, `loans`, `direct_payments`, `other` or `all`.

one of: contracts, grants, loans, direct_payments, other, all

naicsarrayquery

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`.

pscarrayquery

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`.

keywordstringquery

Text matched against award descriptions, e.g. `cybersecurity`. 3 to 120 characters.

min 3 chars · max 120 chars

fromstringquery

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}$

tostringquery

End of the window, `YYYY-MM-DD`. With only `to`: the year up to that day.

pattern: ^\d{4}-\d{2}-\d{2}$

Response fields
27

Endpoint-specific response payload.

datalevel
string

one of: state, county, country

datascope
string

one of: place_of_performance, recipient_location

dataawardType
string

one of: contracts, grants, loans, direct_payments, other, all

datafrom
string

Start of the window used, `YYYY-MM-DD`.

datato
string

End of the window used, `YYYY-MM-DD`.

datatotalAmount
number

Sum of `amount` over every region returned, in US dollars.

Every region with spending in the window, largest amount first. Empty when nothing matched.

dataregions[]code
string

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

dataregions[]name
stringnullable

Region name.

dataregions[]amount
number

US dollars obligated in the window. Can be negative where de-obligations exceed new awards.

dataregions[]population
integernullable

Population, when published for the region.

dataregions[]perCapita
numbernullable

Dollars per resident, when the population is published.

Where the data comes from and how to credit it when you reuse it.

datasourcepublisher
string

Who publishes the data, e.g. `Eurostat`.

min 1 chars

datasourcedataset
stringnullable

The publisher's dataset code, when it has one.

datasourcetitle
stringnullable

The dataset's title.

datasourceupdatedAt
stringnullable

When the publisher last updated the data, ISO 8601.

datasourceurl
stringnullable

Where the data can be viewed.

datasourcelicence
string

The terms the data is published under.

min 1 chars

datasourceattribution
string

Credit line the licence asks for when you reuse or publish the data.

min 1 chars

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metastale
booleanoptional

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

metafetchedAt
stringoptional

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.