1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceMode": "auto",
12 "sourceUrls": [
13 {
14 "url": "https://www.dubicars.com/dubai/new"
15 }
16 ],
17 "keyword": "",
18 "make": "",
19 "model": "",
20 "condition": "any",
21 "sellerType": "any",
22 "bodyType": "",
23 "fuelType": "",
24 "emirate": "",
25 "regionalSpecs": "",
26 "exportStatus": "any",
27 "minPrice": 0,
28 "maxPrice": 100000000,
29 "minYear": 0,
30 "maxYear": 2100,
31 "maxMileageKm": 100000000,
32 "sourceFailurePolicy": "continueAndReport",
33 "runMode": "snapshot",
34 "monitorKey": "",
35 "detailLevel": "auto",
36 "includeImages": true,
37 "includeDescription": true,
38 "includeSellerProfile": true,
39 "maxItems": 10,
40 "maxPagesPerSource": 1,
41 "maxDetailPages": 10,
42 "maxImagesPerListing": 8,
43 "emitUnchanged": false,
44 "maxConcurrency": 1,
45 "requestDelayMs": 1000,
46 "proxyConfiguration": {
47 "useApifyProxy": true
48 }
49};
50
51
52const run = await client.actor("getascraper/dubicars-scraper").call(input);
53
54
55console.log('Results from dataset');
56console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62