{"openapi":"3.0.3","info":{"title":"Gnist Context — SSB (Statistics Norway)","description":"Norwegian official statistics — population, employment, income, housing, trade, and economic data.\n\n- **MCP endpoint:** `https://context.gnist.ai/mcp/ssb/`\n- **Toolkit page:** `/toolkits/ssb`\n- **Full API spec:** `/api/openapi.json`\n- **Get an API key:** `/signup`","version":"1.0.0","contact":{"name":"GnistAI","url":"https://gnist.ai"}},"servers":[{"url":"https://context.gnist.ai","description":"Production"}],"paths":{"/rest/ssb/search_tables":{"post":{"tags":["Economics"],"summary":"search_tables","description":"Search SSB's statistical table catalog by keyword.\n\nSSB (Statistics Norway) publishes thousands of tables covering population,\nemployment, income, housing, trade, prices, health, education, and more.\nThis tool searches the full catalog.\n\nCommon queries: 'population', 'GDP', 'consumer price index', 'unemployment',\n'housing prices', 'immigration', 'wages', 'births', 'exports'.\n\nArgs:\n    query: Search keywords (e.g. 'population by municipality').\n    lang: Language — 'en' for English, 'no' for Norwegian (default 'en').\n\nReturns:\n    List of matching tables with table_id, title, path, and relevance score.\n    Use the table_id with get_table_metadata or get_data to explore further.","operationId":"ssb_search_tables","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"query":{"description":"Search keywords (e.g. 'population by municipality').","type":"string"},"lang":{"default":"en","description":"Language — 'en' for English, 'no' for Norwegian (default 'en').","type":"string"}},"required":["query"],"type":"object"}}}}}},"/rest/ssb/get_table_metadata":{"post":{"tags":["Economics"],"summary":"get_table_metadata","description":"Get the structure of an SSB table — its dimensions, variables, and valid values.\n\nUse this before querying data to understand what filters are available.\nEach variable lists its valid codes and labels. Variables marked 'elimination: true'\ncan be omitted from queries to get aggregated totals.\n\nTime variables are flagged with 'time: true'. Time codes follow patterns:\n'2024' (annual), '2024K3' (quarterly), '2024M06' (monthly).\n\nArgs:\n    table_id: SSB table ID (e.g. '07459' for population, '03013' for CPI).\n    lang: Language — 'en' or 'no'.\n\nReturns:\n    Table title and list of variables with codes, labels, and valid values.","operationId":"ssb_get_table_metadata","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"table_id":{"description":"SSB table ID (e.g. '07459' for population, '03013' for CPI).","type":"string"},"lang":{"default":"en","description":"Language — 'en' or 'no'.","type":"string"}},"required":["table_id"],"type":"object"}}}}}},"/rest/ssb/get_data":{"post":{"tags":["Economics"],"summary":"get_data","description":"Query data from an SSB statistical table.\n\nWithout filters, returns the latest top_n time periods for all dimensions.\nWith filters, you can select specific dimension values.\n\nEach filter dict needs: 'code' (variable code from metadata), 'filter' type,\nand 'values' list. Filter types:\n- 'item': select specific codes, e.g. {\"code\": \"Region\", \"filter\": \"item\", \"values\": [\"0\"]}\n- 'top': last N periods, e.g. {\"code\": \"Tid\", \"filter\": \"top\", \"values\": [\"5\"]}\n- 'all': all values, e.g. {\"code\": \"Boligtype\", \"filter\": \"all\", \"values\": [\"*\"]}\n\nExample — Norway total population, last 5 years (table 07459):\nfilters=[\n    {\"code\": \"Region\", \"filter\": \"item\", \"values\": [\"0\"]},\n    {\"code\": \"ContentsCode\", \"filter\": \"item\", \"values\": [\"Personer1\"]},\n    {\"code\": \"Tid\", \"filter\": \"top\", \"values\": [\"5\"]}\n]\n\nArgs:\n    table_id: SSB table ID.\n    filters: List of dimension filters. See get_table_metadata for valid codes.\n    top_n: If no filters given, fetch this many latest time periods (default 5).\n    lang: Language — 'en' or 'no'.\n\nReturns:\n    Parsed data with metadata (label, source, updated) and a list of records.\n    Each record has labeled dimension values and a 'value' field.","operationId":"ssb_get_data","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"table_id":{"description":"SSB table ID.","type":"string"},"filters":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"default":null,"description":"List of dimension filters. See get_table_metadata for valid codes."},"top_n":{"default":5,"description":"If no filters given, fetch this many latest time periods (default 5).","type":"integer"},"lang":{"default":"en","description":"Language — 'en' or 'no'.","type":"string"}},"required":["table_id"],"type":"object"}}}}}},"/rest/ssb/list_subjects":{"post":{"tags":["Economics"],"summary":"list_subjects","description":"List SSB's top-level subject categories.\n\nReturns the 23 main statistical subject areas (e.g. Population, Labour market,\nNational accounts, Health, Education). Use the returned IDs with browse_subject\nto navigate deeper into the hierarchy.\n\nArgs:\n    lang: Language — 'en' or 'no'.\n\nReturns:\n    List of subject categories with id, text, and type (folder or table).","operationId":"ssb_list_subjects","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"lang":{"default":"en","description":"Language — 'en' or 'no'.","type":"string"}},"type":"object"}}}}}},"/rest/ssb/browse_subject":{"post":{"tags":["Economics"],"summary":"browse_subject","description":"Browse a subject path to find sub-categories and tables.\n\nNavigate the SSB table hierarchy by providing a path from list_subjects\nor a previous browse_subject call. Returns child folders and tables.\n\nExample paths: 'bb' (Construction/housing), 'bb/bb01' (Building activity),\n'al' (National accounts/public finances).\n\nArgs:\n    path: Subject path (e.g. 'bb', 'bb/bb01').\n    lang: Language — 'en' or 'no'.\n\nReturns:\n    List of items at this path — folders to navigate deeper, or tables to query.","operationId":"ssb_browse_subject","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"path":{"description":"Subject path (e.g. 'bb', 'bb/bb01').","type":"string"},"lang":{"default":"en","description":"Language — 'en' or 'no'.","type":"string"}},"required":["path"],"type":"object"}}}}}},"/rest/ssb/report_feedback":{"post":{"tags":["Economics"],"summary":"report_feedback","description":"Report a bug, feature request, or general feedback for this data source.\n\nUse this when something doesn't work as expected, when you'd like\na new feature, or when you have suggestions for improvement.\n\nArgs:\n    feedback: Describe the issue or suggestion.\n    feedback_type: One of 'bug', 'feature_request', or 'general'.","operationId":"ssb_report_feedback","responses":{"200":{"description":"Successful tool call","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Server or tool not found"},"500":{"description":"Tool execution error"}},"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"feedback":{"type":"string"},"feedback_type":{"default":"general","type":"string"}},"required":["feedback"],"type":"object"}}}}}}},"tags":[{"name":"Economics","description":"Data sources: Economics"}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"gnist-api-key","description":"API key passed via request header."},"ApiKeyQuery":{"type":"apiKey","in":"query","name":"gnist_api_key","description":"API key passed via query parameter."}}}}