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 "location": "Ciudad de México",
13 "locations": [
14 "Monterrey",
15 "Guadalajara"
16 ],
17 "agencyUrls": [],
18 "transactionType": "sale",
19 "propertyType": "all",
20 "minPrice": 0,
21 "maxPrice": 0,
22 "priceCurrency": "MXN",
23 "minBedrooms": 0,
24 "minBathrooms": 0,
25 "minParking": 0,
26 "minSurface": 0,
27 "maxSurface": 0,
28 "surfaceType": "land",
29 "publisherType": "all",
30 "propertyAge": "any",
31 "publishedWithin": "any",
32 "requiredMedia": "any",
33 "sortBy": "relevance",
34 "maxResults": 90
35};
36
37
38const run = await client.actor("sian.agency/inmuebles24-property-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48