1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search_term": "Paris",
12 "buy_rent": "buy",
13 "property_types": [
14 "Houses",
15 "Apartments"
16 ],
17 "min_price": 0,
18 "max_price": 10000000,
19 "min_area": 0,
20 "min_area_field": 0,
21 "rooms_min": 0,
22 "rooms_max": 5,
23 "bedrooms_min": 0,
24 "bedrooms_max": 5,
25 "outside_access": [],
26 "floor": [],
27 "conditions": [],
28 "owner_types": [
29 "Private",
30 "Professional"
31 ]
32};
33
34
35const run = await client.actor("dadhalfdev/leboncoin-property-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45