1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "search",
12 "site": "IE",
13 "locations": [
14 "dublin-city",
15 "cork-city"
16 ],
17 "section": "residential-for-sale",
18 "maxResults": 100,
19 "includeDetails": false,
20 "listingUrls": [],
21 "searchUrls": [],
22 "minPrice": 0,
23 "maxPrice": 0,
24 "minBeds": 0,
25 "maxBeds": 0,
26 "minBaths": 0,
27 "propertyType": "",
28 "minBer": "",
29 "maxBer": "",
30 "keywords": "",
31 "addedInLastDays": 0,
32 "adState": "published",
33 "sort": ""
34};
35
36
37const run = await client.actor("sian.agency/daft-property-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47