This is the API that will scrapes Amazon.com's servers for items and sends the data back as JSON.
This tutorial can be found on Medium:
Build An Amazon Product Wishlist App Part 1/2 - Backend
- NodeJS 12.13.1
- Internet Connection
nvm install;
yarn install; # npm install
yarn start; # npm start
Testing if the server works, you can perform curl
request or open it up in your browser:
Request:
curl http://localhost:5000;
Expected Result:
{ "version": "1.0.0" }
Request:
GET
http://localhost:5000/?q=burrito
curl http://localhost:5000/search\?q=burrito
Expected Result:
{
"data": [
{
"name": "Throw Throw Burrito by Exploding Kittens - A Dodgeball Card Game - Family-Friendly Party Games - Card Games for Adults, Teens & Kids",
"url": "/Throw-Burrito-Dodgeball-Exploding-Kittens/dp/B07TS96J7Q/ref=sr_1_1?dchild=1&keywords=burrito&qid=1586638633&sr=8-1",
"image": "https://m.media-amazon.com/images/I/61qT2Psk-AL._AC_UL320_ML3_.jpg",
"price": "24.99"
}
]
}
Used for Node Version Manager
.nvmrc
Used By Visual Studio Code to auto format code for spacing and more
.vscode/settings.json
Twitter: @codingwithmanny
Instagram: @codingwithmanny
Medium @codingwithmanny
GitHub @codingwithmanny