In this project, I have used Zomato-API (https://developers.zomato.com/) to get the details of restaurants present in a particular location. You'll be asked a location to fetch the details like average cost for two people, price ranges, has online delivery or not, and cuisines of that location.
If you're using Linux-based OS, install the latest version of Nodejs and npm, by typing the following commands on your terminal.
sudo apt update
sudo apt install build-essential apt-transport-https lsb-release ca-certificates curl
Then, for the Latest release (version 12), add this PPA, by typing the following command on your terminal
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs
Now, you need to install necessary dependencies using npm (node-package-manager), open your termial, and first type
npm init
to initialize package.json file. Then, type
npm install body-parser ejs express iplocation path public-ip zomato --save
Now, navigate to server.js
file on your terminal, and run the following command to start your localhost server
node server.js
-
/categories
- This endpoint presents you a list of all restaurants categorized under a particular restaurant type.
-
/geocode
- This endpoint takes latitude and longitude to get the list of popular Cuisines, Foodie, Nightlife-index and nearby restaurants using your public IP address.
-
/search
- This endpoint takes a location, and gives you the precise restaurant suggestions, using
/geocode
endpoint.
- This endpoint takes a location, and gives you the precise restaurant suggestions, using
Now, open your browser, and type
http://localhost:{PORT}/{YOUR_ENDPOINT} to get the required details.
Happy coding ):