1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "queries": "What are the top 5 CRM tools",
12 "maxPagesPerQuery": 1,
13 "geminiSearch": {
14 "enableGemini": false
15 },
16 "perplexitySearch": {
17 "enablePerplexity": false,
18 "returnImages": false,
19 "returnRelatedQuestions": false
20 },
21 "chatGptSearch": {
22 "enableChatGpt": false
23 },
24 "copilotSearch": {
25 "enableCopilot": false
26 },
27 "maximumLeadsEnrichmentRecords": 0
28};
29
30
31const run = await client.actor("apify/google-search-scraper").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