1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [],
12 "locations": [
13 "new-york-ny"
14 ],
15 "homeTypes": [
16 "all"
17 ],
18 "bedrooms": [],
19 "petPolicy": "",
20 "amenities": [],
21 "specialties": [],
22 "extraFilterSlugs": [],
23 "rawQueryString": "",
24 "mapBoundingBoxToken": "",
25 "maxItems": 100,
26 "maxPages": 3,
27 "includeDetails": false,
28 "includeImages": false,
29 "includeVirtualTours": false,
30 "saveHtml": false,
31 "maxConcurrency": 2,
32 "requestHandlerTimeoutSecs": 90,
33 "maxRequestRetries": 2,
34 "keywords": [],
35 "keywordMatchMode": "any",
36 "proxyConfiguration": {
37 "useApifyProxy": false
38 }
39};
40
41
42const run = await client.actor("leadsbrary/apartments-com-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52