Skip to content

Fetch location

geo · 3rd party API · integration

Extract formatted address, locality, area, state, country and geographical coordinates from one or more address columns.

It is possible to specify a postal code as a standalone column, but this will be interpreted as American without a proper prefix. To use Spanish postal codes indicate this using the "CP" prefix, e.g. "CP 28001".

API integration

To use this step your team needs to have the Google Location integration configured in Graphext. The corresponding credentials are required to connect to a third-party API. See our help center for details on how to configure your team's integrations.

To enable the Google Location integration in particular you will need access to Google's geocoding service. Follow the instructions here to create the required API key.

Example

Since the step has no configuration parameters, simply use

fetch_location(ds.address) -> (
  ds.canonical_address,
  ds.locality,
  ds.area,
  ds.state,
  ds.country,
  ds.lat,
  ds.lon)

Usage

The following are the step's expected inputs and outputs and their specific types.

fetch_location(*address_columns: text|category|number) -> (
    formatted_address: category,
    locality: category,
    area: category,
    state: category,
    country: category,
    lat: number,
    lon: number
)

Inputs


*address_columns: column:text|category|number

One or more text or categorical columns containing all or parts of an address (e.g. street, city, postal code etc.). If several parts are specified in a single column they should be separated by a comma.

Outputs


formatted_address: column:category

Categorical column containing the original address in a standardized format.


locality: column:category

Categorical column containing each address's locality.


area: column:category

Categorical column containing each address's area.


state: column:category

Categorical column containing each address's state or region.


country: column:category

Categorical column containing each address's country.


lat: column:number

Numeric column containing the latitude coordinate of the address.


lon: column:number

Numeric column containing the longitude coordinate of the address.