UNPKG

restaurants

Version:

Search a service and get a list of restaurants.

57 lines (28 loc) 1.99 kB
# 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 OpenTable. $ restaurants 1600 Pennsylvania Ave, Washington, D.C. 20500 --service yelp > restaurants.json Default returns normal limit for the service, if you want all the possible results, use the `--all` parameter. $ 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](http://developer.factual.com/) Keys: `FACTUAL_API_KEY` ### [FourSquare](https://developer.foursquare.com/) Keys: `FOURSQUARE_CLIENT_ID`, `FOURSQUARE_CLIENT_SECRET` ### [Google](https://developers.google.com/places/documentation/) Keys: `GOOGLE_API_KEY` ### [OpenTable](https://gist.github.com/sosedoff/2504683) Keys: none ### [Yelp](http://www.yelp.com/developers) Keys: `YELP_CONSUMER_KEY`, `YELP_CONSUMER_SECRET`, `YELP_TOKEN`, `YELP_TOKEN_SECRET`