1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchQueries": [
12 "Cardiology | New York, NY"
13 ],
14 "startUrls": [
15 {
16 "url": "https://www.healthgrades.com/usearch?what=Cardiology&where=New%20York%2C%20NY&pageNum=1"
17 }
18 ],
19 "sortBy": "bestmatch",
20 "maxItems": 20,
21 "includeProfileDetails": true,
22 "includeReviews": true,
23 "maxReviewsPerProfile": 10,
24 "maxReviews": 500,
25 "maxRequestsPerCrawl": 500,
26 "maxConcurrency": 2,
27 "debug": false,
28 "proxy": {
29 "useApifyProxy": false
30 }
31};
32
33
34const run = await client.actor("ahmed_jasarevic/healthgrades-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44