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 "searchFetchFullDetails": False,
17 "enrichLeadDetails": False,
18 "leadDetailsSiteLookups": 3,
19 "enableBusinessDetails": False,
20 "businessUrls": [],
21 "enableReviews": False,
22 "reviewBusinessUrls": ["https://www.citysearch.com/profile/18581644"],
23 "maxReviewsPerBusiness": 10,
24 "enableScrapeByUrl": False,
25 "scrapeUrls": ["https://www.citysearch.com/profile/18581644"],
26 "webhookFormat": "json",
27 "proxyConfiguration": {
28 "useApifyProxy": True,
29 "apifyProxyGroups": ["RESIDENTIAL"],
30 "apifyProxyCountry": "US",
31 },
32}
33
34
35run = client.actor("b2b_leads/citysearch-real-time-data-scraper").call(run_input=run_input)
36
37
38print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
39for item in client.dataset(run.default_dataset_id).iterate_items():
40 print(item)
41
42