Awarding Agency and Office Autocomplete
/api/v2/autocomplete/awarding_agency_office/This endpoint can be used to autocomplete Awarding Agency and Office searches on the Advanced Search page. It will return any agencies, sub-agencies, and offices that match the search text. Additionally, any matching agencies will include associated offices and sub-agencies, any matching sub-agencies will include associated agencies and offices, and any matching offices will include associated agencies and sub-agencies.
This route sends a request to the backend to retrieve awarding agencies and offices matching the specified search text.
Request
curl -X POST 'https://api.usaspending.gov/api/v2/autocomplete/awarding_agency_office/' \
-H 'Content-Type: application/json' \
-d '{
"search_text": "Defense"
}'Request body
limitnumberNumber of results to return (min: 1, max: 500)
search_textstringRequiredSearch text can be an office or agency name, or it can be an agency abbreviation. For example, try searching for DoD and Department of Defence.
Try it
Runs against the live API. Responses are real data.
/api/v2/autocomplete/awarding_agency_office/Response · 200
resultsarray of AwardingAgencyOfficeMatchObjectRequired3 fieldstoptier_agencyobjectRequired5 fieldsabbreviationstringRequiredNullablecodestringRequirednamestringRequiredsubtier_agenciesarray of SubAgenciesChildObjectRequired3 fieldsabbreviationstringRequiredNullablecodestringRequiredNullablenamestringRequired
officesarray of OfficesChildObjectRequired2 fieldscodestringRequirednamestringRequired
subtier_agencyobjectRequired5 fieldsabbreviationstringRequiredNullablecodestringRequirednamestringRequiredtoptier_agencyobject · AgenciesChildObjectRequired3 fieldsabbreviationstringRequiredNullablecodestringRequirednamestringRequired
officesarray of OfficesChildObjectRequired2 fieldscodestringRequirednamestringRequired
officeobjectRequired4 fieldscodestringRequiredNullablenamestringRequiredtoptier_agencyobject · AgenciesChildObjectRequired3 fieldsabbreviationstringRequiredNullablecodestringRequirednamestringRequired
subtier_agencyobject · SubAgenciesChildObjectRequired3 fieldsabbreviationstringRequiredNullablecodestringRequiredNullablenamestringRequired
messagesarray of stringRequiredAn array of warnings or instructional directives to aid consumers of this endpoint with development and debugging.
{
"results": [
{
"toptier_agency": {
"abbreviation": null,
"code": "",
"name": "",
"subtier_agencies": [
{
"abbreviation": null,
"code": null,
"name": ""
}
],
"offices": [
{
"code": "",
"name": ""
}
]
},
"subtier_agency": {
"abbreviation": null,
"code": "",
"name": "",
"toptier_agency": {
"abbreviation": null,
"code": "",
"name": ""
},
"offices": [
{
"code": "",
"name": ""
}
]
},
"office": {
"code": null,
"name": "",
"toptier_agency": {
"abbreviation": null,
"code": "",
"name": ""
},
"subtier_agency": {
"abbreviation": null,
"code": null,
"name": ""
}
}
}
],
"messages": []
}Recent changes
Generated from contracts/v2/autocomplete/awarding_agency_office.md in the USAspending API repo.