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 "listingId": "demo-1",
14 "listingUrl": "https://example.com/listing/1",
15 "title": "Piso 3 hab Madrid",
16 "description": "Piso en herencia, urge vender, negociable, a reformar.",
17 "price": 189000,
18 "currency": "EUR",
19 "publishedAt": "2026-05-01T10:00:00Z"
20 },
21 {
22 "listingId": "demo-2",
23 "listingUrl": "https://example.com/listing/2",
24 "title": "Flat near metro",
25 "description": "Charming flat near metro, recently renovated, move-in ready.",
26 "price": 320000,
27 "currency": "EUR",
28 "publishedAt": "2026-09-20T10:00:00Z"
29 },
30 {
31 "listingId": "demo-3",
32 "listingUrl": "https://example.com/listing/3",
33 "title": "Estate sale home",
34 "description": "Beautiful home sold as-is, estate sale, cash only preferred.",
35 "price": 275000,
36 "currency": "USD",
37 "previousPrice": 310000,
38 "publishedAt": "2026-01-15T10:00:00Z"
39 }
40 ],
41 "asOfDate": "2026-10-04"
42};
43
44
45const run = await client.actor("noahadler/listing-motivation-enricher").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55