1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "enableBusinessSearch": True,
10 "searchTerms": [
11 "plumber",
12 "roofing contractor",
13 ],
14 "searchLocations": ["New York, NY"],
15 "searchMaxResults": 10,
16 "searchIncludeSponsored": False,
17 "searchFetchFullDetails": False,
18 "enrichLeadDetails": False,
19 "leadDetailsSiteLookups": 3,
20 "enableBusinessDetails": False,
21 "businessUrls": [],
22 "enableReviews": False,
23 "reviewBusinessUrls": ["https://www.superpages.com/new-york-ny/bpp/handyman-at-your-service-465119325"],
24 "maxReviewsPerBusiness": 10,
25 "enableScrapeByUrl": False,
26 "scrapeUrls": ["https://www.superpages.com/new-york-ny/bpp/fred-smith-plumbing-heating-460765127"],
27 "webhookFormat": "json",
28 "proxyConfiguration": {
29 "useApifyProxy": True,
30 "apifyProxyGroups": ["RESIDENTIAL"],
31 "apifyProxyCountry": "US",
32 },
33}
34
35
36run = client.actor("b2b_leads/superpages-real-time-data-scraper").call(run_input=run_input)
37
38
39print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
40for item in client.dataset(run.default_dataset_id).iterate_items():
41 print(item)
42
43