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

stellarscrape-client

v1.0.1

Published

The apiWrapper for the StellarScrape API

Downloads

129

Readme

Stellarscrape ApiClient

The Stellarscrape ApiClient is an npm package designed to interact with the Stellarscrape API, allowing you to search for Amazon products and retrieve detailed product information across supported Amazon marketplaces. To use this package, obtain an API key by subscribing at StellarScrape.com.

Installation

Install the Stellarscrape client via npm:

npm install stellarscrape

Getting Started

To start using the Stellarscrape client, import the StellarScrape class, initialize it with your API key, and use the methods provided to search for products or fetch product details.

const { StellarScrape } = require('stellarscrape');

const stellarScrape = new StellarScrape("YOUR_API_KEY");

API Methods

1. Get Amazon Product Data

Retrieve details for a specific product based on its Amazon Standard Identification Number (ASIN).

stellarScrape.getAmazonProduct("B0DGHN7913", ["fr"], "fr")
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

Parameters:

  • asin (string): The ASIN of the product.
  • countries (array of supportedCountry): List of country codes to fetch data from (e.g., ["fr"]).
  • userCountry (supportedCountry): The country code for the user.

2. Search Amazon Products

Search for products on Amazon across multiple supported locales using a query string.

stellarScrape.searchAmazonProducts("iphones", ["fr", "it", "es", "de"], "fr", 10, 0)
  .then((data) => {
    data.data.searchData.productsData.forEach((product) => console.log(product));
  })
  .catch((err) => {
    console.log(err);
  });

Parameters:

  • query (string): Search term (e.g., "iphones").
  • countries (array of supportedCountry): List of countries to search in (e.g., ["fr", "it", "es", "de"]).
  • userCountry (supportedCountry): The primary country for the user.
  • amount (number, optional): Number of results per page (default is 10).
  • startAt (number, optional): The starting index of the results (default is 0).

3. Get Multiple Amazon Products

Retrieve details for multiple products in one request by providing an array of ASINs.

stellarScrape.getAmazonMultipleProducts(["B09G9HWQYT", "B07F81WWKP"], ["fr"], "fr")
  .then((data) => {
    console.log(data.data);
  })
  .catch((err) => {
    console.log(err);
  });

Parameters:

  • asinArray (array of strings): Array of ASINs (up to 100 per request).
  • countries (array of supportedCountry): List of country codes (e.g., ["fr"]).
  • userCountry (supportedCountry): The user's country code.

Notes

  • Obtain your API key by subscribing at StellarScrape.com.
  • Manage errors with .catch() to handle potential API request issues.