Skip to content

Fetch google places

geo · 3rd party API · integration

Fetch information about the most relevant places surrounding a location.

Given the latitude and longitude coordinates of a location in each row, uses the Google Places API to enrich the dataset with information about the surrounding businesses, their ratings etc. See below for further information about the specific columns to be added by the step.

API integration

To use this step your team needs to have the Google Places 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 Places integration in particular you will need access to Google's Places API. Follow the instructions here to create the required API key.

Example

To search places within a default radius of 1.5km and of arbitrary type

fetch_google_places(ds.lat, ds.lon) -> (
  ds.places_total,
  ds.places_number_ratings,
  ds.places_ratings_mean,
  ds.places_number_types,
  ds.places_types,
  ds.places_names
)

Usage

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

fetch_google_places(
    lat: number,
    lon: number, 
    {
        "param": value
    }
) -> (
    places_total: number,
    places_number_ratings: number,
    places_ratings_mean: number,
    places_number_types: number,
    places_types: list[category],
    places_names: list[category]
)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Inputs


lat: column:number

Column containing the latitude of each location.


lon: column:number

Column containing the longitude of each location.

Outputs


places_total: column:number

Number of places the API returned, maximum 10.


places_number_ratings: column:number

Number of ratings on average for the places found, proxy for place popularity.


places_ratings_mean: column:number

Average of the ratings of the places found, proxy for location index.


places_number_types: column:number

Number of different types of places found.


places_types: column:list[category]

Types of the places found, for possible categories see here.


places_names: column:list[category]

Names of the places found.

Parameters


radius: number = 1500

Search radius in meters around the given location.

Range: 10 ≤ radius < inf


type: string | null

Search for a specific type of place only. For supported types also see the Google Places documentation here.

Must be one of: "accounting", "airport", "amusement_park", "aquarium", "art_gallery", "atm", "bakery", "bank", "bar", "beauty_salon", "bicycle_store", "book_store", "bowling_alley", "bus_station", "cafe", "campground", "car_dealer", "car_rental", "car_repair", "car_wash", "casino", "cemetery", "church", "city_hall", "clothing_store", "convenience_store", "courthouse", "dentist", "department_store", "doctor", "drugstore", "electrician", "electronics_store", "embassy", "fire_station", "florist", "funeral_home", "furniture_store", "gas_station", "grocery_or_supermarket", "gym", "hair_care", "hardware_store", "hindu_temple", "home_goods_store", "hospital", "insurance_agency", "jewelry_store", "laundry", "lawyer", "library", "light_rail_station", "liquor_store", "local_government_office", "locksmith", "lodging", "meal_delivery", "meal_takeaway", "mosque", "movie_rental", "movie_theater", "moving_company", "museum", "night_club", "painter", "park", "parking", "pet_store", "pharmacy", "physiotherapist", "plumber", "police", "post_office", "primary_school", "real_estate_agency", "restaurant", "roofing_contractor", "rv_park", "school", "secondary_school", "shoe_store", "shopping_mall", "spa", "stadium", "storage", "store", "subway_station", "supermarket", "synagogue", "taxi_stand", "tourist_attraction", "train_station", "transit_station", "travel_agency", "university", "veterinary_care", "zoo"


keyword: string = ""

Specific keyword to use in the search for places.

Example parameter values:

  • "burger"