1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "products": [
12 {
13 "id": "runner-42-black",
14 "title": "Example Men's Black Running Shoes - Size 42",
15 "description": "Lightweight black running shoes with a breathable mesh upper and rubber sole.",
16 "link": "https://example.com/products/runner-42-black",
17 "image_link": "https://example.com/images/runner-42-black.jpg",
18 "availability": "in_stock",
19 "price": "79.99 USD",
20 "brand": "Example",
21 "gtin": "4006381333931",
22 "condition": "new",
23 "item_group_id": "runner-black",
24 "color": "Black",
25 "size": "42"
26 }
27 ]
28};
29
30
31const run = await client.actor("gifted_wagon/product-feed-validator").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41