1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.decathlon.com/sitemap.xml"
14 }
15 ],
16 "maxRequestsPerCrawl": 10,
17 "proxyConfig": {
18 "useApifyProxy": true
19 },
20 "extendOutputFunction": async ({ data, item, product, images, fns, name, request, variants, context, customData, input, Apify }) => {
21 return item;
22 },
23 "extendScraperFunction": async ({ fns, customData, Apify, label }) => {
24
25 },
26 "customData": {},
27 "maxConcurrency": 10,
28 "maxRequestRetries": 3,
29 "updatedSince": "",
30 "batchSize": 10,
31 "flushIntervalMs": 300,
32 "perHostConcurrency": 2,
33 "bufferSize": 100,
34 "storefrontApiVersion": "2024-07",
35 "storefrontShopDomain": "",
36 "storefrontAccessToken": ""
37};
38
39
40const run = await client.actor("runexes/actor-shopify-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50