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": "GR",
13 "locations": [
14 "Athens",
15 "Thessaloniki"
16 ],
17 "listingType": "sale",
18 "category": "residential",
19 "propertyTypes": [],
20 "maxResults": 100,
21 "searchUrls": [],
22 "listingUrls": [],
23 "minPrice": 0,
24 "maxPrice": 0,
25 "minAreaSqm": 0,
26 "maxAreaSqm": 0,
27 "minRooms": 0,
28 "maxRooms": 0,
29 "minFloor": "",
30 "maxFloor": "",
31 "minYearBuilt": 0,
32 "maxYearBuilt": 0,
33 "energyClassAtLeast": "",
34 "listedWithin": "",
35 "updatedWithin": "",
36 "priceReducedOnly": false,
37 "features": [],
38 "sortBy": "best_match",
39 "includeDetails": false,
40 "includeAgentContact": false,
41 "language": "el"
42};
43
44
45const run = await client.actor("sian.agency/spitogatos-property-scraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55