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": "any",
13 "propertyType": "all",
14 "location": "any",
15 "searchText": "",
16 "minPrice": 0,
17 "maxPrice": 0,
18 "minAreaSqm": 0,
19 "maxAreaSqm": 0,
20 "minBedrooms": 0,
21 "minBathrooms": 0,
22 "condition": "any",
23 "advertiser": "anyone",
24 "sortBy": "recent",
25 "searchUrls": [],
26 "listingUrls": [],
27 "maxItems": 100
28};
29
30
31const run = await client.actor("sian.agency/corotos-com-property-scraper").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41