GnistAI GnistAI
Log in

DST (Statistics Denmark)

Danish official statistics — population, employment, income, housing, trade, and economic data.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 6 tools tools 6 6 type: api wrapper type type api wrapper api wrapper lifecycle: maintained lifecycle lifecycle maintained maintained Economics

Data source: Statistics Denmark (Danmarks Statistik)

REST Bridge Endpoint https://context.gnist.ai/rest/dst/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (6)

list_subjects

List Statistics Denmark's top-level subject categories.

Returns the main statistical subject areas (e.g. People, Labour and income,
Economy, Social conditions, Education, Business, Transport, Environment).
Use the returned IDs with browse_subject or list_tables to explore further.

Args:
lang: Language — 'en' for English, 'da' for Danish (default 'en').

Returns:
List of subject categories with id, text, and has_subjects flag.

ParameterTypeRequiredDescription
langstringoptionalLanguage — 'en' for English, 'da' for Danish (default 'en'). (default: "en")
Request Body
{
  "query": "example"
}
browse_subject

Browse a subject area to find sub-subjects and tables.

Navigate the Statistics Denmark hierarchy by providing a subject ID from
list_subjects or a previous browse_subject call. Returns both child subjects
and tables available in this area.

Args:
subject_id: Subject ID (e.g. '1' for People, '2' for Labour).
lang: Language — 'en' or 'da'.

Returns:
Sub-subjects and tables within this subject area.

ParameterTypeRequiredDescription
subject_idstringrequiredSubject ID (e.g. '1' for People, '2' for Labour).
langstringoptionalLanguage — 'en' or 'da'. (default: "en")
Request Body
{
  "subject_id": "example"
}
list_tables

List available statistical tables, optionally filtered by subject.

Statistics Denmark has 2000+ tables. Filter by subject_id to get a manageable
list. Each table shows its ID, description, time range, and variables.

Args:
subject_id: Subject ID to filter by (e.g. '1'). Omit for all tables.
lang: Language — 'en' or 'da'.

Returns:
List of tables with table_id, text, time range, and variable names.

ParameterTypeRequiredDescription
subject_idanyoptionalSubject ID to filter by (e.g. '1'). Omit for all tables.
langstringoptionalLanguage — 'en' or 'da'. (default: "en")
Request Body
{
  "query": "example"
}
get_table_metadata

Get the structure of a Statistics Denmark table — its dimensions, variables, and valid values.

Use this before querying data to understand what filters are available.
Each variable lists its valid codes and labels. Variables marked 'elimination: true'
can be omitted from queries to get aggregated totals.

Time variables are flagged with 'time: true'. Time codes follow patterns:
'2024' (annual), '2024K1' (quarterly), '2024M01' (monthly).

Args:
table_id: DST table ID (e.g. 'FOLK1A' for population, 'AKU100' for labour force).
lang: Language — 'en' or 'da'.

Returns:
Table title, description, and list of variables with codes, labels, and valid values.

ParameterTypeRequiredDescription
table_idstringrequiredDST table ID (e.g. 'FOLK1A' for population, 'AKU100' for labour force).
langstringoptionalLanguage — 'en' or 'da'. (default: "en")
Request Body
{
  "table_id": "example"
}
get_data

Query data from a Statistics Denmark statistical table.

Without filters, returns the latest top_n time periods with default selections
for other dimensions. With filters, you select specific variable values.

Each filter dict needs: 'code' (variable ID from metadata) and 'values' list.

Example — Denmark total population, last 3 quarters (table FOLK1A):
filters=[
{"code": "KØN", "values": ["TOT"]},
{"code": "ALDER", "values": ["IALT"]},
{"code": "CIVILSTAND", "values": ["TOT"]},
{"code": "Tid", "values": ["2025K1", "2024K4", "2024K3"]}
]

Args:
table_id: DST table ID.
filters: List of variable filters. See get_table_metadata for valid codes.
top_n: If no filters given, fetch this many latest time periods (default 5).
lang: Language — 'en' or 'da'.

Returns:
Parsed data with metadata (label, source, updated) and a list of records.
Each record has labeled dimension values and a 'value' field.

ParameterTypeRequiredDescription
table_idstringrequiredDST table ID.
filtersanyoptionalList of variable filters. See get_table_metadata for valid codes.
top_nintegeroptionalIf no filters given, fetch this many latest time periods (default 5). (default: 5)
langstringoptionalLanguage — 'en' or 'da'. (default: "en")
Request Body
{
  "table_id": "example"
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
Request Body
{
  "feedback": "example"
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/rest/dst/browse_subject" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"subject_id": "example"}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/rest/dst/browse_subject",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={
  "subject_id": "example"
},
)
print(resp.json())

Related Toolkits (Economics)

Resources