Provides intelligent suggestions for postal codes and city
The Autocomplete Postal-City API provides intelligent suggestions for postal codes and city names based on partial input provided by the user. It is designed to enhance user experience in various applications that involve postal codes and city selection.
The API suggestions can be controlled by the type field which determines whether the suggestions should be based on only postal code or only city or mix of postal code and city.
This is an optional field. If it is not provided then the suggestions will be mix of postal code and city based.
It can have 2 values:
-
POSTAL : Suggestions will be based on postal codes only.
-
CITY : Suggestions will be based on city only.
Request
- Base URL: https://api.cloud.precisely.com
- URL: https://api.cloud.precisely.com/v1/autocomplete/postal-city
- Auth: one of:
- HTTP bearer
- API key in header Authorization
Headers
The X-Request-Id header is optional but incredibly useful for developers. It serves as a unique identifier for requests within our system. When you encounter any problems with your requests, providing us with the X-Request-Id will enable us to pinpoint the specific request in question without the need for extensive manual searching. This means faster and more efficient troubleshooting. The maximum allowed length is 38 characters.
Request body
Example request
{
"preferences": {
"maxResults": 1,
"returnAllInfo": true,
"factoryDescription": {
"label": "asd",
"featureSpecific": {
"LOOKUP": "ggs"
}
},
"customPreferences": {
"DATA_OPTION": "PREMIUM"
},
"clientLocale": {
"language": "en",
"script": "Latn",
"country": "US",
"variant": "POSIX",
"unicodeLocaleAttributes": [
"attribute1",
"attribute2"
],
"unicodeLocaleKeys": {
"nu": "thai"
},
"extensionKeys": {
"x": "private-use"
}
},
"clientCoordSysName": "EPSG:4326",
"distance": {
"value": 5,
"distanceUnit": "METER"
},
"streetOffset": {
"value": 5,
"distanceUnit": "METER"
},
"cornerOffset": {
"value": 5,
"distanceUnit": "METER"
},
"matchMode": "EXACT",
"originXY": [
0,
0
],
"returnOfAdditionalFields": [
"RESULT_CODE",
"PRECISION_CODE"
]
}
}Response
Address predicted successfully
Example response
{
"response": {
"status": "OK",
"errorMessage": "Not able to identify ABC country",
"predictions": [
{
"address": {
"country": {
"name": "UNITED STATES",
"isoAlpha2Code": "US",
"isoAlpha3Code": "USA",
"isoNumericCode": "840"
},
"admin1": {
"longName": "New York or Maharashtra",
"shortName": "NY"
},
"admin2": {
"longName": "New York or Maharashtra",
"shortName": "NY"
},
"city": {
"longName": "New York or Maharashtra",
"shortName": "NY"
},
"postalCode": "12180"
},
"location": {
"explanation": {
"type": "ADDRESS_POINT",
"description": "STREET_BLOCK",
"designation": "CENTROID",
"additionalMetadata": {
"SOURCE": "PRECISELY"
}
},
"feature": {
"geometry": {
"type": "Point",
"coordinates": [
-73.704719,
42.682251
],
"foreignMembers": {
"city": "New York",
"population": "8419600",
"founded": "1624"
}
},
"properties": {
"crsName": "epsg:4326"
},
"type": "Feature"
}
}
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.