1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://propertyscout.co.th/en/sales/"
14 }
15 ],
16 "moreFeatures": [
17 "pet-friendly",
18 "swimming-pool"
19 ],
20 "areaPath": "bangkok/asok",
21 "transactions": [
22 "sales"
23 ],
24 "propertyTypes": [
25 "condo"
26 ],
27 "bedroomFilters": [
28 "studio",
29 "1-bedroom"
30 ],
31 "featureSlugs": [
32 "pet-friendly",
33 "ready-to-move"
34 ],
35 "locationPaths": [
36 "bangkok/asok"
37 ],
38 "projectPaths": [
39 "bangkok/condo/noble-remix"
40 ],
41 "customSearchPaths": [
42 "sales/condo/1-bedroom/pet-friendly"
43 ]
44};
45
46
47const run = await client.actor("mai_amm/propertyscout-thailand-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57