Skip to content

REST API

The Dissemination Toolkit exposes a read-only JSON:API-compliant HTTP API. It allows external applications and scripts to consume published catalogue data programmatically.

All endpoints require authentication and return responses in the JSON:API format.

Authentication

Authenticate using one of the following methods:

MethodDescription
Sanctum tokenPass Authorization: Bearer {token} in the request header
Session cookieSame-origin requests from an authenticated browser session are automatically authenticated

To obtain a Sanctum token, an administrator must create one through the management dashboard or via the command line.

Base URL

https://your-domain.com/api

Endpoints

Datasets

MethodPathDescription
GET/api/datasetsList published datasets
GET/api/datasets/{id}Show a single dataset
GET/api/datasets/{id}/observationsPaginated observations for a dataset
GET/api/datasets/{id}/metadataMetadata for a dataset
GET/api/datasets/{id}/downloadDownload dataset as CSV

Indicators

MethodPathDescription
GET/api/indicatorsList indicators
GET/api/indicators/{id}Show a single indicator

Topics

MethodPathDescription
GET/api/topicsList topics
GET/api/topics/{id}Show a single topic

Dimensions

MethodPathDescription
GET/api/dimensionsList dimensions
GET/api/dimensions/{id}Show a single dimension
GET/api/dimensions/{id}/valuesList values for a dimension

Response format

All responses follow the JSON:API specification:

  • List endpoints return a data array containing resource objects, plus jsonapi and optionally meta and links.
  • Single-resource endpoints return a data object with type, id, attributes, and links.
  • Metadata / observations return the relevant data under a meta key.

Every response includes a top-level jsonapi key:

json
{
  "jsonapi": {
    "version": "1.1"
  }
}

Parameters

Pagination

List endpoints accept JSON:API-standard pagination via page[size]:

GET /api/datasets?page[size]=10

The default page size is 20.

Sparse fieldsets

Limit which attributes are returned using fields[resourceType]:

GET /api/datasets?fields[datasets]=code,published

Compound documents

Include related resources with the include parameter:

GET /api/datasets/{id}?include=topics,indicators

Examples

List published datasets

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-domain.com/api/datasets
bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-domain.com/api/datasets/1?include=topics,indicators,dimensions

Download a dataset as CSV

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-domain.com/api/datasets/1/download

Fetch metadata for a dataset

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-domain.com/api/datasets/1/metadata

List dimension values

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-domain.com/api/dimensions/1/values

Error responses

StatusMeaning
401Unauthenticated — missing or invalid token
404Resource not found or unpublished
422Validation error (invalid parameters)
500Server error