restaurants
v0.0.7
Published
Search a service and get a list of restaurants.
Downloads
10
Readme
restaurants
Search for restaurants given a location and radius across multiple services. Mainly used for aggregating restaurant information about a location. Uses mapquest to geocode the address given into a lat/lng.
Installation
$ npm install -g restaurants
restaurants(1)
The restaurants(1)
executable returns a list of restaurants from a web service based on the given address.
$ restaurants 1600 Pennsylvania Ave, Washington, D.C. 20500 > restaurants.json
You can specifiy which service to use, defaults to Google.
$ restaurants 1600 Pennsylvania Ave, Washington, D.C. 20500 --service yelp > restaurants.json
Default returns 10 results, f you want up to 500 results, use the --all
parameter. (Depends on the service)
$ restaurants 1600 Pennsylvania Ave, Washington, D.C. 20500 --all > restaurants.json
Default search radius is 1000 meters, specify the radius in meters using --radius
.
$ restaurants 1600 Pennsylvania Ave, Washington, D.C. 20500 --radius 500 > restaurants.json
API
restaurants(service, address, radius, all, callback)
Pass a service string, full address, radius in meters, bool for whether or not you want to max out the query and a callback function that receives an error object and an array of all the restaurants found.
Services & API Keys
Each service operates off of API keys or auth tokens defined in environment variables. Below is the list of environment variables that need to be defined to use each corresponding service.
Factual
Keys: FACTUAL_API_KEY
FourSquare
Keys: FOURSQUARE_CLIENT_ID
, FOURSQUARE_CLIENT_SECRET
Keys: GOOGLE_API_KEY
OpenTable
Keys: none
Yelp
Keys: YELP_CONSUMER_KEY
, YELP_CONSUMER_SECRET
, YELP_TOKEN
, YELP_TOKEN_SECRET