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 "locations": [
13 "Bangkok"
14 ],
15 "urls": [
16 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ",
17 "https://www.hipflat.co.th/คอนโดให้เช่า/กรุงเทพฯ",
18 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ?page=2",
19 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ/2ห้องนอน?sort=price_asc",
20 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ?sort=price_asc&page=2",
21 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ?price_min=3000000&price_max=5000000",
22 "https://www.hipflat.co.th/ขายคอนโด/กรุงเทพฯ/สาทร",
23 "https://www.hipflat.co.th/ขายคอนโด",
24 "https://www.hipflat.co.th/en/condo-for-sale/bangkok",
25 "https://www.hipflat.co.th/en/condo-for-rent/bangkok",
26 "https://www.hipflat.co.th/ads/cu3u02c083eu7th0e1a89n433u0he740",
27 "https://www.hipflat.co.th/en/ads/cu3u02c083eu7th0e1a89n433u0he740",
28 "https://www.hipflat.co.th/thailand-projects/condo/bangkok-bm",
29 "https://www.hipflat.co.th/thailand-projects/condo/bangkok-bm?page=2",
30 "https://www.hipflat.co.th/projects/31-residence-krkcne"
31 ],
32 "proxy": {
33 "useApifyProxy": true
34 },
35 "incrementalMode": false,
36 "emitUnchanged": false,
37 "emitExpired": false,
38 "ignoreFieldsForChanges": []
39};
40
41
42const run = await client.actor("abotapi/hipflat-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52