USAspending API ReferenceIndependent
Try the API

Object Classes Total

POST/api/v2/federal_accounts/{federal_account_code}/object_classes/total

This 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_codestringRequired

    Federal account code consisting of the AID and main account code

    Example 431-0500

Request body

The filters object is shared by every search endpoint. The filter object explains each filter with examples.

  • filtersobject · FederalAccountTotalsFilterObject4 fields

    This can filter by time period, object class, and/or program activity

    • federal_account_codestringRequired

      Federal account code consisting of the AID and main account code

      Example 431-0500

    • time_periodstring

      { "start_date": "2019-10-01", "end_date": "2020-09-30" }]`(optional, array[TimePeriod], fixed-type)

      Example `[

    • object_classarray of string

      Example ["\"254\""]

    • program_activityarray of string

      Each string should be either PAC or PARK code

      Example ["\"123\""]

  • limitnumber

    The number of results to include per page.

    Default 10

  • pagenumber

    The page of results to return based on the limit.

    Default 1

Try it

Runs against the live API. Responses are real data.

POST/api/v2/federal_accounts/431-0500/object_classes/total

Response · 200

  • resultsarray of ObjectClassTotalsRequired3 fields
    • obligationsnumberRequired
    • codestringRequired
    • namestringRequired
  • page_metadataobject · PageMetadataRequired7 fields
    • limitnumberRequired
    • pagenumberRequired
    • nextnumberRequiredNullable
    • previousnumberRequiredNullable
    • hasNextbooleanRequired
    • hasPreviousbooleanRequired
    • totalnumberRequired
Example response
  {
      "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.

Loading…