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 "transaction": "comprar",
13 "propertyType": "apartamento",
14 "locations": [
15 "lisboa"
16 ],
17 "searchUrls": [],
18 "listingUrls": [],
19 "agencyUrls": [],
20 "fullDetails": false,
21 "maxResults": 100,
22 "priceMin": 0,
23 "priceMax": 0,
24 "areaMin": 0,
25 "areaMax": 0,
26 "typology": [],
27 "market": "any",
28 "ownerType": "any",
29 "buildYearMin": 0,
30 "listedWithinDays": "any",
31 "sortBy": "default"
32};
33
34
35const run = await client.actor("sian.agency/imovirtual-property-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45