The Google Maps Elevation API provides elevation data for all locations on the surface of the earth, including depth locations on the oncean floor. In those cases where Google does not possess exact elevation measurements at the precise location you request. The service will interpolate and return an averaged value using the four nearest locations. Elevation values are expressed relative to local mean sea level (LMSL)
.
You access the Google Maps Elevation API through an HTTP interface. Users of the Google Maps JavaScript API may also access this API directly by using the ElevationService() object.
HTTP request:
https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&key=YOUR_API_KEY
Response:
{
"results" : [
{
"elevation" : 1608.637939453125,
"location" : {
"lat" : 39.73915360,
"lng" : -104.98470340
},
"resolution" : 4.771975994110107
}
],
"status" : "OK"
}
For more information, just read the above documentation link.