1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searches": [
12 {
13 "transactionType": "sale",
14 "propertyType": "flat",
15 "locationPath": "mazowieckie/warszawa/warszawa/warszawa",
16 "maxPages": 2
17 },
18 {
19 "transactionType": "rent",
20 "propertyType": "flat",
21 "locationPath": "mazowieckie/warszawa/warszawa/warszawa",
22 "maxPages": 2
23 },
24 {
25 "transactionType": "sale",
26 "propertyType": "house",
27 "locationPath": "malopolskie/krakow/krakow/krakow",
28 "maxPages": 1
29 },
30 {
31 "transactionType": "rent",
32 "propertyType": "flat",
33 "locationPath": "dolnoslaskie/wroclaw/wroclaw/wroclaw",
34 "maxPages": 1
35 }
36 ],
37 "maxResults": 40,
38 "proxyConfiguration": {
39 "useApifyProxy": true,
40 "apifyProxyGroups": [
41 "RESIDENTIAL"
42 ]
43 }
44};
45
46
47const run = await client.actor("devilscrapes/otodom-poland-real-estate-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57