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

newegg-marketplace

v1.0.3

Published

A Newegg Marketplace API client for Node.js

Downloads

22

Readme

NPM

David David Travis npm Join the chat at https://gitter.im/node-newegg-marketplace/Lobby Gratipay

Newegg Marketplace API Client

This library implements the different endpoints as described by Newegg's developer guide and exposes them to you, the developer. The entire library was generated by parsing the developer guide PDF, you can see the tools I created to do this in the dev-utils folder.

You can find a reference containing each method implemented by this library in API.md. This shows you what to use in this library to perform a certain action from the API documentation.

Please Note

All this library does is wrap the requests and expose functions that (can make) your code prettier and more readable. It does not error check or validate to any of the standards as the Newegg developer guide provides, nor does it do formatting (outside of URL parameters) for the data you're giving to Newegg.

Timeout

Query timeout is 15s by default, you can customize this by passing your own ms for the timeout as a 4th parameter in the constructor.

Failover

This plugin will handle failover, per 8.2. Failover Endpoints for API Service in the developer guide. You can disable this functionality by passing a 5th parameter, false, when constructing NeweggMarketplaceAPI. Failover functionality isn't smart, it works per request.

Example

const NeweggMarketplaceAPI = require('newegg-marketplace');

const Marketplace = new NeweggMarketplaceAPI('A006', '727ddc0678f4d115bd544aff46bc15634', '1B6B1383-01D1-4A1E-BA53-05DECE9BD765');

Marketplace.SellerMgmt
  .SellerStatusCheck('contentmgmt')
  .then(console.log)
  .catch(console.error);

Marketplace.ContentMgmt
  .GetManufacturer({
    OperationType: 'GetManufacturerRequest',
    RequestBody: {
      PageIndex: 1,
      PageSize: 10,
      RequestCriteria: {},
    },
  })
  .then(console.log)
  .catch(console.error);

Additional Notes

Errors are your friend!

Newegg returns very descriptive errors. If you can't figure out how to format the data in a request, refer to the error you're getting. You should be able to solve your issue.

Wrong JSON Documentation in the Newegg Marketplace API Developer Guide

The current documentation has some errors and at times you'll be forced to go over the XML version of a request in order to figure out how to do the JSON version of the request. Note, even though the request body "requires" the "NeweggAPIRequest" element, you actually need to exclude it in the JSON, it only needs to be there for the XML.

Support on Beerpay

Hey dude! Help me out for a couple of :beers:!

Beerpay Beerpay