1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "searchItems",
12 "query": "iPhone",
13 "sortBy": "relevance",
14 "location": "",
15 "publishedToday": false,
16 "category": "",
17 "itemCondition": "",
18 "tradeType": "",
19 "forRent": "",
20 "sellerType": "",
21 "itemFreeShippingOnly": false,
22 "carFuel": "",
23 "carBodyType": "",
24 "carTransmission": "",
25 "carDealerSegment": "",
26 "carWheelDrive": "",
27 "carColour": "",
28 "carSalesForm": "",
29 "carRegistrationClass": "",
30 "carWarrantyInsurance": "",
31 "carDocumentation": "",
32 "carWheelSets": "",
33 "carSmoothTrade": false,
34 "mcType": "",
35 "mcCondition": "",
36 "mcFuel": "",
37 "boatClass": "",
38 "boatMotorType": "",
39 "boatFuel": "",
40 "boatMaterial": "",
41 "truckSegment": "",
42 "commercialDealerSegment": "",
43 "busSegment": "",
44 "constructionSegment": "",
45 "agricultureToolsType": "",
46 "caravanSegment": "",
47 "rvCondition": "",
48 "rvLocation": "",
49 "rvSleepers": "",
50 "caravanDealerSegment": "",
51 "motorhomeSegment": "",
52 "motorhomeSeats": "",
53 "motorhomeTransmission": "",
54 "motorhomeWheelDrive": "",
55 "jobExtent": "",
56 "jobDuration": "",
57 "jobSector": "",
58 "jobWorkingLanguage": "",
59 "jobHomeOffice": "",
60 "jobManagerRole": "",
61 "jobWorkExperience": "",
62 "jobEducation": "",
63 "jobOccupation": "",
64 "jobIndustry": "",
65 "jobApplicationDeadline": "",
66 "propertyType": "",
67 "realEstateLifecycle": "",
68 "realEstateIsNewProperty": "",
69 "realEstateOwnershipType": "",
70 "realEstateEnergyLabel": "",
71 "realEstateFloor": "",
72 "realEstateFurnished": "",
73 "realEstateAnimalsAllowed": "",
74 "realEstateMinBedrooms": "",
75 "realEstateSellerType": "",
76 "maxItems": 20
77};
78
79
80const run = await client.actor("crawlerbros/finn-no-scraper").call(input);
81
82
83console.log('Results from dataset');
84console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
85const { items } = await client.dataset(run.defaultDatasetId).listItems();
86items.forEach((item) => {
87 console.dir(item);
88});
89
90