Open source and MIT licensed

TypeScript SDKs for official statistics

Provider-level clients for statistical APIs that need to be cited, reproduced, and refused when the response cannot be proven.

Installation

npm install @varve/statcan-wds @varve/statcan-rdaas @varve/ons-api @varve/eurostat-api @varve/bis-stats-api @varve/worldbank-api @varve/cmhc-api @varve/boc-valet @varve/fred-api zod

Note: zod is a required peer dependency for runtime validation.

Available Packages

Statistics Canada

@varve/statcan-wds

Time series vectors, table metadata, and release monitoring. Full coverage of all 16 WDS endpoints with automated 409/500 retry handling.

View documentation →

Statistics Canada

@varve/statcan-rdaas

Industry and occupation classifications, hierarchical code trees, plain-English index search, and version concordances.

View documentation →

Canada Mortgage and Housing Corporation

@varve/cmhc-api

Housing market CSV exports, bundled portal table metadata, filter validation, and normalized observation rows.

View documentation →

Bank of Canada

@varve/boc-valet

Financial time series, exchange rates, series and group discovery, recent observations, and graph-ready metadata.

View documentation →

UK Office for National Statistics

@varve/ons-api

Economic and demographic timeseries by CDID, dataset topic navigation, observation querying, and filtered CSV/XLS data extracts.

View documentation →

Eurostat

@varve/eurostat-api

JSON-stat data, SDMX metadata and CSV access, dataset catalogues, and graph-ready dimension/member metadata.

View documentation →

Bank for International Settlements

@varve/bis-stats-api

SDMX data queries, availability constraints, dataflows, codelists, and structure metadata for BIS statistics.

View documentation →

World Bank

@varve/worldbank-api

Countries, indicators, sources, topics, observations, pagination helpers, and indicator graph metadata.

View documentation →

Federal Reserve Bank of St. Louis

@varve/fred-api

Economic series, observations, categories, releases, tags, GeoFRED regional data, and graph-ready metadata.

View documentation →

Design Principles

Runtime Validation

All external API responses are parsed through Zod schemas. Upstream shape changes throw structured errors before your application treats the response as trusted data.

Isomorphic Implementation

Clients rely exclusively on the standard Fetch API without Node.js-specific dependencies. Supported across Node.js 18+, modern browsers, and edge runtimes (e.g., Cloudflare Workers).

Network Resilience

Built-in retry mechanisms with exponential backoff. Automatically handles transient 409/429/500 HTTP statuses, transparently respecting Retry-After headers.

Auditable Coverage

Provider-specific quirks, official references, and live integration status are documented so wrapper behavior can be inspected as APIs change.