1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "baseline": `{
12 "version": 1,
13 "pages": [
14 {
15 "url": "https://demo.example/services",
16 "status": 200,
17 "headers": [
18 {
19 "name": "Content-Type",
20 "value": "text/html; charset=utf-8"
21 }
22 ],
23 "finalUrl": "https://demo.example/services",
24 "html": "<!doctype html><html><head><title>Our services</title><link rel=\"canonical\" href=\"https://demo.example/services\"></head><body><h1>Our services</h1></body></html>"
25 }
26 ]
27}`,
28 "candidate": `{
29 "version": 1,
30 "pages": [
31 {
32 "url": "https://demo.example/services",
33 "status": 200,
34 "headers": [
35 {
36 "name": "Content-Type",
37 "value": "text/html; charset=utf-8"
38 }
39 ],
40 "finalUrl": "https://demo.example/services",
41 "html": "<!doctype html><html><head><title>Our services</title><link rel=\"canonical\" href=\"https://demo.example/services\"></head><body><h1>Our services</h1></body></html>"
42 }
43 ]
44}`,
45 "expectations": `{
46 "version": 1,
47 "pages": [
48 {
49 "url": "https://demo.example/services",
50 "indexable": true,
51 "requireTitle": true,
52 "canonical": {
53 "required": true,
54 "target": "https://demo.example/services"
55 }
56 }
57 ]
58}`
59};
60
61
62const run = await client.actor("intuitive_crevasse/release-sentinel").call(input);
63
64
65console.log('Results from dataset');
66console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
67const { items } = await client.dataset(run.defaultDatasetId).listItems();
68items.forEach((item) => {
69 console.dir(item);
70});
71
72