npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zomato-api

v0.1.2

Published

A Node.js wrapper for Zomato API

Downloads

9

Readme

zomato-api

NPM

npm package for Zomato API

Installation

Install with npm:

npm install zomato-api

Usage

var zomato = require('zomato-api');
var client = zomato({
userKey: 'your api token'
})

Note: You should apply for an API token before you use this package.

Endpoints

Common

Categories

Use getCategories to return a list of categories.

client.getCategories()
  .then(res => console.log(res))
  .catch(err => console.log(err)); 

Cities

Use getCities to return details for a city. You can provide any of the following parameters:

  • q: query by city name
  • lat: latitude
  • lon: longitude
  • city_ids: comma separated city_id values
  • count: number of max results to display
client.getCities({q: 'vancouver'})
  .then(res => console.log(res))
  .catch(err => console.log(err)); 

Collections

Use getCollections to return restaurant collections in a city. You can provide any of the following parameters:

  • city_id: id of the city for which collections are needed
  • lat: latitude of any point within a city
  • lon: longitude of any point within a city
  • count: max number of results needed
client.getCollections({city_id: 256})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Cuisines

Use getCuisines to return a list of cuisines in a city. You can provide any of the following parameters:

  • city_id: d of the city for which cuisines are needed
  • lat: latitude of any point within a city
  • lon: longitude of any point within a city
client.getCuisines({city_id: 256})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Establishments

Use getEstablishments to return a list of restaurant types in a city. You can provide any of the following parameters:

  • city_id: id of the city
  • lat: latitude of any point within a city
  • lon: longitude of any point within a city
client.getEstablishments({city_id: 256})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Geocode

Use getGeocode to return a list of popular cuisines and nearby restaurants around the given coordinates. You can provide any of the following parameters:

  • lat: latitude
  • lon: longitude
client.getGeocode({lat: 49.267941, lon: -123.247360})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Location

Location Details

Use getLocationDetails to return top cuisines, best rated restaurants, etc. in a given location. You can provide any of the following parameters:

  • entity_id: location id obtained from locations api
  • entity_type: location type obtained from locations api
client.getLocationDetails({entity_id: 36932, entity_type: 'group'})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Locations

Use getLocations to return Zomato locations by keyword. You can provide any of the following parameters:

  • query: suggestion for location name
  • lat: latitude
  • lon: longitude
  • count: max number of results to fetch
client.getLocations({query: 'sashimi'})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Restaurant

Daily Menu

Use getDailyMenu to return daily menu using Zomato restaurant ID. You can provide any of the following parameters:

  • res_id: id of restaurant whose details are requested
client.getDailyMenu({res_id: 9186})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Restaurant

Use getRestaurant to return detailed restaurant info using Zomato restaurant ID. You can provide any of the following parameters:

  • res_id: id of restaurant whose details are requested
client.getRestaurant({res_id: 9186})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Reviews

Use getReview to return reviews using Zomato restaurant ID. You can provide any of the following parameters:

  • res_id: id of restaurant whose details are requested
  • start: fetch results after this offset
  • count: max number of results to retrieve
client.getReviews({res_id: 9186, start: 1})
  .then(res => console.log(res))
  .catch(err => console.log(err));

Search

Use search to return info based on the following parameters:

  • entity_id: location id
  • entity_type: location type
  • q: search keyword
  • start: fetch results after offset
  • count: max number of results to display
  • lat: latitude
  • lon: longitude
  • radius: radius around (lat,lon); to define search area, defined in meters(M)
  • cuisines: list of cuisine id's separated by comma
  • establishment_type: estblishment id obtained from establishments call
  • collection_id: collection id obtained from collections call
  • category: category ids obtained from categories call
  • sort: sort restaurants by ...
  • order: used with 'sort' parameter to define ascending / descending