1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "enableSearch": True,
10 "searchTasks": [
11 {
12 "keyword": "plumbers",
13 "location": "Bristol",
14 "maxResults": 10,
15 },
16 {
17 "keyword": "electricians",
18 "location": "London",
19 "maxResults": 10,
20 },
21 ],
22 "maxResultsPerTask": 10,
23 "maxPagesPerTask": 5,
24 "enableBusinessDetails": True,
25 "maxReviewsPerBusiness": 3,
26 "enableContactDiscovery": False,
27 "fetchEmails": False,
28 "maxItems": 10000,
29 "concurrency": 4,
30 "delayBetweenRequestsMs": 1200,
31 "proxyConfiguration": {
32 "useApifyProxy": True,
33 "apifyProxyGroups": ["RESIDENTIAL"],
34 "apifyProxyCountry": "GB",
35 },
36}
37
38
39run = client.actor("b2b_leads/yell-real-time-data-scraper").call(run_input=run_input)
40
41
42print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
43for item in client.dataset(run.default_dataset_id).iterate_items():
44 print(item)
45
46