1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableBusinessSearch": true,
12 "searchTerms": [
13 "plumber",
14 "roofing contractor"
15 ],
16 "searchLocations": [
17 "New York, NY"
18 ],
19 "searchMaxResults": 10,
20 "searchFetchFullDetails": false,
21 "enrichLeadDetails": false,
22 "leadDetailsSiteLookups": 3,
23 "enableBusinessDetails": false,
24 "businessUrls": [],
25 "enableReviews": false,
26 "reviewBusinessUrls": [
27 "https://www.citysearch.com/profile/18581644"
28 ],
29 "maxReviewsPerBusiness": 10,
30 "enableScrapeByUrl": false,
31 "scrapeUrls": [
32 "https://www.citysearch.com/profile/18581644"
33 ],
34 "webhookFormat": "json",
35 "proxyConfiguration": {
36 "useApifyProxy": true,
37 "apifyProxyGroups": [
38 "RESIDENTIAL"
39 ],
40 "apifyProxyCountry": "US"
41 }
42};
43
44
45const run = await client.actor("b2b_leads/citysearch-real-time-data-scraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55