Skip to main content
Query

searchAddresses

Finds postal addresses matching a partly typed address, best match first, for an address field that fills itself in. Nothing is saved: copy the chosen address into the record. Returns an empty list when the query is shorter than 3 characters or nothing matched. Works without signing in. Rate-limited per user (per IP when not signed in); a refusal is the RATE_LIMITED error.

Arguments

  • countryCodeString

    Only return addresses in this country, as an ISO 3166-1 alpha-2 code such as CH.

  • Prefer addresses near this point, such as the space's own address.

  • queryString!

    What has been typed so far, such as Bahnhofstrasse 1 Zür. Up to 260 characters.

Returns

[AddressSuggestion!]!

Example

query SearchAddresses($countryCode: String, $near: CoordinatesInput, $query: String!) {
  searchAddresses(countryCode: $countryCode, near: $near, query: $query) {
    attribution
    id
    label
  }
}