1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "country": [
13 "nz"
14 ],
15 "urls": [
16 "https://www.realestate.co.nz/residential/sale?k=mortgagee",
17 "https://www.realestate.com.au/buy/in-nsw/list-1?keywords=mortgagee"
18 ],
19 "nzRegion": "",
20 "nzListingType": "",
21 "auState": "",
22 "auListingType": "buy",
23 "auPropertyType": "",
24 "fetchDetails": true,
25 "maxItems": 20,
26 "maxPages": 0,
27 "proxy": {
28 "useApifyProxy": true
29 },
30 "incrementalMode": false,
31 "emitUnchanged": false,
32 "emitExpired": false
33};
34
35
36const run = await client.actor("abotapi/distressed-au-nz-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46