Skip to content

🗺️ A lightweight Node.js module to get the latitude and longitude for any fuzzy place name using the Google Places API

Notifications You must be signed in to change notification settings

Lissy93/place-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

place-lookup

A lightweight Node.js module to get the latitude and longitude for any fuzzy place name using the Google Places API

Dependency Status devDependency Status Code Climate

Install

npm install place-lookup --save

Usage

var placeLookup = require('place-lookup');
var apiKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

placeLookup("oxford", apiKey, function(result){
    console.log(result) // Do whatever with the results
});

Results

{ 
    place_name: 'Paris, France',
    location: { lat: 48.856614, lng: 2.3522219 } 
}

How to get yourself a Google Places API key

  • Head over to The Google Developer Console
  • In the top-left corner select "New Project" from the projects dropdown.
  • In the API's menu, search for "Google Places API Web Service" and ensure it is set to enabled
  • On the Credentials pags: Add Credential --> Server Key --> Give it a name, (leave IP blank if your unsure). Click create
  • The 40-ish digit alpha-numeric code is your new key :)

License

MIT (C) Alicia Sykes

About

🗺️ A lightweight Node.js module to get the latitude and longitude for any fuzzy place name using the Google Places API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published