Object Classes Total
/api/v2/federal_accounts/{federal_account_code}/object_classes/totalThis endpoint returns an array of object classes obligation, code, and name for the specified federal account
Request
curl -X POST 'https://api.usaspending.gov/api/v2/federal_accounts/431-0500/object_classes/total' \
-H 'Content-Type: application/json' \
-d '{
"filters": {
"time_period": [
{
"start_date": "2019-10-01",
"end_date": "2020-09-30"
}
],
"program_activity": [
"001"
]
}
}'Path parameters
federal_account_codestringRequiredFederal account code consisting of the AID and main account code
Request body
The filters object is shared by every search endpoint. The filter object explains each filter with examples.
filtersobject · FederalAccountTotalsFilterObject4 fieldsThis can filter by time period, object class, and/or program activity
federal_account_codestringRequiredFederal account code consisting of the AID and main account code
time_periodstring{ "start_date": "2019-10-01", "end_date": "2020-09-30" }]`(optional, array[TimePeriod], fixed-type)
object_classarray of stringprogram_activityarray of stringEach string should be either PAC or PARK code
limitnumberThe number of results to include per page.
pagenumberThe page of results to return based on the limit.
Try it
Runs against the live API. Responses are real data.
/api/v2/federal_accounts/431-0500/object_classes/totalResponse · 200
resultsarray of ObjectClassTotalsRequired3 fieldsobligationsnumberRequiredcodestringRequirednamestringRequired
page_metadataobject · PageMetadataRequired7 fieldslimitnumberRequiredpagenumberRequirednextnumberRequiredNullablepreviousnumberRequiredNullablehasNextbooleanRequiredhasPreviousbooleanRequiredtotalnumberRequired
{
"results": [
{"obligations": 44112.0, "code": "00000000003", "name": "object class 3"},
{"obligations": 6000.0, "code": "00000000001", "name": "object class 1"},
{"obligations": 130.0, "code": "00000000002", "name": "object class 2"},
{"obligations": 1.0, "code": "0001", "name": "object classN 1"},
],
"page_metadata": {
"page": 1,
"total": 4,
"limit": 10,
"next": None,
"previous": None,
"hasNext": False,
"hasPrevious": False
},
}Recent changes
Contract notes
The contract's example request body isn't valid JSON (single quotes or trailing commas), so it was corrected here.
Generated from contracts/v2/federal_accounts/federal_account_totals/object_classes.md in the USAspending API repo.