1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "baseline": """{
10 \"version\": 1,
11 \"pages\": [
12 {
13 \"url\": \"https://demo.example/services\",
14 \"status\": 200,
15 \"headers\": [
16 {
17 \"name\": \"Content-Type\",
18 \"value\": \"text/html; charset=utf-8\"
19 }
20 ],
21 \"finalUrl\": \"https://demo.example/services\",
22 \"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>\"
23 }
24 ]
25}
26""",
27 "candidate": """{
28 \"version\": 1,
29 \"pages\": [
30 {
31 \"url\": \"https://demo.example/services\",
32 \"status\": 200,
33 \"headers\": [
34 {
35 \"name\": \"Content-Type\",
36 \"value\": \"text/html; charset=utf-8\"
37 }
38 ],
39 \"finalUrl\": \"https://demo.example/services\",
40 \"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>\"
41 }
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
62
63run = client.actor("intuitive_crevasse/release-sentinel").call(run_input=run_input)
64
65
66print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
67for item in client.dataset(run.default_dataset_id).iterate_items():
68 print(item)
69
70