ByteChef LogoByteChef

Google Maps

Google Maps is a widely used mapping service by Google, offering free and feature-rich navigation, location discovery, and real-time traffic updates accessible through web browsers and mobile apps.

Categories: Helpers

Type: googleMaps/v1


Connections

Version: 1

api_key

Properties

NameLabelTypeDescriptionRequired
api_tokenAPI KeySTRINGAPI key that can be found at Google Cloud Console.true

Connection Setup

Create OAuth 2.0 Application

Creation of OAuth 2.0 application is documented here.

Enable Geocoding API, Places API and Routes API

  1. In the Google Cloud Console, select your project.
  2. Click this icon.
  3. Click on APIs & Services.
  4. Enter Geocoding API in search bar.
  5. Click on Geocoding API.
  6. Click on Enable.
  7. Enter Places API in search bar.
  8. Click on Places API.
  9. Click on Enable.
  10. Enter Routes API in search bar.
  11. Click on Routes API.
  12. Click on Enable.

Actions

Get Address

Name: getAddress

Get address from inputted geolocation.

Properties

NameLabelTypeDescriptionRequired
latitudeLatitudeNUMBERLatitude of the geolocation.true
longitudeLongitudeNUMBERLongitude of the geolocation.true

Example JSON Structure

{
  "label" : "Get Address",
  "name" : "getAddress",
  "parameters" : {
    "latitude" : 0.0,
    "longitude" : 0.0
  },
  "type" : "googleMaps/v1/getAddress"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultsARRAY
Items [{[{STRING(long_name), STRING(short_name), [STRING](types)}](address_components), STRING(formatted_address), {{NUMBER(lat), NUMBER(lng)}(location), STRING(location_type), {{NUMBER(lat), NUMBER(lng)}(northeast), {NUMBER(lat), NUMBER(lng)}(southwest)}(viewport)}(geometry), [{NUMBER(latitude), NUMBER(longitude)}($location)](navigation_points), STRING(place_id), {STRING(compound_code), STRING(global_code)}(plus_code), [STRING](types)}]
When the geocoder returns results, it places them within a (JSON) results array.
statusSTRINGStatus of the request.

Output Example

{
  "results" : [ {
    "address_components" : [ {
      "long_name" : "",
      "short_name" : "",
      "types" : [ "" ]
    } ],
    "formatted_address" : "",
    "geometry" : {
      "location" : {
        "lat" : 0.0,
        "lng" : 0.0
      },
      "location_type" : "",
      "viewport" : {
        "northeast" : {
          "lat" : 0.0,
          "lng" : 0.0
        },
        "southwest" : {
          "lat" : 0.0,
          "lng" : 0.0
        }
      }
    },
    "navigation_points" : [ {
      "latitude" : 0.0,
      "longitude" : 0.0
    } ],
    "place_id" : "",
    "plus_code" : {
      "compound_code" : "",
      "global_code" : ""
    },
    "types" : [ "" ]
  } ],
  "status" : ""
}

Get Geolocation

Name: getGeolocation

Get geolocation of address.

Properties

NameLabelTypeDescriptionRequired
addressAddressSTRINGSpecify address you want geolocation of.true

Example JSON Structure

{
  "label" : "Get Geolocation",
  "name" : "getGeolocation",
  "parameters" : {
    "address" : ""
  },
  "type" : "googleMaps/v1/getGeolocation"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultsARRAY
Items [{[{STRING(long_name), STRING(short_name), [STRING](types)}](address_components), STRING(formatted_address), {{NUMBER(lat), NUMBER(lng)}(location), STRING(location_type), {{NUMBER(lat), NUMBER(lng)}(northeast), {NUMBER(lat), NUMBER(lng)}(southwest)}(viewport)}(geometry), [{NUMBER(latitude), NUMBER(longitude)}($location)](navigation_points), STRING(place_id), {STRING(compound_code), STRING(global_code)}(plus_code), [STRING](types)}]
When the geocoder returns results, it places them within a (JSON) results array.
statusSTRINGStatus of the request.

Output Example

{
  "results" : [ {
    "address_components" : [ {
      "long_name" : "",
      "short_name" : "",
      "types" : [ "" ]
    } ],
    "formatted_address" : "",
    "geometry" : {
      "location" : {
        "lat" : 0.0,
        "lng" : 0.0
      },
      "location_type" : "",
      "viewport" : {
        "northeast" : {
          "lat" : 0.0,
          "lng" : 0.0
        },
        "southwest" : {
          "lat" : 0.0,
          "lng" : 0.0
        }
      }
    },
    "navigation_points" : [ {
      "latitude" : 0.0,
      "longitude" : 0.0
    } ],
    "place_id" : "",
    "plus_code" : {
      "compound_code" : "",
      "global_code" : ""
    },
    "types" : [ "" ]
  } ],
  "status" : ""
}

Get Route

Name: getRoute

Get route between inputted origin and destination.

Properties

NameLabelTypeDescriptionRequired
originOriginSTRINGSpecify address of origin in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces.true
destinationDestinationSTRINGSpecify address of destination in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces.true
travelModeTravel ModeSTRING
Options DRIVE, BICYCLE, WALK, TRANSIT
Desired travel mode.false
routingPreferenceRouting PreferenceSTRING
Options TRAFFIC_UNAWARE, TRAFFIC_AWARE, TRAFFIC_AWARE_OPTIMAL
Routing preference of the route.false
computeAlternativeRoutesCompute Alternative RoutesBOOLEAN
Options true, false
Whether alternative routes should be computed.false
avoidTollsAvoid TollsBOOLEAN
Options true, false
Whether to avoid tolls.false
avoidHighwaysAvoid HighwaysBOOLEAN
Options true, false
Whether to avoid highways.false
avoidFerriesAvoid FerriesBOOLEAN
Options true, false
Whether to avoid ferries.false
unitsUnitsSTRING
Options METRIC, IMPERIAL
Metrics of the routefalse

Example JSON Structure

{
  "label" : "Get Route",
  "name" : "getRoute",
  "parameters" : {
    "origin" : "",
    "destination" : "",
    "travelMode" : "",
    "routingPreference" : "",
    "computeAlternativeRoutes" : false,
    "avoidTolls" : false,
    "avoidHighways" : false,
    "avoidFerries" : false,
    "units" : ""
  },
  "type" : "googleMaps/v1/getRoute"
}

Output

Type: OBJECT

Properties

NameTypeDescription
routesARRAY
Items [{[STRING](routeLabels), [{INTEGER(distanceMeters), STRING(duration), STRING(staticDuration), {STRING(encodedPolyline), {}(goeJsonLinestring)}(polyline), {{{NUMBER(latitude), NUMBER(longitude)}(latLng), INTEGER(heading)}(location)}(startLocation), {{{NUMBER(latitude), NUMBER(longitude)}(latLng), INTEGER(heading)}(location)}(endLocation)}, [{INTEGER(distanceMeters), STRING(staticDuration), {STRING(encodedPolyline), {}(goeJsonLinestring)}(polyline), {{{NUMBER(latitude), NUMBER(longitude)}(latLng), INTEGER(heading)}(location)}(startLocation), {{{NUMBER(latitude), NUMBER(longitude)}(latLng), INTEGER(heading)}(location)}(endLocation), {STRING(maneuver), STRING(instructions)}(navigationInstructions), {[{INTEGER(startPolylinePointIndex), INTEGER(endPolylinePointIndex), STRING(speed)}(speedReadingInterval)]\(speedReadingInterval)}\(travelAdvisory), {{{STRING\(text), STRING\(languageCode)}\(localizedText)}\(distance), {{STRING\(text), STRING\(languageCode)}\(localizedText)}\(staticDuration)}\(routeLegStepLocalizedValues), {{{{STRING\(name), {{{NUMBER\(latitude), NUMBER\(longitude)}\(latLng), INTEGER\(heading)}\(location)}\(location)}\(transitStop)}\(arrivalStop), STRING\(arrivalTime), {{STRING\(name), {{{NUMBER\(latitude), NUMBER\(longitude)}\(latLng), INTEGER\(heading)}\(location)}\(location)}\(transitStop)}\(departureStop), STRING\(departureTime)}\(stopDetails), {{{{{STRING\(text), STRING\(languageCode)}\(localizedText)}\(time), STRING\(timeZone)}\(localizedTime)}\(arrivalTime), {{{{STRING\(text), STRING\(languageCode)}\(localizedText)}\(time), STRING\(timeZone)}\(localizedTime)}\(departureTime)}\(localizedValues), STRING\(headsign), STRING\(headway), {[{STRING\(name), STRING\(phoneNumber), STRING\(uri)}\(transitAgency)](agencies), STRING(name), STRING(uri), STRING(color), STRING(iconUri), STRING(nameShort), STRING(textColor), {{{{STRING(text), STRING(languageCode)}(localizedText)}(name), STRING(type), STRING(iconUri), STRING(localIconUri)}(transitVehicle)}(vehicle)}(transitLine), INTEGER(stopCount), STRING(tripShortText)}(transitDetails), STRING(travelMode)}(routeLegStep)]\(steps), {{{[{STRING(currencyCode), STRING(units), INTEGER(nanos)}(money)]\(estimatedPrice)}\(tollInfo), [{INTEGER\(startPolylinePointIndex), INTEGER\(endPolylinePointIndex), STRING\(speed)}\(speedReadingInterval)](speedReadingInterval)}(routeLegTravelAdvisory)}(travelAdvisory), {{{STRING\(text), STRING\(languageCode)}\(localizedText)}\(distance), {{STRING\(text), STRING\(languageCode)}\(localizedText)}\(duration), {{STRING\(text), STRING\(languageCode)}\(localizedText)}\(staticDuration)}\(localizedValuesRouteLeg), {[{{STRING(maneuver), STRING(instructions)}(navigationInstructions), STRING(travelMode), INTEGER(stepStartIndex), INTEGER(stepEndIndex)}(multiModalSegment)]\(multiModalSegments)}\(stepsOverview)](legs), INTEGER(distanceMeters), STRING(duration), STRING(staticDuration), {STRING(encodedPolyline), {}(goeJsonLinestring)}(polyline), STRING(description), [STRING](warnings), {{{NUMBER(latitude), NUMBER(longitude)}(latLng)}(low), {{NUMBER(latitude), NUMBER(longitude)}(latLng)}(high)}(viewport), {{{[{STRING(currencyCode), STRING(units), INTEGER(nanos)}(money)]\(estimatedPrice)}\(tollInfo), [{INTEGER\(startPolylinePointIndex), INTEGER\(endPolylinePointIndex), STRING\(speed)}\(speedReadingInterval)](speedReadingInterval), STRING(fuelConsumptionMicroliters), BOOLEAN(routeRestrictionsPartiallyIgnored), {{STRING(currencyCode), STRING(units), INTEGER(nanos)}(money)}(transitFare)}(routeTravelAdvisory)}(travelAdvisory), [INTEGER](optimizedIntermediateWaypointIndex), {{{STRING(text), STRING(languageCode)}(localizedText)}(distance), {{STRING(text), STRING(languageCode)}(localizedText)}(duration), {{STRING(text), STRING(languageCode)}(localizedText)}(staticDuration), {{STRING(text), STRING(languageCode)}(localizedText)}(transitFare)}(localizedValuesRoute), STRING(routeToken), {[{STRING(flyoverPresence), {INTEGER(startIndex), INTEGER(endIndex)}(polylinePointIndex)}(flyoverInfo)]\(flyoverInfo), [{STRING\(narrowRoadPresence), {INTEGER\(startIndex), INTEGER\(endIndex)}\(polylinePointIndex)}\(narrowRoadInfo)](narrowRoadInfo)}(polylineDetails)}($route)]
Routes from origin to destination.
fallbackInfoOBJECT
Properties {STRING(routingMode), STRING(reason)}
In some cases when the server is not able to compute the route results with all of the input preferences, it may fallback to using a different way of computation.
geocodingResultsOBJECT
Properties {{{{INTEGER(code), STRING(message), [{}](details)}(status), [STRING](type), BOOLEAN(partialMatch), STRING(placeId), INTEGER(intermediateWaypointRequestIndex)}(geocodedWaypoint)}(origin), {{{INTEGER(code), STRING(message), [{}](details)}(status), [STRING](type), BOOLEAN(partialMatch), STRING(placeId), INTEGER(intermediateWaypointRequestIndex)}(geocodedWaypoint)}(destination), [{{INTEGER(code), STRING(message), [{}](details)}(status), [STRING](type), BOOLEAN(partialMatch), STRING(placeId), INTEGER(intermediateWaypointRequestIndex)}($geocodedWaypoint)](intermediates)}
Contains geocoding response info for waypoints specified as addresses.

Output Example

{
  "routes" : [ {
    "routeLabels" : [ "" ],
    "legs" : [ {
      "distanceMeters" : 1,
      "duration" : "",
      "staticDuration" : "",
      "polyline" : {
        "encodedPolyline" : "",
        "goeJsonLinestring" : { }
      },
      "startLocation" : {
        "location" : {
          "latLng" : {
            "latitude" : 0.0,
            "longitude" : 0.0
          },
          "heading" : 1
        }
      },
      "endLocation" : {
        "location" : {
          "latLng" : {
            "latitude" : 0.0,
            "longitude" : 0.0
          },
          "heading" : 1
        }
      }
    }, [ {
      "distanceMeters" : 1,
      "staticDuration" : "",
      "polyline" : {
        "encodedPolyline" : "",
        "goeJsonLinestring" : { }
      },
      "startLocation" : {
        "location" : {
          "latLng" : {
            "latitude" : 0.0,
            "longitude" : 0.0
          },
          "heading" : 1
        }
      },
      "endLocation" : {
        "location" : {
          "latLng" : {
            "latitude" : 0.0,
            "longitude" : 0.0
          },
          "heading" : 1
        }
      },
      "navigationInstructions" : {
        "maneuver" : "",
        "instructions" : ""
      },
      "travelAdvisory" : {
        "speedReadingInterval" : [ {
          "startPolylinePointIndex" : 1,
          "endPolylinePointIndex" : 1,
          "speed" : ""
        } ]
      },
      "routeLegStepLocalizedValues" : {
        "distance" : {
          "localizedText" : {
            "text" : "",
            "languageCode" : ""
          }
        },
        "staticDuration" : {
          "localizedText" : {
            "text" : "",
            "languageCode" : ""
          }
        }
      },
      "transitDetails" : {
        "stopDetails" : {
          "arrivalStop" : {
            "transitStop" : {
              "name" : "",
              "location" : {
                "location" : {
                  "latLng" : {
                    "latitude" : 0.0,
                    "longitude" : 0.0
                  },
                  "heading" : 1
                }
              }
            }
          },
          "arrivalTime" : "",
          "departureStop" : {
            "transitStop" : {
              "name" : "",
              "location" : {
                "location" : {
                  "latLng" : {
                    "latitude" : 0.0,
                    "longitude" : 0.0
                  },
                  "heading" : 1
                }
              }
            }
          },
          "departureTime" : ""
        },
        "localizedValues" : {
          "arrivalTime" : {
            "localizedTime" : {
              "time" : {
                "localizedText" : {
                  "text" : "",
                  "languageCode" : ""
                }
              },
              "timeZone" : ""
            }
          },
          "departureTime" : {
            "localizedTime" : {
              "time" : {
                "localizedText" : {
                  "text" : "",
                  "languageCode" : ""
                }
              },
              "timeZone" : ""
            }
          }
        },
        "headsign" : "",
        "headway" : "",
        "transitLine" : {
          "agencies" : [ {
            "name" : "",
            "phoneNumber" : "",
            "uri" : ""
          } ],
          "name" : "",
          "uri" : "",
          "color" : "",
          "iconUri" : "",
          "nameShort" : "",
          "textColor" : "",
          "vehicle" : {
            "transitVehicle" : {
              "name" : {
                "localizedText" : {
                  "text" : "",
                  "languageCode" : ""
                }
              },
              "type" : "",
              "iconUri" : "",
              "localIconUri" : ""
            }
          }
        },
        "stopCount" : 1,
        "tripShortText" : ""
      },
      "travelMode" : ""
    } ], {
      "routeLegTravelAdvisory" : {
        "tollInfo" : {
          "estimatedPrice" : [ {
            "currencyCode" : "",
            "units" : "",
            "nanos" : 1
          } ]
        },
        "speedReadingInterval" : [ {
          "startPolylinePointIndex" : 1,
          "endPolylinePointIndex" : 1,
          "speed" : ""
        } ]
      }
    }, {
      "distance" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      },
      "duration" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      },
      "staticDuration" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      }
    }, {
      "multiModalSegments" : [ {
        "navigationInstructions" : {
          "maneuver" : "",
          "instructions" : ""
        },
        "travelMode" : "",
        "stepStartIndex" : 1,
        "stepEndIndex" : 1
      } ]
    } ],
    "distanceMeters" : 1,
    "duration" : "",
    "staticDuration" : "",
    "polyline" : {
      "encodedPolyline" : "",
      "goeJsonLinestring" : { }
    },
    "description" : "",
    "warnings" : [ "" ],
    "viewport" : {
      "low" : {
        "latLng" : {
          "latitude" : 0.0,
          "longitude" : 0.0
        }
      },
      "high" : {
        "latLng" : {
          "latitude" : 0.0,
          "longitude" : 0.0
        }
      }
    },
    "travelAdvisory" : {
      "routeTravelAdvisory" : {
        "tollInfo" : {
          "estimatedPrice" : [ {
            "currencyCode" : "",
            "units" : "",
            "nanos" : 1
          } ]
        },
        "speedReadingInterval" : [ {
          "startPolylinePointIndex" : 1,
          "endPolylinePointIndex" : 1,
          "speed" : ""
        } ],
        "fuelConsumptionMicroliters" : "",
        "routeRestrictionsPartiallyIgnored" : false,
        "transitFare" : {
          "money" : {
            "currencyCode" : "",
            "units" : "",
            "nanos" : 1
          }
        }
      }
    },
    "optimizedIntermediateWaypointIndex" : [ 1 ],
    "localizedValuesRoute" : {
      "distance" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      },
      "duration" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      },
      "staticDuration" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      },
      "transitFare" : {
        "localizedText" : {
          "text" : "",
          "languageCode" : ""
        }
      }
    },
    "routeToken" : "",
    "polylineDetails" : {
      "flyoverInfo" : [ {
        "flyoverPresence" : "",
        "polylinePointIndex" : {
          "startIndex" : 1,
          "endIndex" : 1
        }
      } ],
      "narrowRoadInfo" : [ {
        "narrowRoadPresence" : "",
        "polylinePointIndex" : {
          "startIndex" : 1,
          "endIndex" : 1
        }
      } ]
    }
  } ],
  "fallbackInfo" : {
    "routingMode" : "",
    "reason" : ""
  },
  "geocodingResults" : {
    "origin" : {
      "geocodedWaypoint" : {
        "status" : {
          "code" : 1,
          "message" : "",
          "details" : [ { } ]
        },
        "type" : [ "" ],
        "partialMatch" : false,
        "placeId" : "",
        "intermediateWaypointRequestIndex" : 1
      }
    },
    "destination" : {
      "geocodedWaypoint" : {
        "status" : {
          "code" : 1,
          "message" : "",
          "details" : [ { } ]
        },
        "type" : [ "" ],
        "partialMatch" : false,
        "placeId" : "",
        "intermediateWaypointRequestIndex" : 1
      }
    },
    "intermediates" : [ {
      "status" : {
        "code" : 1,
        "message" : "",
        "details" : [ { } ]
      },
      "type" : [ "" ],
      "partialMatch" : false,
      "placeId" : "",
      "intermediateWaypointRequestIndex" : 1
    } ]
  }
}

Name: nearbySearch

Action takes one or more place types, and returns a list of matching places within the specified area.

Properties

NameLabelTypeDescriptionRequired
includedTypesIncludedARRAY
Items [STRING($keyword)]
Keywords which will be used for filtering.true
addressAddressSTRINGCenter address of the nearby search.true
radiusRadiusNUMBERRadius of circle area that will be searched. The radius must be between 0.0 meters and 50000.0 meters inclusive.true

Example JSON Structure

{
  "label" : "Nearby Search",
  "name" : "nearbySearch",
  "parameters" : {
    "includedTypes" : [ "" ],
    "address" : "",
    "radius" : 0.0
  },
  "type" : "googleMaps/v1/nearbySearch"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.


Additional Instructions

Troubleshooting

Access Blocked: Verification Process Not Completed

Documentation for how to add a test user can be found here

How is this guide?

Last updated on

On this page