1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "urls": [
13 "https://www.ddproperty.com/en/property-for-sale/in-bangkok-th10",
14 "https://www.ddproperty.com/en/property-for-rent/in-bangkok-th10",
15 "https://www.ddproperty.com/en/property-for-sale",
16 "https://www.ddproperty.com/en/property-for-sale/in-bangkok-th10?page=2",
17 "https://www.ddproperty.com/en/property-for-sale?freetext=sukhumvit&propertyTypeCode=CONDO&minprice=2000000&bedrooms=2&sort=price&order=asc",
18 "https://www.ddproperty.com/en/property-for-sale/in-bangkok-th10/priced-under-1m-thb",
19 "https://www.ddproperty.com/en/property-for-sale/in-bang-bon-th1050",
20 "https://www.ddproperty.com/en/property-for-sale/near-e9-on-nut-bts-2174",
21 "https://www.ddproperty.com/en/condo-for-sale",
22 "https://www.ddproperty.com/en/detached-house-for-sale",
23 "https://www.ddproperty.com/en/commercial-property-for-sale",
24 "https://www.ddproperty.com/en/new-property-launch?listingType=sale&page=1",
25 "https://www.ddproperty.com/en/property/ideo-mobi-rama-9-bangkok-for-sale-500188725",
26 "https://www.ddproperty.com/en/property/project/chapter-one-spark-charan-bangkok-for-sale-500444048",
27 "https://www.ddproperty.com/en/agent/aksarapak-chittara-1265048",
28 "https://www.ddproperty.com/en/agent-directory",
29 "https://www.ddproperty.com/en/condo-for-sale/in-bangkok-th10",
30 "https://www.ddproperty.com/en/condo-for-sale?freetext=Sukhumvit",
31 "https://www.ddproperty.com/en/property-for-sale?freetext=Sukhumvit",
32 "https://www.ddproperty.com/en/new-property-launch?region_code=TH10"
33 ],
34 "proxy": {
35 "useApifyProxy": true,
36 "apifyProxyGroups": [
37 "RESIDENTIAL"
38 ],
39 "apifyProxyCountry": "TH"
40 },
41 "ignoreFieldsForChanges": []
42};
43
44
45const run = await client.actor("abotapi/ddproperty-scraper").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