1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "rawData": [
12 {
13 "name": "Example product",
14 "price": 19.99,
15 "url": "https://example.com/p/1",
16 "inStock": true,
17 "tags": [
18 "new"
19 ]
20 },
21 {
22 "name": "Second product",
23 "price": 5,
24 "url": "https://example.com/p/2",
25 "inStock": false,
26 "seller": {
27 "name": "Example Shop",
28 "country": "US"
29 }
30 }
31 ]
32};
33
34
35const run = await client.actor("codemagnet/google-sheets-export").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45