APIYard
Back to APIs
MapsAPI Key

Google Maps

Embed maps, geocode addresses, calculate routes, and search for places using Google's world-class location platform.

Base URL

https://maps.googleapis.com/maps/api
geocodingdirectionsplacesdistance matrixembed

Endpoints

GET/geocode/json

Convert an address to latitude/longitude coordinates.

const response = await fetch("https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Pkwy&key=YOUR_API_KEY", {
  method: "GET",
  headers: {
  "Content-Type": "application/json",
  "X-API-Key": "YOUR_API_KEY"
  }
});

const data = await response.json();
console.log(data);

Response Preview

{
  "status": "OK",
  "results": [{
    "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
    "geometry": {
      "location": { "lat": 37.4224764, "lng": -122.0842499 }
    }
  }]
}