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 "vintage 90s levis 501",
15 "patagonia fleece"
16 ],
17 "searchMaxResults": 10,
18 "searchSort": "relevance",
19 "searchCategory": "",
20 "searchCondition": "",
21 "searchLocation": "10001",
22 "searchRadius": "50",
23 "searchFetchFullDetails": false,
24 "enableListingDetails": false,
25 "listingIds": [],
26 "listingUrls": [],
27 "enableSellerListings": false,
28 "sellerIds": [],
29 "sellerMaxListings": 30,
30 "enableSellerProfile": false,
31 "enableSoldHistory": false,
32 "soldMaxItems": 30,
33 "enableScrapeByUrl": false,
34 "scrapeUrls": [
35 "https://offerup.com/search?q=vintage%20carhartt"
36 ],
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/offerup-real-time-data-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