Skip to content
Get started

Get Autocomplete Previews

client.intlAddressVerification.getAutocompletePreviews(IntlAddressVerificationGetAutocompletePreviewsParams { advanced, cityFilter, container, 9 more } query?, RequestOptionsoptions?): IntlAddressVerificationGetAutocompletePreviewsResponse { data, message, status }
GET/v1/intl_addver/completions

Returns address completion previews for a partial address string, suitable for populating an autocomplete dropdown.

Regular mode — supply partialStreet to search by partial street address. Results may include Address types (resolvable directly) and Container types (buildings/complexes that require a follow-up call).

Advanced mode — supply advanced=true and a container ID (from a previous regular call) to drill into a building or complex and retrieve individual unit addresses.

Results with type: "Address" can be fully resolved by passing their id to POST /completions.

  • Does not consume a lookup.
ParametersExpand Collapse
query: IntlAddressVerificationGetAutocompletePreviewsParams { advanced, cityFilter, container, 9 more }
advanced?: boolean
cityFilter?: string
container?: string
countriesFilter?: string
disableIPBiasing?: boolean
language?: string
limit?: number
partialStreet?: string
postalOrZipFilter?: string
standardFallback?: boolean
streetFilter?: string
useEnhancedChinaDataset?: boolean
ReturnsExpand Collapse
IntlAddressVerificationGetAutocompletePreviewsResponse { data, message, status }
data: Array<Data>
id?: string

The unique identifier for this result. Pass this to POST /completions to retrieve the full address. If the type is Container, pass it as the container parameter to GET /completions to drill down further.

description?: string

A secondary description of the result (e.g. city and country).

error?: string

An error message if the lookup failed for this result.

highlight?: string

Character ranges within text that match the search input, for bolding in UI.

text?: string

The human-readable address suggestion text.

type?: string

The type of result. Address means this can be resolved directly via POST /completions. Container means the result represents a building or complex — perform another GET /completions with this id as container to get individual unit addresses.

message: string
status: "success" | "error"
One of the following:
"success"
"error"

Get Autocomplete Previews

import PostGrid from 'postgrid-node';

const client = new PostGrid({
  addressVerificationAPIKey: process.env['POSTGRID_ADDRESS_VERIFICATION_API_KEY'], // This is the default and can be omitted
});

const response = await client.intlAddressVerification.getAutocompletePreviews();

console.log(response.data);
{
  "status": "success",
  "message": "Address previews retrieved successfully",
  "data": [
    {
      "id": "GB|RM|A|54186236",
      "type": "Address",
      "text": "Flat 1, One Canada Square",
      "description": "London, E14 5AB"
    }
  ]
}
{
  "status": "success",
  "message": "Address previews retrieved successfully",
  "data": [
    {
      "id": "GB|RM|A|54186236",
      "type": "Address",
      "text": "10 Downing Street",
      "description": "London, SW1A 2AA"
    }
  ]
}
Returns Examples
{
  "status": "success",
  "message": "Address previews retrieved successfully",
  "data": [
    {
      "id": "GB|RM|A|54186236",
      "type": "Address",
      "text": "Flat 1, One Canada Square",
      "description": "London, E14 5AB"
    }
  ]
}
{
  "status": "success",
  "message": "Address previews retrieved successfully",
  "data": [
    {
      "id": "GB|RM|A|54186236",
      "type": "Address",
      "text": "10 Downing Street",
      "description": "London, SW1A 2AA"
    }
  ]
}