Skip to content

Instantly share code, notes, and snippets.

@heri
Last active December 12, 2019 21:13
Show Gist options
  • Save heri/7254abcde45377e96c6004700d6d7788 to your computer and use it in GitHub Desktop.
Save heri/7254abcde45377e96c6004700d6d7788 to your computer and use it in GitHub Desktop.
var my_city = "Montreal";
var getJSON = require("async-get-json");
var geLatLng = await getJSON("https://api.opencagedata.com/geocode/v1/json?key=50adaa7181d24a7581a62fd3d9c0a2e0&q=" + my_city);
var latLng = geLatLng.results[0].geometry["lng"] + "," + geLatLng.results[0].geometry["lat"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment