Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created September 26, 2017 09:35
Show Gist options
  • Select an option

  • Save hanipcode/d19ec56287f83ddb5b5e9f4b4619d812 to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/d19ec56287f83ddb5b5e9f4b4619d812 to your computer and use it in GitHub Desktop.
const request = require('request-promise');
function getPredictionList(searchQuery, key) {
const url = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${searchQuery}&type=geocode&key=${key}`;
request(url)
.then(result => {
console.log(result);
})
.catch(err => console.log(err));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment