Within the Addressing REST API, a request to the Address Autocomplete Postalcode-City Service returns a list of results. Not every field will be returned with a result.
| Field | Type | Description |
|---|---|---|
| errorMessage | String | Error message: The error message returned from the service with an error code. |
| status | Status | Status of the response. |
| results | <Result array> | List of results based on the specified criteria. |
Address Autocomplete Postalcode-City Service Examples:
Postcode-City Search: Below is an example response for Postcode-City Search:
"address":
{
"postAddress": "troy 480",
"country": "USA"
}{
"response": {
"status": "OK",
"predictions": [
{
"address": {
"country": {
"isoAlpha3Code": "USA"
},
"admin1": {
"longName": "MI",
"shortName": "MI"
},
"admin2": {
"longName": "Oakland",
"shortName": "Oakland"
},
"city": {
"longName": "Troy",
"shortName": "Troy"
},
"postalCode": "48007"
},
"location": {
"feature": {
"type": "Feature",
"properties": {
"crsName": "epsg:4326"
},
"geometry": {
"type": "Point",
"coordinates": [
-83.14753,
42.55997
]
}
}
}
}
]
}
}Postcode Only Search: Below is an example response for Postcode Only Search:
"address":
{
"type": "POSTAL",
"postAddress": "120",
"country": "FRA"
}{
"response": {
"status": "OK",
"predictions": [
{
"address": {
"country": {
"isoAlpha3Code": "FRA"
},
"admin1": {
"longName": "Occitanie",
"shortName": "Occitanie"
},
"admin2": {
"longName": "Aveyron",
"shortName": "Aveyron"
},
"city": {
"longName": "Le Monastère",
"shortName": "Le Monastère"
},
"postalCode": "12000"
},
"location": {
"feature": {
"type": "Feature",
"properties": {
"crsName": "epsg:4326"
},
"geometry": {
"type": "Point",
"coordinates": [
2.57354,
44.35113
]
}
}
}
}
]
}
}City Only Search: Below is an example response for City Only Search:
"address":
{
"type": "CITY",
"postAddress": "la fer",
"country": "FRA"
}{
"response": {
"status": "OK",
"predictions": [
{
"address": {
"country": {
"isoAlpha3Code": "FRA"
},
"admin1": {
"longName": "Hauts-De-France",
"shortName": "Hauts-De-France"
},
"admin2": {
"longName": "Aisne",
"shortName": "Aisne"
},
"city": {
"longName": "La Fère",
"shortName": "La Fère"
},
"postalCode": "02800"
},
"location": {
"feature": {
"type": "Feature",
"properties": {
"crsName": "epsg:4326"
},
"geometry": {
"type": "Point",
"coordinates": [
3.45105,
49.68411
]
}
}
}
}
]
}
}Response Fields
ResponseElement |
Type | Description |
|---|---|---|
| address | ResponseAddress | Displays components of the address. |
| admin1 | AdminField | Specifies the largest geographic area, typically a state or province.
NewYork or
Maharashtra. |
| admin2 | AdminField | Specifies the secondary geographic area, typically a county
or district. DouglasCounty or West
Mumbai. |
| borough | AdminField | Unit of local government or other administrative
subdivision.
|
| city | AdminField | Specifies a city or town name. NewYork
City |
| country | CountryField | Values are based on the ISO 3166-1 standard for country codes (returned in alpha-2,alpha-3, or numeric format). |
| customFields | Object | Returns additional information about the address (Placeholder only). |
| geometry | Geometry | Provides the candidate's geometry. |
location |
Location | Describes the location type and coordinates. |
| neighborhood | AdminField | Specifies a city subdivision or locality. "" |
| placeName | String | If applicable, indicates the name of the place. |
| postalCode | String | Main postal code.
|
| postalCodeExt | String | Secondary postal code, if one exists. For example, in the US, a ZIP+4 is 80125-8012. 8012 |
| properties | Object | crsName- The coordinate reference system(CRS) used for the
candidate's geocode.Expressed in epsg:nnnn format; the default
is epsg:4326. |
| suburb | AdminField | Mixed-use or residential area within commuting distance of a city or
urban area. "" |
| type | String | Feature |
Status Codes
|
Response |
Status Code | Description |
|---|---|---|
OK |
200 | The request was valid and results were found. |
|
|
401 | Invalid Token |
ZERO_RESULTS |
200 | The request was valid but no results were found. |
|
|
400 | Invalid information was encountered in the request. |
|
|
400 | Request body or parameter format is not correct. |
INVALID_TOKEN |
401 | Invalid Token was encountered. |
UNAUTHORIZED |
401 | Unauthorized request encountered |
INTERNAL_ERROR |
500 | An internal error occurred. |
SERVICE_UNAVAILABLE |
503 | Service is not available to serve the request. |
Versioning
The API currently uses versioning to ensure that any changes to the API are backwards-compatible. This means that new properties can be added to responses, new endpoints can be added, new optional request parameters can be added, and the order of properties can be changed without breaking existing clients. If backwards-incompatible changes are made in the future, they will be released under a new versioned endpoint.