1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "dryRun": true,
12 "rawData": [
13 {
14 "title": "Blue mug",
15 "price": {
16 "value": 12.5,
17 "currency": "EUR"
18 },
19 "tags": [
20 "kitchen",
21 "ceramic"
22 ],
23 "url": "https://example.com/p/1"
24 },
25 {
26 "title": "Green mug",
27 "price": {
28 "value": 13,
29 "currency": "EUR"
30 },
31 "tags": [
32 "kitchen"
33 ],
34 "url": "https://example.com/p/2",
35 "inStock": true
36 }
37 ]
38};
39
40
41const run = await client.actor("plainsource/google-sheets-export").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