1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "listings": [
10 {
11 "placeId": "a1",
12 "category": "Cafe",
13 "postalCode": "100-0001",
14 "rating": 4.4,
15 },
16 {
17 "placeId": "a2",
18 "category": "Cafe",
19 "postalCode": "100-0002",
20 "rating": 4.1,
21 },
22 {
23 "placeId": "a3",
24 "category": "Cafe",
25 "postalCode": "100-0003",
26 "rating": 4.6,
27 },
28 {
29 "placeId": "a4",
30 "category": "Gym",
31 "postalCode": "100-0004",
32 "rating": 4.2,
33 },
34 {
35 "placeId": "a5",
36 "category": "Gym",
37 "postalCode": "100-0005",
38 "rating": 3.9,
39 },
40 {
41 "placeId": "b1",
42 "category": "Cafe",
43 "postalCode": "200-0001",
44 "rating": 4,
45 },
46 {
47 "placeId": "b2",
48 "category": "Cafe",
49 "postalCode": "200-0002",
50 "rating": 4.3,
51 },
52 {
53 "placeId": "b3",
54 "category": "Cafe",
55 "postalCode": "200-0003",
56 "rating": 4.5,
57 },
58 {
59 "placeId": "b4",
60 "category": "Gym",
61 "postalCode": "200-0004",
62 "rating": 4,
63 },
64 {
65 "placeId": "b5",
66 "category": "Gym",
67 "postalCode": "200-0005",
68 "rating": 4.4,
69 },
70 {
71 "placeId": "c1",
72 "category": "Cafe",
73 "postalCode": "300-0001",
74 "rating": 4.2,
75 },
76 {
77 "placeId": "c2",
78 "category": "Cafe",
79 "postalCode": "300-0002",
80 "rating": 4,
81 },
82 {
83 "placeId": "c3",
84 "category": "Cafe",
85 "postalCode": "300-0003",
86 "rating": 4.7,
87 },
88 ],
89 "minCategoryListings": 1,
90 "minExpectedListings": 0.5,
91 "minDeficit": 0.5,
92}
93
94
95run = client.actor("practical_ai_lab_jp/pal-maps-business-coverage-gaps").call(run_input=run_input)
96
97
98print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
99for item in client.dataset(run.default_dataset_id).iterate_items():
100 print(item)
101
102