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 "nike air jordan 1",
14 "yeezy boost 350",
15 "new balance 550"
16 ],
17 "searchMaxResults": 10,
18 "searchSort": "newest",
19 "searchFetchFullDetails": false,
20 "enableListingDetails": false,
21 "productIds": [],
22 "enableSellerListings": false,
23 "sellerUsernames": [
24 "nike"
25 ],
26 "sellerMaxListings": 30,
27 "enableSellerProfile": false,
28 "enableSoldHistory": false,
29 "soldMaxItems": 30,
30 "enableScrapeByUrl": false,
31 "scrapeUrls": [
32 "https://stockx.com/search?q=nike+air+jordan"
33 ],
34 "webhookFormat": "json",
35 "proxyConfiguration": {
36 "useApifyProxy": true,
37 "apifyProxyGroups": [
38 "RESIDENTIAL"
39 ],
40 "apifyProxyCountry": "US"
41 }
42};
43
44
45const run = await client.actor("b2b_leads/stockx-real-time-data-scraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55