Building a Live Licence-Verification Site From Canada's Open Data
A build log on merging 65,000+ Canadian contractor licences into one searchable site and API, covering a silent data-loss bug and a caching false alarm.
Canada has no single national contractor-licensing registry; each province runs its own portal and format. One developer merged Quebec (RBQ) and Ontario (HCRA) open data into a single searchable site and API, built with Apify scraping actors, Astro 5 in SSR mode, and Cloudflare Workers with a D1 database.
The most instructive part was a bug: the Ontario dataset silently showed only 755 records instead of tens of thousands. The alphabetical sweep only covered a-z, missing numbered corporations that start with digits, and per-record detail enrichment generated so many sequential requests that Apify's free-tier usage cap silently aborted the run midway — no error, just a truncated dataset that looked plausible.
The fix had three parts: expanding the sweep to 36 prefixes (a-z plus 0-9), making detail enrichment optional, and explicitly filtering the full registry down to meaningful statuses (licensed, revoked, suspended, etc.) instead of publishing everything. This took Ontario's live count from 755 to 11,104, bringing the total dataset to 65,177 licences (54,073 Quebec + 11,104 Ontario), served with schema.org markup, a chunked sitemap, and JSON/CSV/MCP API access.
A separate debugging story reinforced a broader lesson: stale numbers after a deploy turned out to come from the developer's own testing tool cache, not Cloudflare's edge cache — a reminder to always verify deploys in a real browser rather than trusting tooling that may serve cached responses.