1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "listings": [
12 {
13 "title": "Appartement 2 pièces 45 m²",
14 "price": 445000,
15 "surface": 45,
16 "rooms": 2,
17 "propertyType": "Appartement",
18 "latitude": 48.8537,
19 "longitude": 2.3709,
20 "zipcode": "75011",
21 "city": "Paris",
22 "url": "https://example.com/annonce-1"
23 },
24 {
25 "title": "Appartement 3 pièces 68 m²",
26 "price": 395000,
27 "surface": 68,
28 "rooms": 3,
29 "propertyType": "Appartement",
30 "zipcode": "69003",
31 "city": "Lyon",
32 "url": "https://example.com/annonce-2"
33 },
34 {
35 "title": "Maison 5 pièces 120 m²",
36 "price": 520000,
37 "surface": 120,
38 "rooms": 5,
39 "propertyType": "Maison",
40 "zipcode": "33000",
41 "city": "Bordeaux",
42 "url": "https://example.com/annonce-3"
43 }
44 ],
45 "fieldMapping": {}
46};
47
48
49const run = await client.actor("kris_fili/seloger-leboncoin-deal-checker").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59