Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
ebay-api-reborn
Advanced tools
An updated version of ebay-api module that includes oauth for eBay sShopping and Trading API. Now supports TLS1.2
Updated in 2021 by Jon Tranter, to add token validation that is required by Shopping and Finding API's as of September 21
A huge thank you to Ben Buckman who performed a huge amount of work on this module. Without his efforts this package wouldn't exist. Several other people have contributed to the module
This module aims to support all of eBay's old APIs (Trading, Shopping, Finding, Merchandising, etc), with an interface that is both a) somewhat consistent across APIs and b) not too different from the underlying interface.
The old eBay APIs are primarily XML-based, so this module unfortunately has to do a lot of JSON<->XML conversion.
It nows support Oauth that is required by Shopping and Finding API's as of September 21
The 1.x branch is currently under active development, and there may be breaking changes between minor releases.
(I realize this is contrary to best practice, but the module is not yet settled enough to major-bump every time.)
If you are using the 1.x branch, I recommend that you a) let me know your use case, b) help develop it, c) watch the commit and release logs carefully.
npm install ebay-api-reborn
var ebay = require('ebay-api-reborn');
(See the examples)
Sign up for an API key here: https://publisher.ebaypartnernetwork.com/PublisherToolsAPI
(You'll need a key to run the examples.)
And please make sure to follow the liscence terms: eBay API License and Terms when using this library.
xmlRequest(options, callback)
Makes an XML POST to an eBay API endpoints.
options
must contain:
serviceName
: e.g. 'Finding'opType
: e.g. 'findItemsAdvanced'appId
: your eBay API application IDand can optionally contain:
params
: (see examples and API documentation)reqOptions
: passed to the request module,
e.g. for additional headers
, or timeout
.xmlConverter
: function which takes the response XML and converts to JSON.
Module uses xml2js by default, but can be overridden.parser
: function which takes the response data (as JSON object) and extracts items
(or other units depending on the query).
Module includes a default parser.sandbox
: boolean (default false = production). May need to add additional endpoint URLs to the code as needed.raw
: boolean, set true
to skip parsing and return the raw XML response.parseDepth
: how many levels down to try to parse/interpret the response.
The default parser is still experimental. Set this to 0 or 1 to let your app do all the parsing.
(Default: unlimited)for authentication, include:
devId
certId
authToken
callback
gets (error, data)
.
flatten(obj)
Simplifies the JSON format of the API responses:
{ @key:KEY, __value__:VALUE }
is flattened to its key:value pair.Its purpose is to make the data easier to handle in code, and to model/query in MongoDB.
Runs synchronously, returns flattened object.
The default parser will flatten()
the response to a finite depth
(because infinite recursion on an indeterminate response size would cause an unnecessary performance hit).
If you want to flatten further, use this method directly.
parseResponseJson(data, options, callback)
The default parser. Can be overridden (see options
on xmlRequest()
).
convertXmlToJson(xmlBody, options, callback)
The default XML->JS converter. Uses xml2js. Can be overridden (see options
on xmlRequest()
).
getLatestApiVersions(callback)
Disabled in 1.x. Please submit a PR with a fix/refactor if you use this.
Get the version numbers of the APIs that make their version available.
The client exports and attempts to differentiate between EbaySystemError
, EbayRequestError
, and EbayClientError
.
An EbayAuthenticationError
is also defined, but not yet hooked up to anything.
See http://developer.ebay.com/DevZone/Shopping/docs/CallRef/types/ErrorClassificationCodeType.html and http://developer.ebay.com/devzone/xml/docs/Reference/ebay/Errors/ErrorMessages.htm.
See the examples directory. To run the examples, you need to add your own app key (I don't want my keys to be disabled for abuse!) - you can get one here.
This module uses the debug module for internal logging.
Run your app (or node REPL) with DEBUG=ebay* ...
to see output.
FAQs
An updated version of ebay-api module that includes oauth for eBay sShopping and Trading API. Now supports TLS1.2
We found that ebay-api-reborn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.