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

ebay-node-api-p

v2.8.11

Published

Ebay node api client

Downloads

254

Readme

Ebay API Node.js

Ebay API Client for node js.

The intent is to simplify the request process by handling the tedious logic. It's a thin wrapper around eBay Api.

npm version Downloads Build Status

Documentation: https://pajaydev.github.io/ebay-node-api

📒 Table of Contents

Installation

npm install ebay-node-api

Usage

let eBay = require("ebay-node-api");

let ebay = new eBay({
  clientID: "-- Client APP ID ----",
  env: "SANDBOX", // optional default = 'PRODUCTION'
  headers: {
    // optional
    "X-EBAY-C-MARKETPLACE-ID": "EBAY_GB" // For Great Britain https://www.ebay.co.uk
  }
});

For Country Code and Marketplace id check here

Documentation

Check out the Starter Guide documentation with examples to get started.

Using Express js

You can consume these ebay node api's using Express. You can checkout the sample app in Codesandbox playground.

API details

Without Auth flow

| HTTP Method | Methods | Description | Usage | Offical doc | | ----------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | GET | findItemsByKeywords | Searches for items on eBay by a keyword query. | Example | doc | | GET | findCompletedItems | Searches for items whose listings are completed and are no longer available for sale by category (using categoryId), by keywords (using keywords), or a combination of the two. | Example | doc | | GET | findItemsByProduct | Searches for items on eBay using specific eBay product values. | Example | doc | | GET | findItemsAdvanced | Searches items on eBay by category or keyword or both. | Example | doc | | GET | getSingleItem | Retrieves publicly visible details about one listing on eBay. | Example | doc | | GET | getMultipleItems | Retrieves publicly available data for one or more listings. | Example | doc | | GET | getShippingCosts | Retrieve estimated shipping cost to ship an active item to a specified destination country and postal code. | Example | doc | | GET | getItemStatus | Get item status for given item ids. | Example | doc | | GET | getUserDetails | Get User Profile. | Example | doc | | GET | getDeals(Deprecated) | Get details about the deals across eBay. | Example | doc |

With Auth flow

| HTTP Method | Methods | Description | Usage | Offical doc | | ----------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | GET | searchItems | Searches for eBay items by various query parameters and retrieves summaries of the items. You can search by keyword, category, eBay product ID (ePID), or GTIN, charity ID, or a combination of these. | Example | doc | | GET | getItem | Retrieve the complete details of a specific item. | Example | doc | | GET | getItemsByItemGroup | Retrieve all the individual items in a group. | Example | doc | | GET | getItemByLegacyId | Returns the RESTful item ID, which can then be used in any of other Buy API methods. | Example | doc | | GET | searchByImage | Returns the RESTful item ID, which can then be used in any of other Buy API methods. | Example | doc | | GET | getMostWatchedItems | Retrieves data for items with the highest watch counts for the entire site or for a specific category. | Example | doc | | GET | getSimilarItems | Retrieves recommended similar items for a specified item. | Example | doc | | GET | getItemAspectsForCategory | Retrieve an array of aspects that are appropriate for describing items in a specified category. | Example | doc | | GET | getDefaultCategoryTreeId | Retrieve the default category tree reference for a specific eBay marketplace. | Example | doc | | GET | getCategoryTree | Retrieve the complete category tree for category id. | Example | doc |

Examples

// findItemsBykeyword
ebay
  .findItemsByKeywords({
    keywords: "Garmin nuvi 1300 Automotive GPS Receiver",
    sortOrder: "PricePlusShippingLowest", //https://developer.ebay.com/devzone/finding/callref/extra/fndcmpltditms.rqst.srtordr.html
    pageNumber: 2,
    limit: 10
  })
  .then(
    data => {
      console.log(data);
    },
    error => {
      console.log(error);
    }
  );

// Get Single item listing on eBay
ebay.getSingleItem("153265274986").then(data => {
  console.log(data);
});

// Search Items by Keyword
ebay.getAccessToken().then(data => {
  ebay
    .searchItems({
      keyword: "drone",
      limit: "3"
    })
    .then(data => {
      console.log(data);
      // Data is in format of JSON
      // To check the format of Data, Go to this url (https://developer.ebay.com/api-     docs/buy/browse/resources/item_summary/methods/search#w4-w1-w4-SearchforItemsbyKeyword-0)
    });
});

// perform Advance Search Items by Keyword or category or both
// Search Buy It Now ipad items with one day shipping. (https://developer.ebay.com/DevZone/finding/CallRef/findItemsAdvanced.html)
ebay
  .findItemsAdvanced({
    entriesPerPage: 2,
    keywords: "ipad",
    ExpeditedShippingType: "OneDayShipping",
    ListingType: "AuctionWithBIN"
  })
  .then(
    data => {
      console.log(data);
    },
    error => {
      console.log(error);
    }
  );

More Examples

Test

All test files are present inside test folder. You can run using

npm run test

Issues:

If you are facing any issues or missing something, you can create the issues here.

👍 Contribution:

Show your ❤️ and support by giving a ⭐. Willing to share your idea or ready to contribute, check here

📝 License:

MIT.

Examples:

I have provided the examples here https://github.com/pajaydev/ebay-node-api/tree/master/demo.