1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "schemaType": "Product",
14 "fields": {
15 "name": "Wireless Mechanical Keyboard",
16 "description": "Compact 65% wireless mechanical keyboard with hot-swappable switches.",
17 "image": "https://images.unsplash.com/photo-1587829741301-dc798b83add3",
18 "url": "https://example.com/products/keyboard",
19 "price": "89.99",
20 "priceCurrency": "USD",
21 "availability": "InStock",
22 "brand": "Example Brand",
23 "sku": "KB-65-WL"
24 }
25 }
26 ],
27 "pageUrls": []
28};
29
30
31const run = await client.actor("raional/schema-markup-generator").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