1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "IMPORT_FROM_SHEET",
12 "spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit",
13 "sheetName": "Class Data",
14 "publicSheet": true,
15 "serviceAccountEmail": "",
16 "datasetId": "",
17 "writeMode": "APPEND",
18 "upsertKey": "id",
19 "fields": [],
20 "flattenNestedObjects": true,
21 "flattenDelimiter": ".",
22 "formatSheet": true,
23 "headerRowIndex": 1,
24 "inferTypes": true,
25 "maxRows": 10000,
26 "batchSize": 500
27};
28
29
30const run = await client.actor("vnx0/google-sheets-integration").call(input);
31
32
33console.log('Results from dataset');
34console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40