1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "keywords": [
12 "coffee grinder"
13 ],
14 "engines": [
15 "google",
16 "youtube",
17 "bing"
18 ],
19 "country": "us",
20 "language": "en",
21 "expandAlphabet": true,
22 "expandDigits": false,
23 "expandQuestions": false,
24 "expandModifiers": false,
25 "maxSuggestionsPerEngine": 100,
26 "maxResults": 100,
27 "onlyNew": false,
28 "outputMode": "merged",
29 "requestsPerSecond": 5,
30 "proxyConfiguration": {
31 "useApifyProxy": false
32 }
33};
34
35
36const run = await client.actor("mmdincer/autocomplete-keyword-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46