-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathdeals.js
More file actions
27 lines (22 loc) · 681 Bytes
/
deals.js
File metadata and controls
27 lines (22 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const Ebay = require('../src/index');
const { clientId, clientSecret } = require('./credentials/index');
let ebay = new Ebay({
clientID: clientId,
clientSecret: clientSecret,
body: {
grant_type: 'client_credentials',
scope: 'https://api.ebay.com/oauth/api_scope'
}
});
// get top ten deals in US.
ebay.getDeals().then((data) => {
console.log(data);
});
// get deals for specific country code and category
ebay.getDeals({
limit: 50, // no of deals per request
countryCode:'ebay-de',
eBayCatId: '1234' // deal for specific category id
}).then((data) => {
console.log(data);
});