1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "newHousingPriceIndex",
12 "geography": "Toronto, Ontario",
13 "housingStartsGeography": "Toronto, Ontario",
14 "buildingPermitsGeography": "Canada",
15 "priceIndexComponent": "Total (house and land)",
16 "housingEstimateType": "Housing starts",
17 "housingUnitType": "Total units",
18 "averageRentsGeography": "Toronto, Ontario",
19 "housingStartsByMarketGeography": "Toronto, Ontario",
20 "dwellingUnitType": "Total units",
21 "marketType": "Homeowner",
22 "rentStructureType": "Row and apartment structures of three units and over",
23 "rentUnitType": "Two bedroom units",
24 "vacancyRatesGeography": "Toronto, Ontario",
25 "permitStructureType": "Total residential and non-residential",
26 "permitTypeOfWork": "Types of work, total",
27 "permitVariable": "Value of permits",
28 "seasonalAdjustment": "Unadjusted, current",
29 "condoApartmentPriceIndexGeography": "Toronto, Ontario",
30 "housingStartsSAARGeography": "Canada",
31 "housingStartsSAARUnitType": "Total units",
32 "newlyCompletedUnoccupiedHousingGeography": "Toronto, Ontario",
33 "unoccupiedHousingUnitType": "Total units",
34 "absorptionsGeography": "Toronto, Ontario",
35 "absorptionsCAGeography": "All census agglomerations 50,000 and over",
36 "completedDwellingUnitsStatus": "Absorptions",
37 "absorptionsUnitType": "Total units",
38 "maxItems": 100
39};
40
41
42const run = await client.actor("crawlerbros/statistics-canada-housing-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