Google Docs Geocoding Tutorial

You can use Google Sheets and the OpenCage Geocoder to quickly convert a list of coordinates to placenames (reverse geocoding) or vice versa (forward geocoding).

  1. register for an OpenCage Geocoder API key
  2. create a new Sheet

    Put your addresses in a column, or your coordinates in two columns (latitude, longitude)

    In our first example we show reverse geocoding

  3. open Tools > Scripts editor

  4. copy the script opencage.js into the scripts editor and save

  5. reload your Google Sheet. After a few seconds a new "Geocode" button should appear

  6. select three columns, and then click on "Latitude, Longitude to Address"
    • You will be prompted to give the script access to your Google docs. You will need to select yes.
    • A popup will appear asking your for your API key. Enter it and click "Geocode"

  7. the results will appear in the third column you selected.

Forward geocoding is very similar:

  1. Follow steps 1-5 above
  2. create three columns, the first column should contain the address

  3. select the three columns and then click "Address to Latitude, Longitude" in the "Geocode" menu.

    • You will be prompted to give the script access to your Google docs. You will need to select yes.
    • A popup will appear asking your for your API key. Enter it and click "Geocode"
  4. The results will appear in the second and third column you selected.

Start geocoding now with a free trial

2,500 API requests per day, for as long as you like.

No credit card required.

Start your free trial