1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "locations": [
12 {
13 "city": "Toronto",
14 "province": "ON"
15 }
16 ],
17 "urls": [
18 "https://www.realtor.ca/map#ZoomLevel=11&Center=43.718245%2C-79.376682&LatitudeMax=43.86034&LongitudeMax=-79.12303&LatitudeMin=43.57584&LongitudeMin=-79.63033&view=list&Sort=6-D&PGeoIds=g30_dpz89rm7&GeoName=Toronto%2C%20ON&PropertyTypeGroupID=1&TransactionTypeId=2&PropertySearchTypeId=1&Currency=CAD&IncludeHiddenListings=false",
19 "https://www.realtor.ca/bc/vancouver/real-estate",
20 "https://www.realtor.ca/on/toronto/apartments-for-rent"
21 ],
22 "proxyConfiguration": {
23 "useApifyProxy": true,
24 "apifyProxyGroups": [
25 "RESIDENTIAL"
26 ],
27 "apifyProxyCountry": "CA"
28 },
29 "ignoreFieldsForChanges": []
30};
31
32
33const run = await client.actor("abotapi/realtor-ca-scraper").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43