JavaScript API Wrapper
The StellarScrape JavaScript wrapper offers a convenient way to integrate the API into JavaScript or Node.js applications. It is available on npm for easy installation.
Installation
Install the StellarScrape wrapper via npm:
npm install stellarscrape
Getting Started
After installing the wrapper, initialize it by importing the package and providing your API key.
const StellarScrape = require('stellarscrape');
const api = new StellarScrape('YOUR_API_KEY');
Wrapper Functions
The wrapper includes the following functions:
getAmazonProduct: Fetches details for a specific product by ASIN.
searchAmazonProducts: Searches for products based on a query.
getAmazonMultipleProducts: Retrieves details for multiple ASINs.
Each function returns a promise that resolves to the requested data or throws an error if something goes wrong. Use .then()
and .catch()
for promise handling.
Example:
api.getAmazonProduct("B0DGHN7913", ["fr"], "fr").then((data) => { console.log(data)
}).catch((err) => { console.log(err) })
//commande pour faire une recherche
/* stellarScrape.searchAmazonProducts("iphones", ["fr", "it", "es", "de"], "fr", 10, 10).then((data) => { data.data.searchData.productsData.map((product) => console.log(product)) } ).catch((err) => { console.log(err) })
//co stellarScrape.getAmazonMultipleProducts(["B09G9HWQYT", "B07F81WWKP"], ["fr"], "fr").then((data) => { console.log(data.data) } ).catch((err) => { console.log(err) }) */
Last updated