This is a wrapper library around the WalmartLabs Developer Library. To access this library you will need a developer key.
First include the library:
var walmart = require('walmart')(apiKey);
The apiKey
is the API key that you got from WalmartLabs when you registered.
Once you have the walmart
object you can make these requests.
This is a promise based library, so requests will look like this:
walmart.getItem(10449075).then(function(item) {
console.log(item.product.productAttributes.productName);
});
The then
function is called when the item data is returned.
You can see more examples in examples/simple.js
.
This returns the item information for a specific product based on it's WalmartLabs product ID.
Returns the product by the upcCode, the barcode on a product is the UPC so you should send that directly to the API.
Returns a list of products that match the search term.
Returns our category taxonomy.
Returns recommended products based on the item ID.
Returns customer reviews for the specific WalmartLabs Item ID.
Returns a list of stores by the specified GPS latitude and longitude.
Returns a list of stores by the specified city name.
Returns a list of stores by the specified zip code.
Returns a list of products that match the query
in the specified store
.
Returns an array of items on the specified category.
Returns an array of items of the best-sellers on the specified category.
Returns an array of items of the available pre-orders.
Returns an array of items of the rollbacks on the specified category.
Returns an array of items of the clearance items on the specified category.
Returns an array of items of the special buy items on the specified category.
Returns an array of items of the value of the day items on the specified category.
Returns an array of items of the trending items on the specified category.
- Install Node js 8.9.4
- Clone and cd into the project and install it's dependencies:
npm install
- Create a
.env
file in the project root directory and add the following variables to the file:
AMAZON_ACCESS_KEY=<YOUR_AMAZON_ACCESS_KEY>
AMAZON_SECRET_KEY=<YOUR_AMAZON_SECRET_KEY>
AMAZON_SELLER_ID=<YOUR_AMAZON_SELLER_ID>
WALMART_API_KEY=<YOUR_WALMART_API_KEY>
This sets your environment variables for authenticating api requests.
- Test the project is working by running the example queries in your terminal:
npm start
Can run example file directly with:
node examples/simple.js
node examples/simple.js <minROI> <minRatings> <minNumReviews>
The first run usage uses default analysis parameters of 30%, 3.0 and 30. The second run usage will run the app and return items with a minimum ROI of 25%, minimum Amazon Rating of 3.0 and a minimum number of 30 reviews.
The output of a successful run is a .tsv file with all the items that meet the profit criteria in the parent directory.