1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "language": "en",
12 "ownPages": [
13 {
14 "id": "own-home",
15 "text": "Steel roof panels. Roof repair guide.",
16 "sourceUrl": "https://example.com/own"
17 },
18 {
19 "id": "own-copy",
20 "text": "Steel roof panels. Roof repair guide.",
21 "sourceUrl": "https://example.com/own-copy"
22 }
23 ],
24 "referencePages": [
25 {
26 "id": "ref-solar",
27 "text": "Solar roof panels. Solar installation guide.",
28 "sourceUrl": "https://example.com/reference"
29 },
30 {
31 "id": "ref-price",
32 "text": "Solar panels price. Installation price guide.",
33 "sourceUrl": "https://example.com/reference-price"
34 }
35 ]
36};
37
38
39const run = await client.actor("danielmichalek/keyword-gap-analyzer").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49