Spending Over Time
/api/v2/search/spending_over_time/This endpoint supports the advanced search page and allow for complex filtering for specific subsets of spending data.
This endpoint returns a list of aggregated award amounts grouped by time period in ascending order (earliest to most recent).
Request
curl -X POST 'https://api.usaspending.gov/api/v2/search/spending_over_time/' \
-H 'Content-Type: application/json' \
-d '{
"group": "fiscal_year",
"filters": {
"keywords": [
"Filter is required"
]
}
}'Request body
The filters object is shared by every search endpoint. The filter object explains each filter with examples.
groupenum (string)Requiredcalendar_yearfiscal_yearquartermonth
filtersobject · AdvancedFilterObjectRequired24 fieldskeywordsarray of stringdescriptionstringtime_periodarray of TimePeriodObjectThis TimePeriodObject can fall into different categories based on the request.
-
if
subawardstrueSee the Subaward Search category defined in SubawardSearchTimePeriodObject
-
otherwise
See the Transaction Search category defined in TransactionSearchTimePeriodObject
-
place_of_performance_scopeenum (string)domesticforeign
place_of_performance_locationsarray of LocationObjectThese fields are defined in the StandardLocationObject
agenciesarray of AgencyObject4 fieldstypeenum (string)Requiredawardingfunding
tierenum (string)Requiredtoptiersubtier
namestringRequiredtoptier_namestringOnly applicable when
tierissubtier. Ignored whentieristoptier. Provides a means by which to scope subtiers with common names to a specific toptier. For example, several agencies have an "Office of Inspector General". If not provided, subtiers may span more than one toptier.
recipient_search_textarray of stringrecipient_scopeenum (string)domesticforeign
recipient_locationsarray of LocationObjectThese fields are defined in the StandardLocationObject
recipient_type_namesarray of stringaward_type_codesarrayList of filterable award types
award_idsarray of stringAward IDs surrounded by double quotes (e.g.
"SPE30018FLJFN") will perform exact matches as opposed to the default, fuzzier full text matches. Useful for Award IDs that contain spaces or other word delimiters.award_amountsarray of AwardAmounts2 fieldslower_boundnumberupper_boundnumber
program_numbersarray of stringnaics_codesobject · NAICSCodeObject2 fieldsrequirearray of stringexcludearray of string
tas_codesarray of TASCodeObject2 fieldsrequirearray of stringexcludearray of string
psc_codesenum (PSCCodeObject)Supports new PSCCodeObject or legacy array of codes.
contract_pricing_type_codesarray of stringset_aside_type_codesarray of stringextent_competed_type_codesarray of stringtreasury_account_componentsarray of TreasuryAccountComponentsObject7 fieldsatastringNullableAllocation Transfer Agency Identifier - three characters
aidstringRequiredAgency Identifier - three characters
bpoastringNullableBeginning Period of Availability - four digits
epoastringNullableEnding Period of Availability - four digits
astringNullableAvailability Type Code - X or null
mainstringRequiredMain Account Code - four digits
substringNullableSub-Account Code - three digits
program_activityarray of numberprogram_activitiesarray of ProgramActivityObjectA filter option that supports filtering by a program activity name or code. Please note that if this filter is used at least one of the members of the object, ProgramActivityObject, need to be provided.
def_codesarray of DEFCIf the
def_codesprovided are in the COVID-19 or IIJA group, the query will only return results of transactions where theaction_dateis on or after the enactment date of the public law associated with that disaster code.
subawardsbooleanTrue to group by sub-awards instead of prime awards. Defaults to false.
spending_levelenum (string)Group the spending by level. This also determines what data source is used for the totals.
transactionsawardssubawards
Try it
Runs against the live API. Responses are real data.
/api/v2/search/spending_over_time/Response · 200
groupenum (string)Requiredcalendar_yearfiscal_yearquartermonth
spending_levelenum (string)RequiredSpending level value that was provided in the request.
transactionsawardssubawards
resultsarray of TimeResult15 fieldstime_periodobject · TimePeriodGroupRequired4 fieldscalendar_yearstringDepending on the grouping, either
calendar_yearorfiscal_yearwill always be returned.fiscal_yearstringquarterstringExcluded when grouping by
fiscal_yearormonthorcalendar_year.monthstringExcluded when grouping by
fiscal_yearorquarterorcalendar_year.
aggregated_amountnumberRequiredThe aggregate award amount for this time period and the given filters.
Contract_ObligationsnumberRequiredLoan_ObligationsnumberRequiredIdv_ObligationsnumberRequiredGrant_ObligationsnumberRequiredDirect_ObligationsnumberRequiredOther_ObligationsnumberRequiredtotal_outlaysnumberRequiredNullableThe aggregate outlay amount for this time period and the given filters.
Contract_OutlaysnumberRequiredNullableLoan_OutlaysnumberRequiredNullableIdv_OutlaysnumberRequiredNullableGrant_outlaysnumberRequiredNullableDirect_OutlaysnumberRequiredNullableOther_OutlaysnumberRequiredNullable
messagesarray of stringAn array of warnings or instructional directives to aid consumers of this endpoint with development and debugging.
{
"group": "calendar_year",
"spending_level": "transactions",
"results": [
{
"time_period": {},
"aggregated_amount": 0,
"Contract_Obligations": 0,
"Loan_Obligations": 0,
"Idv_Obligations": 0,
"Grant_Obligations": 0,
"Direct_Obligations": 0,
"Other_Obligations": 0,
"total_outlays": null,
"Contract_Outlays": null,
"Loan_Outlays": null,
"Idv_Outlays": null,
"Grant_outlays": null,
"Direct_Outlays": null,
"Other_Outlays": null
}
],
"messages": []
}Recent changes
- DEV-13063: Update test and api contract
- Mentioned in the July 8, 2025 release notes
- Mentioned in the May 06, 2025 release notes
- DEV-10821: Remove object_class from search endpoint api contracts
- DEV-11551: Update API Contracts
Generated from contracts/v2/search/spending_over_time.md in the USAspending API repo.