Documentation / Endpoints
Getting started
Reference
Endpoints
Indicators
The catalogue. Both routes are free and callable without a key, because working out what you want to buy should never cost anything.
This is where you resolve an indicator id, its unit, its coverage and — before you build anything — its licence and access tier.
GET /v1/indicators
/v1/indicators- Auth
- Optional — anonymous callers are IP rate-limited
- Cost
- free
- Returns
- Array of indicator records
- Paging
- limit + offset, meta.total
Base https://api.worldgovdata.com/v1
Query parameters
| Parameter | Description |
|---|---|
qstring | Tokenized search over name, id and description. Every whitespace-separated token must match at least one of the three. Results are ranked: name starts with the whole phrase, then name contains every token, then everything else.example: life expectancy |
topicstring | Exact topic slug. The live list is /v1/topics.example: governance |
providerstring | Exact provider id — the part of an indicator id before the dot. /v1/meta/freshness lists them all.example: wgi |
featuredboolean | Restrict to the curated headline set, or to its complement.example: true |
projectionsboolean | true returns only series carrying forecast years beyond their newest observed year; false returns only fully-observed series. An indicator with no coverage row yet counts as fully observed.example: false |
sortenum | One of name, coverage, latest, topic, source. Anything else is a 400.default: name (or relevance when q is set) · example: coverage |
direnum | asc or desc. Reverses the sort column only — tie-breaks and null placement stay put. Has no effect unless sort is also set.default: each sort's natural direction · example: asc |
limitinteger, 1–500 | Page size. See Pagination.default: all matches (50 when q is set) · example: 100 |
offsetinteger, ≥ 0 | Rows to skip, applied after the sort.default: 0 · example: 100 |
All filters combine with AND. All of them are optional.
Request
curl -sS "https://api.worldgovdata.com/v1/indicators?topic=governance&sort=coverage&limit=100&offset=0"Response · 200
Fields
| Field | Type | Notes |
|---|---|---|
| id | string | provider.slug — the exact, case-sensitive key every other endpoint takes. |
| name | string | Display name. |
| description | string | null | One paragraph on what it measures and where it came from. |
| unit | string | null | Free text, e.g. “% GDP”, “0–100 percentile”, “2021 intl $”. Not an enum. |
| topic | string | One of the thirteen topic slugs. |
| higher_is_better | boolean | null | Direction. Null where the concept has no better end. |
| preferred | boolean | The canonical series where several measure the same concept. |
| featured | boolean | In the curated headline set the portal surfaces. |
| access_tier | string | open or display. Check this before building an export pipeline. |
| no_rank | boolean | True where ranking the series would be meaningless. |
| licence | string | The provider's licence, e.g. “CC BY 4.0”. |
| licence_url | string | null | Link the licence name to this. |
| attribution | string | The credit line to publish. See Licensing. |
| provider | object | id, name, and the same three licence fields again. |
| coverage | object | nulls | n_countries, yr_min, yr_max, latest_year. |
| related | array | Detail endpoint only. Up to 12 related indicators. |
licence, licence_url and attribution appear twice — once at the top level and once inside provider. They are the same values; the flat aliases exist so a consumer never has to reach into a nested object for a legal obligation.
Searching
q= is the fastest way from a phrase to an id. It splits on whitespace and requires every token to appear in the name, the id or the description, then ranks: a name starting with the whole phrase first, then names containing every token, then everything else.
Find an indicator
curl -sS "https://api.worldgovdata.com/v1/indicators?q=life%20expectancy&limit=10"Relevance order also wins over the default sort while q is set. Sending dir alone will not displace it — there is no column to reverse until you name a sort. Set sort explicitly if you want alphabetical results from a search.
Sorting
| sort | Orders by | Default dir |
|---|---|---|
| name | Indicator name | ascending |
| coverage | Number of countries held | descending |
| latest | Most recent observed year | descending |
| topic | Topic, then curated within-topic order | ascending |
| source | Provider id | ascending |
Each sort has the direction that makes sense for it — widest coverage first, most recent year first, names A to Z — so omitting dir gives you the useful order. Setting dir reverses the sort column and nothing else: the name tie-break stays ascending and nulls stay last, so sort=coverage&dir=asc means “fewest countries first” rather than “unknown first, then Z to A”. An unknown value for either returns 400 bad_sort or 400 bad_dir, naming the accepted set.
Reading meta
meta carries count (rows here), total (rows matching), and an echo of every filter you sent. Three things to know:
totalequalscounton an unpaged response — the real count is only computed when the response is actually paged.limitis not echoed.offsetis. Track your own page size.- Anything you did not send is omitted, so an absent
topicmeans “no topic filter”, notnull.
Full paging recipe on Pagination.
Notes
- Only servable indicators appear. Series we may not redistribute are absent from this list entirely, so its length is the real size of what you can use.
- An empty result is a 200, not a 404. A filter that matches nothing returns an empty array with
count: 0. - Unit is free text. Do not parse it, and do not assume two series with the same-looking unit are comparable. Read
description. - No
limitmeans everything. Without a filter and without a limit, this endpoint returns the entire catalogue in one response. That is free but it is not small — page it.
GET /v1/indicators/{indicator_id}
/v1/indicators/{indicator_id}- Auth
- Optional — anonymous callers are IP rate-limited
- Cost
- free
- Returns
- One indicator, plus related
- Related cap
- 12
Base https://api.worldgovdata.com/v1
The same record as the list, plus a related array. This is the call to make before you spend anything: it tells you the unit, the coverage, the licence and the access tier.
Path parameter
| Parameter | Description |
|---|---|
indicator_idpath, string · required | Exact and case-sensitive. No fuzzy resolution.example: wgi.control_of_corruption |
Request
curl -sS "https://api.worldgovdata.com/v1/indicators/wgi.control_of_corruption"Response · 200
The related array
Up to twelve indicators worth looking at next, merged from four sources in descending order of confidence, deduplicated by id, with the indicator itself excluded:
- Curated links — a human recorded the relationship. Highest confidence.
- Automatic same-concept links — different providers measuring the same thing.
- Computed correlations — strongest statistical association over shared country-years.
relation: "correlated". - Same-topic fallback — widest coverage in the same topic, so the array is never empty.
relation: "related".
Each entry is { id, name, topic, unit, relation }. The relation string is what tells you which tier you are looking at, and the array is ordered strongest first — so a “see also” strip can simply take the first few.
meta
The detail response’s meta is deliberately thin: generated_at, licence and attribution. There is no count — it is a single object.
Errors
404 indicator_not_found— no enabled, redistributable indicator has that id. The message repeats the id you sent, which is usually enough to spot the typo. Note that a series we may not redistribute produces this same 404 rather than a 403: from the API’s point of view it does not exist.
There is no 401 or 402 here — the endpoint is free and needs no key.
Related
- /v1/data — the observations behind an indicator, once you have its id.
- /v1/topics — the topic slugs this endpoint filters on.
- Licensing — what
access_tiermeans and what you owe the provider. - Pagination — walking the whole catalogue.