restaurants

Search a service and get a list of restaurants.

npm install restaurants
7 downloads in the last week
29 downloads in the last month

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

Keys: FACTUAL_API_KEY

FourSquare

Keys: FOURSQUARE_CLIENT_ID, FOURSQUARE_CLIENT_SECRET

Google

Keys: GOOGLE_API_KEY

OpenTable

Keys: none

Yelp

Keys: YELP_CONSUMER_KEY, YELP_CONSUMER_SECRET, YELP_TOKEN, YELP_TOKEN_SECRET

npm loves you