Advanced Search City Autocomplete
POST
/api/v2/autocomplete/city/This end point returns a list of cities for a given limit, country, search string, and optional state code.
List of cities matching search criteria
Request
curl -X POST 'https://api.usaspending.gov/api/v2/autocomplete/city/' \
-H 'Content-Type: application/json' \
-d '{
"search_text": "Springfield",
"limit": 40,
"filter": {
"country_code": "USA",
"scope": "recipient_location",
"state_code": "VA"
}
}'Request body
search_textstringRequiredlimitnumberRequiredNumber of results to return (min: 1, max: 500)
filterobject3 fieldscountry_codestringRequiredscopeenum (string)Requiredprimary_place_of_performancerecipient_location
state_codestring
Try it
Runs against the live API. Responses are real data.
POST
/api/v2/autocomplete/city/Response · 200
countnumberRequiredresultsarray of CityMatchRequired2 fieldscity_namestringRequiredstate_codestringRequiredNullable
{
"count": 0,
"results": [
{
"city_name": "",
"state_code": null
}
]
}Recent changes
- DEV-15418: Update API contracts for dredd failures
- DEV-15418: Set max value of 'limit' to 500
- Mentioned in the June 4, 2019 release notes
Generated from contracts/v2/autocomplete/city.md in the USAspending API repo.