1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "geo": "US",
12 "outputMode": "complete",
13 "fromDate": "today",
14 "toDate": "3 days",
15 "maxItems": 100,
16 "proxy": {
17 "useApifyProxy": true
18 },
19 "extendOutputFunction": async ({ data, item, request, customData, fromDate, toDate, Apify }) => {
20 return item;
21 },
22 "extendScraperFunction": async ({ data, item, request, addUrl, customData, fromDate, toDate, extendOutputFunction, Apify }) => {
23
24 },
25 "customData": {}
26};
27
28
29const run = await client.actor("dainty_screw/advanced-google-trending-searches").call(input);
30
31
32console.log('Results from dataset');
33console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
34const { items } = await client.dataset(run.defaultDatasetId).listItems();
35items.forEach((item) => {
36 console.dir(item);
37});
38
39