1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "places": [
9 {
10 "title": "Sample Bakery (demo)",
11 "subTitle": None,
12 "description": "A fictional demo bakery used to seed sample input for this Actor.",
13 "ownerDescription": None,
14 "price": "$$",
15 "categoryName": "Bakery",
16 "categories": [
17 "Bakery",
18 "Cafe",
19 ],
20 "address": "1 Demo Street, Sample City, Sample Prefecture, Japan",
21 "neighborhood": "Sample District",
22 "street": "1 Demo Street",
23 "city": "Sample City",
24 "postalCode": "100-0001",
25 "state": "Sample Prefecture",
26 "countryCode": "JP",
27 "website": "https://example.com",
28 "phone": "+81 3-1234-5678",
29 "phoneUnformatted": "+81312345678",
30 "claimThisBusiness": False,
31 "location": {
32 "lat": 35.681236,
33 "lng": 139.767125,
34 },
35 "menu": None,
36 "totalScore": 4.7,
37 "permanentlyClosed": False,
38 "temporarilyClosed": False,
39 "placeId": "DEMO_PLACE_ID_001",
40 "fid": "demo:001",
41 "cid": "1000000000000000001",
42 "reviewsCount": 120,
43 "imagesCount": 25,
44 "openingHours": [
45 {
46 "day": "Monday",
47 "hours": "8 AM to 6 PM",
48 },
49 {
50 "day": "Tuesday",
51 "hours": "8 AM to 6 PM",
52 },
53 ],
54 "url": "https://www.google.com/maps/search/?api=1&query=Sample%20Bakery%20demo&query_place_id=DEMO_PLACE_ID_001",
55 "searchString": "bakery",
56 "language": "en",
57 "rank": 1,
58 "isAdvertisement": False,
59 },
60 {
61 "title": "Sample Nail Salon (demo)",
62 "subTitle": None,
63 "description": None,
64 "ownerDescription": None,
65 "price": None,
66 "categoryName": "Nail salon",
67 "categories": ["Nail salon"],
68 "address": "2 Demo Street, Sample City, Sample Prefecture, Japan",
69 "neighborhood": "Sample District",
70 "street": "2 Demo Street",
71 "city": "Sample City",
72 "postalCode": "100-0002",
73 "state": "Sample Prefecture",
74 "countryCode": "JP",
75 "website": None,
76 "phone": "",
77 "phoneUnformatted": "",
78 "claimThisBusiness": True,
79 "location": {
80 "lat": 35.6813,
81 "lng": 139.7672,
82 },
83 "menu": None,
84 "totalScore": 4.2,
85 "permanentlyClosed": False,
86 "temporarilyClosed": False,
87 "placeId": "DEMO_PLACE_ID_002",
88 "fid": "demo:002",
89 "cid": "1000000000000000002",
90 "reviewsCount": 3,
91 "imagesCount": 1,
92 "openingHours": [],
93 "url": "https://www.google.com/maps/search/?api=1&query=Sample%20Nail%20Salon%20demo&query_place_id=DEMO_PLACE_ID_002",
94 "searchString": "nail salon",
95 "language": "en",
96 "rank": 2,
97 "isAdvertisement": False,
98 },
99 {
100 "title": "Sample Yoga Studio (demo)",
101 "subTitle": None,
102 "description": "A fictional demo studio used to test unreachable-website handling.",
103 "ownerDescription": None,
104 "price": None,
105 "categoryName": "Yoga studio",
106 "categories": [
107 "Yoga studio",
108 "Fitness center",
109 ],
110 "address": "3 Demo Street, Sample City, Sample Prefecture, Japan",
111 "neighborhood": "Sample District",
112 "street": "3 Demo Street",
113 "city": "Sample City",
114 "postalCode": "100-0003",
115 "state": "Sample Prefecture",
116 "countryCode": "JP",
117 "website": "https://no-such-site.invalid",
118 "phone": "+81 3-9876-5432",
119 "phoneUnformatted": "+81398765432",
120 "claimThisBusiness": False,
121 "location": {
122 "lat": 35.6814,
123 "lng": 139.7673,
124 },
125 "menu": None,
126 "totalScore": 4.5,
127 "permanentlyClosed": False,
128 "temporarilyClosed": False,
129 "placeId": "DEMO_PLACE_ID_003",
130 "fid": "demo:003",
131 "cid": "1000000000000000003",
132 "reviewsCount": 58,
133 "imagesCount": 10,
134 "openingHours": [{
135 "day": "Monday",
136 "hours": "7 AM to 9 PM",
137 }],
138 "url": "https://www.google.com/maps/search/?api=1&query=Sample%20Yoga%20Studio%20demo&query_place_id=DEMO_PLACE_ID_003",
139 "searchString": "yoga studio",
140 "language": "en",
141 "rank": 3,
142 "isAdvertisement": False,
143 },
144 ] }
145
146
147run = client.actor("reverenced_garnet/apify-gmaps-nap-checker").call(run_input=run_input)
148
149
150print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
151for item in client.dataset(run.default_dataset_id).iterate_items():
152 print(item)
153
154