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 "Iphone",
13 "Samsung Galaxy"
14 ],
15 "urls": [
16 "www.apple.com",
17 "www.samsung.com",
18 "www.amazon.com",
19 "www.flipkart.com",
20 "www.croma.com",
21 "www.gadgetsnow.com",
22 "www.tomsguide.com",
23 "www.91mobiles.com"
24 ],
25 "location": "New York",
26 "proxyConfiguration": {
27 "useApifyProxy": true,
28 "apifyProxyGroups": [
29 "RESIDENTIAL"
30 ]
31 }
32};
33
34
35const run = await client.actor("caprolok/google-rank-checker").call(input);
36
37
38console.log('Results from dataset');
39console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45