1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "workflow": "snapshot",
12 "queries": [
13 "used iphone 13"
14 ],
15 "marketplace": "US",
16 "searchUrls": [],
17 "itemUrls": [],
18 "condition": "all",
19 "buyingFormat": "all",
20 "sort": "bestMatch",
21 "freeShipping": false,
22 "categoryId": "0",
23 "includeDetails": false,
24 "stateNamespace": "default",
25 "maxListings": 20,
26 "maxPages": 1,
27 "maxBuyerChargeUsd": 2
28};
29
30
31const run = await client.actor("luminar/ebay-product-scraper-price-monitor").call(input);
32
33
34console.log('Results from dataset');
35console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41