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 "monitorScope": "",
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 "apifyProxyGroups": [
49 "RESIDENTIAL"
50 ],
51 "apifyProxyCountry": "AE"
52 }
53};
54
55
56const run = await client.actor("getascraper/dubicars-scraper").call(input);
57
58
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63 console.dir(item);
64});
65
66