1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "enableSearch": True,
10 "searchTasks": [{
11 "what": "plumber",
12 "where": "Toronto, ON",
13 "maxResults": 10,
14 }],
15 "maxResultsPerTask": 10,
16 "enableLeadDetails": True,
17 "maxReviewsPerBusiness": 10,
18 "maxItems": 10000,
19 "concurrency": 3,
20 "delayBetweenRequestsMs": 250,
21 "proxyConfiguration": {
22 "useApifyProxy": True,
23 "apifyProxyGroups": ["RESIDENTIAL"],
24 "apifyProxyCountry": "CA",
25 },
26}
27
28
29run = client.actor("b2b_leads/yellow-pages-canada-real-time-data-scraper").call(run_input=run_input)
30
31
32print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
33for item in client.dataset(run.default_dataset_id).iterate_items():
34 print(item)
35
36