1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "data_freshness": "preloaded",
12 "country": "es",
13 "cat__excavators": true,
14 "cat__mini_excavators": true,
15 "cat__wheel_loaders": true,
16 "cat__skid_steers": true,
17 "cat__dozers": true,
18 "cat__cranes": true,
19 "cat__compactors": true,
20 "cat__crushers": true,
21 "cat__augers": true,
22 "cat__snow_blowers": true,
23 "cat__welding_equipment": true,
24 "cat__stump_grinders": true,
25 "cat__asphalt_pavers": true,
26 "maxListings": 100,
27 "maxItems": 0,
28 "pricedOnly": false,
29 "maxPagesPerCategory": 10,
30 "outputSchema": "ftp28"
31};
32
33
34const run = await client.actor("rastriq/machinerytrader-discovery").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44