1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "records": [
10 {
11 "recordId": "valid-all-field",
12 "url": "https://ready.example/contact",
13 "email": "person@ready.example",
14 "address": "900 cedar street chicago il 60601",
15 },
16 {
17 "recordId": "partial-normalized",
18 "url": " partial.example/about/?utm_source=newsletter#team ",
19 "email": "person@partial.example",
20 },
21 {
22 "recordId": "no-actionable",
23 "url": " ",
24 "email": None,
25 "address": "",
26 },
27 {
28 "recordId": "invalid-only",
29 "url": "ftp://invalid.example",
30 "email": "missing-at-sign",
31 "address": "###",
32 },
33 {
34 "recordId": "mixed-valid-invalid",
35 "url": "https://mixed.example/contact",
36 "email": "missing-at-sign",
37 },
38 {
39 "recordId": "duplicate-url-a",
40 "url": "https://duplicate.example/contact",
41 "email": "alpha@duplicate.example",
42 },
43 {
44 "recordId": "duplicate-url-b",
45 "url": "https://duplicate.example/contact",
46 "email": "beta@duplicate.example",
47 },
48 {
49 "recordId": "domain-mismatch",
50 "url": "https://mismatch.example/contact",
51 "email": "owner@other.example",
52 },
53 {
54 "recordId": "email-review",
55 "email": "support@mailinator.com",
56 },
57 {
58 "recordId": "same-address-a",
59 "url": "https://north.example",
60 "email": "owner@north.example",
61 "address": "123 Main Street Suite 100, Austin, Texas 78701",
62 },
63 {
64 "recordId": "same-address-b",
65 "url": "https://south.example",
66 "email": "owner@south.example",
67 "address": "123 Main Street Suite 200, Austin, Texas 78701",
68 },
69 {
70 "recordId": "address-warning",
71 "address": "warehouse behind blue door",
72 },
73 ],
74 "fieldGroups": [
75 "url",
76 "email",
77 "address",
78 ],
79 "reviewStrictness": "standard",
80 "dedupeKeyMode": "keys_and_candidates",
81}
82
83
84run = client.actor("critd/contact-cleanup").call(run_input=run_input)
85
86
87print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
88for item in client.dataset(run["defaultDatasetId"]).iterate_items():
89 print(item)
90
91