Google Maps Geocoding

FREEMIUM
By googlecloud
Updated 4 months ago
Location
7.5/10
Popularity Score
191ms
Latency
94%
Success Rate

Google Maps Geocoding API Documentation

Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map.

View API Details
GETReverse Geocoding
GETGeocoding
GETReverse Geocoding

Address Lookup

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
latlngSTRING
REQUIREDThe latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address.
Optional Parameters
languageSTRING
OPTIONALThe language in which to return results. See list of all supported languages in API Overvier.
result_typeSTRING
OPTIONALA filter of one or more address types, separated by a pipe (|). If the parameter contains multiple address types, the API returns all addresses that match any of the types. A note about processing: The result_type parameter does not restrict the search to the specified address type(s). Rather, the result_type acts as a post-search filter: the API fetches all results for the specified latlng, then discards those results that do not match the specified address type(s). Note: This parameter is available only for requests that include an API key or a client ID. List of all supported types can be found in API Overview
location_typeSTRING
OPTIONALA filter of one or more location types, separated by a pipe (|). If the parameter contains multiple location types, the API returns all addresses that match any of the types. A note about processing: The location_type parameter does not restrict the search to the specified location type(s). Rather, the location_type acts as a post-search filter: the API fetches all results for the specified latlng, then discards those results that do not match the specified location type(s). Note: This parameter is available only for requests that include an API key or a client ID. A list of supported types can be found in the API Overview.
Code Snippet
unirest.get("https://google-maps-geocoding.p.rapidapi.com/geocode/json?language=en&latlng=40.714224%2C-73.96145")
.header("X-RapidAPI-Host", "google-maps-geocoding.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://google-maps-geocoding.p.rapidapi.com/geocode/json
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://google-maps-geocoding.p.rapidapi.com/geocode/json?language=en&latlng=40.714224%2C-73.96145")
.header("X-RapidAPI-Host", "google-maps-geocoding.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication