query_table
Values from one IMDi statistics table.
Direct GET
For navigating agents: open the HTML page with parameters in the URL. The result is fetched and displayed without screenshots or form filling.
https://allemannsdata.com/wiki/kilder/imdi/query_table/?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0
For software and dashboards:
Read the operation descriptor.
The JSON GET template is https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0.
| Parameter | Requirement | JSON type | Description |
|---|---|---|---|
table | required | string | A table name from list_tables, e.g. "bosatt_befolkning". |
municipality | optional | union | A 4-digit municipality number (e.g. "4602" for Kinn). Names are not accepted. Selects the header group that breaks the table down by kommuneNr; omit to use the first group. |
years | optional | union | Year codes to include, e.g. ["2025"]. Most tables use single years; a few use periods such as "2021 til 2023". |
filters | optional | union | Optional JSON object of extra conditions, dimension name to a list of codes, e.g. '{"enhet": ["promille"]}'. The dimension must exist in the chosen group. Explicit municipality/years win over the same dimension in filters. |
limit | optional | integer | Max rows to return, 1-5000 (default 500). Unit: items. |
offset | optional | integer | Results to skip before the first one returned (default 0); with limit, pages through every match. Unit: items. |
Generated JavaScript, Python and response structure
Use JSON when the user requests code, machine-readable data, value extraction or further computation. Use the HTML GET page to identify the correct source and verify parameters.
Example for generated JavaScript and Python
https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0
Replace URL placeholders and remove unused optional parameters.
JavaScript in a dashboard
const url = "https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0";
const response = await fetch(url);
if (!response.ok) {
const failure = await response.json();
throw new Error(`${failure.error.code}: ${failure.error.message} ${failure.suggestion}`);
}
const result = await response.json();
const data = result.data;
Python without additional packages
import json
from urllib.request import urlopen
url = "https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0"
with urlopen(url) as response:
result = json.load(response)
data = result["data"]
Response structure
{
"source": "imdi",
"operation": "query_table",
"parameters": {},
"data": {},
"entities": [],
"_meta": {"retrieved_at": "...", "sources": [], "cache": {}},
"_links": {"self": "...", "source": "...", "wiki": "...", "feedback": "..."}
}
Form for manual use
The form is a fallback for people and browser agents that cannot open the GET URL directly.
Continue exploring
- Back to Integration statistics (IMDi)
- All sources in Society, statistics and open data
- Search for Integration statistics (IMDi) in the wiki
How an AI agent should use this page
Ground rule: Navigate with HTML GET links to keep explanations and relationships. Use the page's JSON alternative only when concrete values must be extracted, compared or computed.
How to use the query_table lookup
- Replace the placeholders in the HTML GET template; remove optional parameters you do not need.
- Check types, units, limits and ID formats in the parameter table.
- Follow linked results to canonical pages before combining sources.
Misreading to avoid: An empty list means "no results for this lookup". An error message or unavailable source does not mean the data does not exist.
Source-specific next step
Go to the source page for other operations. Use the JSON template only after the HTML result shows that the parameters and source are correct.
AI agent? Read the complete navigation and programming guide.