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": "EXAMPLE-CHARGER",
14 "title": "Example 65W USB-C charger",
15 "model": "C65",
16 "images": [
17 "https://example.com/charger.jpg"
18 ],
19 "market": "DE",
20 "manufacturer": {
21 "name": "Example Tech Co., Ltd.",
22 "address": "Bao'an District, Shenzhen 518000, China",
23 "email": "support@example.com"
24 },
25 "warnings": "Warning: indoor use only. Keep away from water."
26 },
27 {
28 "id": "EXAMPLE-MUG",
29 "title": "Example ceramic mug 350 ml",
30 "ean": "4006381333931",
31 "images": [
32 "https://example.com/mug.jpg"
33 ],
34 "manufacturer": {
35 "name": "Example Keramik GmbH",
36 "address": "Musterstraße 12, 10115 Berlin, Germany",
37 "email": "info@example.de"
38 }
39 },
40 {
41 "id": "EXAMPLE-BLOCKS",
42 "title": "Example wooden building blocks toy",
43 "sku": "BLK-50",
44 "market": "FR",
45 "manufacturer": "Example Toys Ltd, 1 High Street, London SW1A 1AA, United Kingdom, www.example.co.uk"
46 }
47 ]
48};
49
50
51const run = await client.actor("ultimatemc/gpsr-listing-checker").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61