@varve/agency-sdks

@varve/cmhc-api

TypeScript client for CMHC Housing Market Information Portal table exports, filter discovery, and normalized observation rows.

CMHC's Housing Market Information Portal publishes Canadian housing data including starts, completions, under construction, vacancy, availability, rent, and rental universe tables. @varve/cmhc-api wraps the portal export flow in a typed TypeScript client with normalized, Zod-validated rows.

npm install @varve/cmhc-api zod
import { CmhcClient, CmhcApiError } from '@varve/cmhc-api';
 
const client = new CmhcClient();

When to use this package

Use @varve/cmhc-api when CMHC HMIP is the source of truth for a housing metric and you need a repeatable programmatic export.

It is a good fit for:

  • rental market data
  • housing starts and completions
  • table-driven export workflows
  • normalized CSV rows for analysis
  • planner flows that already know the CMHC table ID

Data model

CMHC exports are table-driven.

Survey identifies the broader portal area, such as rental market data.

Series, dimension, and breakdown identify the table and its layout.

Region uses CMHC geography identifiers. These are not plain Census GeoUID values.

Filters narrow the export, such as season or other table-specific options.

Quick start

const rows = await client.getCmhc({
  survey: 'Rms',
  series: 'Vacancy Rate',
  dimension: 'Bedroom Type',
  breakdown: 'Historical Time Periods',
  region: {
    geographyId: '2410',
    geographyTypeId: '3',
    geoUid: '59933',
  },
  filters: {
    season: 'October',
  },
});
 
console.log(rows[0]);

Common workflows

Geography identifiers

CMHC export endpoints require geographyId and geographyTypeId. If you also have a Census GeoUID, pass it as geoUid; the SDK preserves it on normalized rows for downstream joins.

region: {
  geographyId: '2410',
  geographyTypeId: '3',
  geoUid: '59933',
}

Attribution

CMHC data products have attribution requirements. Include the appropriate CMHC source notice when reproducing, adapting, or publishing CMHC data.

Official references

On this page