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 "searchDepartment": "",
19 "searchSort": "relevance",
20 "searchSoldOnly": false,
21 "searchFetchFullDetails": false,
22 "enableListingDetails": false,
23 "listingUrls": [],
24 "enableClosetListings": false,
25 "sellerUsernames": [
26 "grailed"
27 ],
28 "sellerMaxListings": 30,
29 "enableSellerProfile": false,
30 "enableSoldComps": false,
31 "soldMaxItems": 30,
32 "soldKeywords": [],
33 "enableScrapeByUrl": false,
34 "scrapeUrls": [
35 "https://www.grailed.com/listings/1"
36 ],
37 "scrapeMaxPages": 3,
38 "includeRaw": false,
39 "webhookFormat": "json",
40 "proxyConfiguration": {
41 "useApifyProxy": true,
42 "apifyProxyGroups": [
43 "RESIDENTIAL"
44 ],
45 "apifyProxyCountry": "US"
46 }
47};
48
49
50const run = await client.actor("b2b_leads/grailed-real-time-data-scraper").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60