0.0.1 • Published 6 years ago

coinpoet-ebay-client v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

coinpoet-ebay-client

npm version license Build Status JavaScript Style Guide

This is a client for the eBay RESTful APIs, especially the buy API.

Features & Benefits

  • A thin wrapper around the eBay RESTful APIs. No magic here.
  • Full type definitions via TypeScript with documentation from the eBay-provided YAML for intellisense and quick and accurate documentation.
  • Manages tokens with each request.
  • Tests included (these could be better)

Usage

Install with yarn add coinpoet-ebay-client

Then you can use it as follows:

const config = {
  "baseURL": "https://api.ebay.com",
  "clientID": "<your ebay client id from developer.ebay.com>",
  "clientSecret": "<your ebay secret from developer.ebay.com>",
  "redirectUrlName": "<your ebay redirect url name from developer.ebay.com>"
}

const buyApi = new BuyApi(config)
for await (let item of buyApi.search({ category_ids: [123]})) {
  console.log(item)
}

// Alternatively get one page of results at a time (and not depend on async iterators which may not be available for your version of node - check http://node.green/#ES2018-features-Asynchronous-Iterators)
let pageResult = await buyApi.searchPage({ category_ids: [123], offset, limit })

Contributing

Please submit pull requests (with tests passing in the build).