Download full tables
Discover available StatCan tables, inspect their structure, and download complete CSVs for ETL pipelines or bulk analysis.
Fetching data vector-by-vector works well for dashboards and targeted queries, but it's impractical when you need an entire table loaded into a database or analysis tool. StatCan provides signed download URLs for complete table exports in CSV and SDMX format. This guide covers the discovery and download workflow.
Discover available tables
getAllCubesListLite returns lightweight metadata for all ~6,000 published tables in a single call. Each entry includes the table title, date range, frequency, and archive status — enough to find what you need without fetching full metadata for every table.
Each item has this shape:
Filter by title or subject
getAllCubesListLite returns all tables in a single response. The payload is large (~1–2 MB). Cache the result at application startup or in your build pipeline rather than calling it on every request.
Inspect table structure before downloading
Before downloading a large table, use getCubeMetadata to understand its dimensions, size, and release timing.
The dimension array tells you how the coordinate system is structured. Each dimension lists its member codes — which is what you'd use to construct a coordinate string for getDataFromCubePidCoordAndLatestNPeriods.
You can fetch metadata for multiple tables in one call:
Download a full table as CSV
getFullTableDownloadCSV returns a signed URL pointing to a zip archive. The zip contains one or more CSV files with the complete table data and a separate metadata file.
The returned URL is a signed, time-limited link. Download the zip immediately after receiving the URL — do not store the URL for later use.
Download and extract in Node.js
The zip contains CSV files. Here's a complete Node.js example using the built-in fetch and a stream-based unzip library:
To extract the CSV in memory without writing the zip to disk, use a library like unzipper or yauzl:
Download as SDMX
getFullTableDownloadSDMX returns a URL to an SDMX-ML file, which is the standard format for statistical data exchange. Use this if your downstream tooling (e.g. SDMX-compatible databases, R's rsdmx, Python's pandaSDMX) consumes SDMX natively.
CSV vs SDMX
Choose CSV when:
- You're loading into a database (PostgreSQL, SQLite, DuckDB)
- You're using pandas, R
data.frame, or similar tabular tools - You need the fastest parse time — CSV is simpler to process
- You want bilingual output (the zip includes both English and French files)
The CSV format matches StatCan's web download format and includes a header row with dimension names.