1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableListingSearch": true,
12 "searchKeywords": [
13 "carhartt detroit jacket",
14 "levis 501 jeans",
15 "patagonia fleece"
16 ],
17 "searchMaxResults": 10,
18 "searchSort": "newest",
19 "searchBuyNowOnly": false,
20 "searchFetchFullDetails": false,
21 "enableListingDetails": false,
22 "listingIds": [],
23 "enableClosetListings": false,
24 "sellerIds": [],
25 "closetMaxListings": 50,
26 "closetCategories": [],
27 "enableSellerProfile": false,
28 "enableSoldComps": false,
29 "soldKeywords": [],
30 "soldDaysBack": 7,
31 "soldMaxItems": 50,
32 "enableScrapeByUrl": false,
33 "scrapeUrls": [
34 "https://shopgoodwill.com/search?q=vintage+levis"
35 ],
36 "scrapeMaxPages": 3,
37 "webhookFormat": "json",
38 "proxyConfiguration": {
39 "useApifyProxy": true,
40 "apifyProxyGroups": [
41 "RESIDENTIAL"
42 ],
43 "apifyProxyCountry": "US"
44 }
45};
46
47
48const run = await client.actor("b2b_leads/shopgoodwill-real-time-scraper").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58