1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceMode": "sample",
12 "mode": "demo",
13 "startUrls": [
14 {
15 "url": "https://schema.org/Product",
16 "sourceId": "SCHEMA-ORG-PRODUCT",
17 "userData": {
18 "sourceId": "SCHEMA-ORG-PRODUCT"
19 }
20 },
21 {
22 "url": "https://shopify.dev/docs/api/ajax/reference/product",
23 "sourceId": "SHOPIFY-PRODUCTS-JSON",
24 "userData": {
25 "sourceId": "SHOPIFY-PRODUCTS-JSON"
26 }
27 },
28 {
29 "url": "https://woocommerce.com/document/woocommerce-rest-api/",
30 "sourceId": "WOOCOMMERCE-PUBLIC-CATALOG",
31 "userData": {
32 "sourceId": "WOOCOMMERCE-PUBLIC-CATALOG"
33 }
34 }
35 ],
36 "maxItems": 25,
37 "outputMode": "sample-records"
38};
39
40
41const run = await client.actor("zentrafoundry/marketplace-stock-availability-tracker").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51