spending_by_category
Read-only
Aggregate spending by a dimension (top vendors, top agencies, top NAICS, etc.).
The 'category' parameter controls the grouping dimension. Common uses:
- category='recipient': top vendors for a filter set (vendor landscape analysis)
- category='awarding_subagency': which contracting offices within an agency
- category='naics': which work categories got the most spending
- category='psc': which product/service codes got the most spending
- category='state_territory': geographic distribution
- category='cfda': grant assistance listings
Note: recipient category returns vendor names in ALL CAPS and may contain
duplicates (subsidiaries, rebrands, re-registrations). For precise market
share, apply name normalization to the returned 'name' field.
At least one filter is required. An unfiltered call would silently
aggregate the entire USASpending database (all years, all agencies),
which is never what a caller wants.
date_type controls the transaction date window. Omitted (the default)
or 'action_date', it selects transaction actions inside the window.
'date_signed' selects the associated award's first signing date;
'last_modified_date' selects transaction update dates. 'new_awards_only'
retains in-window actions associated with awards first signed in the
window. These are transaction obligation totals, not new-award counts:
use new_awards_over_time for counts. Award search/count tools use a
different default interval-overlap rule.
date_type needs time_period_start and/or time_period_end.
program_numbers filters assistance awards by assistance listing (CFDA)
number, e.g. ['93.778'] for Medicaid; use it with award_type='grants',
'loans', 'direct_payments', or 'other'. autocomplete_cfda() finds numbers
by program name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| limit | No | ||
| category | Yes | ||
| keywords | No | ||
| date_type | No | ||
| def_codes | No | ||
| psc_codes | No | ||
| award_type | No | ||
| naics_codes | No | ||
| funding_agency | No | ||
| recipient_name | No | ||
| awarding_agency | No | ||
| program_numbers | No | ||
| time_period_end | No | ||
| time_period_start | No | ||
| awarding_subagency | No | ||
| set_aside_type_codes | No | ||
| extent_competed_type_codes | No | ||
| contract_pricing_type_codes | No |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||