-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathfinding.js
94 lines (85 loc) · 2.65 KB
/
finding.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* eslint-disable no-console */
'use strict';
const Ebay = require('../src/index');
const { clientId } = require('./credentials/index');
let ebay = new Ebay({
clientID: clientId,
countryCode: 'EBAY-US'
});
ebay.findItemsByCategory({
categoryId: 10181,
Condition: 1000
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});
// refer here for filtering the items
// https://developer.ebay.com/devzone/finding/callref/finditemsbykeywords.html#control
ebay.findItemsByKeywords({
keywords: 'iphone',
sortOrder: 'PricePlusShippingLowest', //https://developer.ebay.com/devzone/finding/callref/extra/fndcmpltditms.rqst.srtordr.html
Condition: 3000,
SoldItemsOnly: false,
affiliate: {
networkId: 9,
trackingId: 1234567890
}
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});
//https://developer.ebay.com/devzone/finding/callref/findCompletedItems.html
/* This call 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.
Keyword queries search the title and subtitle of the item; they do not search descriptions. */
ebay.findCompletedItems({
keywords: 'Garmin nuvi 1300 Automotive GPS Receiver',
categoryId: '156955',
sortOrder: 'PricePlusShippingLowest', //https://developer.ebay.com/devzone/finding/callref/extra/fndcmpltditms.rqst.srtordr.html
Condition: 3000,
SoldItemsOnly: true,
entriesPerPage: 2
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});
// // This call searches for items on eBay using specific eBay product values.
// https://developer.ebay.com/DevZone/finding/CallRef/findItemsByProduct.html#findItemsByProduct
ebay.findItemsByProduct({
productId: 53039031,
entriesPerPage: 2
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});
// Searches items on eBay by category or keyword or both.
ebay.findItemsAdvanced({
entriesPerPage: 2,
keywords: 'ipad',
ExpeditedShippingType: 'OneDayShipping'
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});
ebay.getVersion().then((data) => {
console.log(data.version);
}, (error) => {
console.log(error);
});
// Find ebay stores here https://www.ebay.com/sns
// https://developer.ebay.com/devzone/finding/callref/findItemsIneBayStores.html
ebay.findItemsIneBayStores({
storeName: 'Battery Gallery',
SoldItemsOnly: true,
MinPrice: '5.00',
MaxPrice: '800.00',
}).then((data) => {
console.log(data);
}, (error) => {
console.log(error);
});