This section describes how address autocomplete works for one or more addresses using the Address Autocomplete API. You may want to try it out with a Free Trial Account.
- HTTP Request
- URL Composition
- Base URL: https://api.cloud.precisely.com
- Address Autocomplete: /v1/autocomplete
- Supported Methods: POST only
- Rate Limit (Transactions per second): 120
- Input Fields Each request to the API service requires a few
parameters, all of which are listed below. All requests require a
Bearer token, that can be generated using your account's
key-secret. To produce a bearer token for an API request, the
generated key-secret combinations are used . The generated token
is valid for 3600sec (1 hour) and then it needs to be
regenerated.
The data should be encoded as a JSON array where each element in the array is a JSON object with field names identical to those in the input/output fields listed below.
Table 1. Parameters Parameter Description Example Value preferencesOptions supported by the Address Geocode Service which includes a variety of settings for match mode, geocode type, candidates returned, fallbacks, offsets, match address elements, ranges information and more.
Default = 1.maxResults: The maximum number of candidates to return. Optional. Must be an integer value.addressesList of addresses to be processed. addressLines:Requested address, based on the country's addressing standard.
Single-line request:
"10 downing street london SW1A 2AA"
Multi-line request:
"10 DOWNING STREET",
"LONDON, SW1A 2AA"
Below is a sample request with an address request to Address Autocomplete Service{ "preferences": { "maxResults": 2, "returnAllInfo": true, "factoryDescription": { "label": "", "featureSpecific": {} }, "clientLocale": "", "clientCoordSysName": "", "distance": { "value": 150, "distanceUnit": "METER" }, "streetOffset": { "value": 7, "distanceUnit": "METER" }, "cornerOffset": { "value": 7, "distanceUnit": "METER" }, "fallbackToGeographic": false, "fallbackToPostal": false, "matchMode": "", "returnOfAdditionalFields": false, "originXY": [], "customPreferences": {} }, "address": { "addressLines": [ "350 Jordan" ], "country": "USA", "addressNumber": "", "admin1": "", "admin2": "", "city": "", "borough": "", "neighborhood": "", "suburb": "", "postalCode": "", "postalCodeExt": "", "placeName": "", "street": "", "building": "", "floor": "", "room": "", "unit": "", "unitType": "" } }
- URL Composition
Preferences
Below are the preferences for Address Autocomplete Service:
| Option | Type | Description |
| clientCoordSysName | String | Specifies the coordinate system that you want to convert the geometry to. The
format must be the European Petroleum Survey Group (EPSG) code or the SRID code.
Default = EPSG:4326. Specify the coordinate reference system
in the format
codespace:code.Note: The
API always returns the output coordinates in EPSG:4326, regardless of the
input coordinate system.
|
| customPreferences |
Object |
Custom preference are optional preferences which are used to control certain additional functionalities please see the list of custom preferences for details. |
| distance | Distance | Define the search radius. The default is 5 meters. |
| maxResults | Integer | The maximum number of candidates to return. Default = 1. |
| originXY | <Double> array | XY coordinates of the origin address.
{
"preferences" :
{
"originXY" : [-73.70252500000001, 42.68323]
},
"address" :
{
"mainAddressLine" : "350 Jordan Rd"
}
}
|
| returnAllInfo | Boolean | Specifies whether to return all available information for
each candidate.
|
| returnOfAdditionalFields | <String> array |
This lets the user control which additional fields they want to have returned if they do not want to return all info. For example, to return the PreciselyID, use the value
PB_KEY |
| type | String |
Indicates the geocode type to be performed.
|
Request Parameters
The below table lists the request parameters for Address Autocomplete Service:
| Parameter | Type | Description |
| addressLines | List | Requested address, based on the country's addressing
standard. Single-line request: |
| addressNumber | String | House or building number.
|
| admin1 | String | The largest geographic area, typically a state or
province.
|
| admin2 | String | The secondary geographic area, typically a county or
district.
|
| borough | String | Unit of local government or other administrative
subdivision.
|
| building | String | A roofed and walled structure built for permanent use. |
| city | String | Specifies a city or town name.
|
| country | String | Values are based on the ISO 3166-1 standard for country codes (returned in alpha-2, alpha-3, or numeric format). |
| floor | String | Each level within a building. |
| neighborhood | String | A city subdivision or locality.
|
| placeName | String | If applicable, indicates the name of the candidate's place or
building.
|
| postalCode | String | Main postal code.
|
| postalCodeExt | String | Secondary postal code, if one exists. For example, in the US,
a ZIP+4 is 80125-8012.
|
| room | String | A single room within a building. |
| suburb | String | Mixed-use or residential area within commuting distance of a city or urban area. |
| unit | String | The unit number, such as "3B". |
| unitType | String | A group or suite of rooms within a building that are under
common ownership or tenancy, typically having a common entrance.
(APT, STE,
FLAT, etc.). |
|
X-Request-Id (header) |
String | 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. |
| X-Transaction-Id (header) |
String | To efficiently manage a high volume of API calls and maintain organization, we group API calls for the same address into a single "transaction." A transaction is considered complete when one of the following conditions is met:
whichever happens first. The Transaction ID (GUID) must be sent as
part of the If the same Transaction ID is reused after a transaction is marked complete, our system will treat it as a new transaction while keeping the same ID. Examples: 15-Second Scenario: A user starts typing
an address and includes a Transaction ID (e.g.,
12-Call Scenario: Another user types quickly and includes a
Transaction ID (e.g., 1234-5678-ABCD)
in the x-transaction-id header:
5678-1234-EFGH) in the
x-transaction-id header:
|