@varve/worldbank-api
TypeScript client for World Bank countries, indicators, sources, topics, observations, and graph-friendly metadata.
The World Bank Indicators API publishes country-level development indicators across population, poverty, health, education, climate, economy, and public finance. @varve/worldbank-api wraps the API in an isomorphic, Zod-validated TypeScript client.
When to use this package
Use @varve/worldbank-api when your data model is naturally country, indicator, and year.
It is a good fit for:
- country-level macro and development dashboards
- indicator lookup and metadata search
- source and topic browsing
- year range pulls for one or more countries
- graph metadata for indicator-country-period observations
Data model
Indicator is the measured concept, such as total population (SP.POP.TOTL).
Country is the reporting economy or region, such as USA, CAN, or WLD.
Observation is an indicator value for a country and period.
World Bank endpoints are paginated. Methods return both pagination and items unless they fetch a single object or a helper aggregates pages.
Quick start
Common workflows
Find indicators
Search the catalogue by source, topic, and pagination parameters.
Fetch observations
Pull country-year values for one or more countries.
Build graph metadata
Normalize an indicator slice into indicator, country, period, and observation nodes.
Configuration
The client retries 429 and 5xx responses.
Error handling
World Bank can return JSON error payloads even when the transport shape is valid. The package separates HTTP failures from provider response errors.