Open Government, Sweden API

Free to Use Varies (check documentation)

Overview

Sweden open Government Data API (dataportal.se) provides access to metadata and datasets published by Swedish government agencies across topics like transportation, environment, and demographics. It uses the DCAT-AP standard and is free to use without authentication. A good starting point for anyone interested in Nordic public data or cross-country government data comparisons.

Beginner Tip

The API returns dataset metadata (descriptions and download links) rather than raw data directly — follow the distribution URLs in the response to download the actual dataset files.

Available Data

Use case: Integrate sweden government open data data into web and mobile applications
Open Government, Sweden data via REST API

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Open Government, Sweden",
    "description": "Sweden Government Open Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

hits List of dataset metadata entries matching the query
hits[].title Dataset title, typically in Swedish
hits[].description Short description of the dataset contents
hits[].distribution File download options with format and access URLs
totalCount Total number of matching datasets in the catalog

Implementation Example

Request
const url = "https://www.dataportal.se/en/dataservice/91_29789/api-for-the-statistical-database";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Response contains only metadata, not actual data The dataportal.se API is a metadata catalog, not a data delivery API
Extract the downloadURL or accessURL from the distribution field and fetch those files separately to get actual data
Swedish characters appear garbled Response body is UTF-8 but was decoded as a different charset
Explicitly set UTF-8 decoding in your HTTP client before parsing the JSON response
Empty results for specific agency datasets Not all Swedish agencies have published datasets to the portal
Try the dataportal.se web UI to confirm datasets exist before querying; use broader category filters if needed

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Beginner
Verified: 2026-04-07

Similar APIs

View All →