Google Maps Elevation API: Excel Example

When working with geospatial data on Google Earth (for example, from our AEREarth tool), you might need the elevations for some coordinates. If it’s only a handful, they’re easily found with Google Earth’s interface. But let’s say you want elevations for dozens, hundreds, or even thousands of locations.

Requesting the data directly from Google Maps’ Application Programming Interface (API) is an enormous shortcut. Google Maps lets you query elevations at up to 512 point locations at a time. Before you can get started though, you will need to set up an API key.

The next step is formatting your coordinates and placing that API key into a web address (or URL). Building a URL of that length can be maddening, so we made an Excel workbook for formatting it. Here’s a how-to for using this tool:

  1. Download the Air Sciences .xlsx file.
  2. Insert your own API key in the workbook (cell C12).
  3. Paste your latitude coordinates (in column C starting at cell C19) and longitude coordinates (in column D starting at cell D19). 
  4. View the web address populated by the formula in cell A1.
  5. Copy the web address from cell A1 into your browser’s address bar. Firefox works best as you can save the output as JSON
  6. Wait for the data to load and receive your elevation dataset in a JSON format. Then, save as a JSON file from Firefox, which you may import directly into Excel.

If you prefer to flex your coding skills, please see our post about using Python with the Google Maps Elevation API. There you’ll find blocks of reusable code to get you started!

4 Comments

  1. Jeremiah

    Thank you for sharing this! It seems like a very useful tool, but it’s not working in my configuration right now. I’ve created a key but when trying to view it in a browser it says “”This API project is not authorized to use this API.”

    • Matt Mavko

      Jeremiah,
      Thanks for the comment. You are getting that error message because the Google Maps Elevation API has not been associated with the API key you created. From the API console, look for a link in the left menu pane titled, “Enabled APIs & services.” Click that, and from there you should see a link at the top titled, “+ENABLE APIS AND SERVICES.” Click that, and a library of services will appear. Search for “elevation” and select “Maps Elevation API.”

  2. Christina

    very timely response Matt, I had the same problem like Jeremiah, and your solution works, but just to realise the google cloud API service is not free…

    • Matt Mavko

      Christina,
      Thanks for the comment. While you do need to provide billing information to set up a Google Cloud account and obtain an API key, for casual use there is no cost incurred for making API requests. We have yet to be charged for using the Elevation API.

Comments are closed.

Learn more, experience the Air Sciences difference:

    Download the Tool


    To download the Google Maps Elevation Tool, please use the form: