{"source":"imdi","operation":"query_table","description":"Values from one IMDi statistics table. Signature: query_table(table: string, required; municipality: string, optional, default None; years: list of string (comma-separated), optional, default None; filters: string, optional, default None; limit: integer, items, optional, default 500; offset: integer, items, optional, default 0).","signature":"query_table(table: string, required; municipality: string, optional, default None; years: list of string (comma-separated), optional, default None; filters: string, optional, default None; limit: integer, items, optional, default 500; offset: integer, items, optional, default 0)","parameters":[{"name":"table","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"A table name from list_tables, e.g. \"bosatt_befolkning\".","unit":null},{"name":"municipality","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"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.","unit":null},{"name":"years","type":"array","schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}]},"required":false,"default":null,"description":"Year codes to include, e.g. [\"2025\"]. Most tables use single years; a few use periods such as \"2021 til 2023\".","unit":null},{"name":"filters","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"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.","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer"},"required":false,"default":500,"description":"Max rows to return, 1-5000 (default 500). Unit: items.","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer"},"required":false,"default":0,"description":"Results to skip before the first one returned (default 0); with limit, pages through every match. Unit: items.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table?table={table}&municipality={municipality}&years={years}&filters={filters}&limit=500&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"table":{"type":"string"},"count":{"type":"integer"},"returned":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"value":{"type":["number","string","null"]}},"additionalProperties":{"type":["string","null"]}}}},"additionalProperties":false,"required":["table","count","returned","rows"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"intentionally_none","entity_types":[],"description":"No stable cross-source entity projection is defined for this operation; entities is intentionally empty."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"503":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":true}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table","operation":"https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table","source":"https://allemannsdata.com/wiki/api/v1/kilder/imdi","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["table","count","returned","rows","rows[].value"],"output_fields_truncated":false,"canonical_field_aliases":{},"response_example":{"source":"imdi","operation":"query_table","parameters":{"table":"example value","municipality":"example value","years":["example value"],"filters":"example value","limit":500,"offset":0},"data":{"table":"example value","count":1,"returned":1,"rows":[{"value":1.0}]},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"imdi","name":"Integration statistics (IMDi)","description":"Settlement, introduction-programme and labour statistics for immigrants per municipality, from the undocumented endpoint behind IMDi's statistics pages.","cache_ttl_seconds":86400,"documentation":"https://www.imdi.no/tall-og-statistikk/"}]},"_provenance":{"data":{"source":"imdi","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/imdi"},"entities":{"source":"imdi","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/imdi","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/imdi/query_table","source":"https://allemannsdata.com/wiki/api/v1/kilder/imdi","wiki":"https://allemannsdata.com/wiki/kilder/imdi/query_table/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
