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 "dealType": "forsale",
13 "region": "3",
14 "city": "תל אביב יפו",
15 "searchUrls": [],
16 "maxResults": 100,
17 "propertyType": "",
18 "listedBy": "any",
19 "minPrice": 0,
20 "maxPrice": 0,
21 "minRooms": 0,
22 "maxRooms": 0,
23 "minSquareMeters": 0,
24 "maxSquareMeters": 0,
25 "minFloor": 0,
26 "maxFloor": 0,
27 "hasParking": false,
28 "hasElevator": false,
29 "hasBalcony": false,
30 "hasSafeRoom": false,
31 "isRenovated": false,
32 "isFurnished": false,
33 "onlyWithPhotos": false
34};
35
36
37const run = await client.actor("sian.agency/yad2-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