Overview

The Portugal Open Government Data API (dados.gov.pt) gives developers free access to official datasets from Portuguese government agencies, including statistics on population, economy, and public services. No authentication is required, and it supports a documented REST API. The platform is built on CKAN, making it consistent with many other European open data portals.

Beginner Tip

Explore the API documentation at "https://dados.gov.pt/en/docapi/" to see all available endpoints. Use the "package_search" action to find datasets by keyword — many datasets include both Portuguese and English metadata.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

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

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

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

Field Reference

success True if the API action completed without errors.
count Number of datasets returned for the query.
results Array of dataset objects matching the search criteria.
title Human-readable title of the dataset (often in Portuguese).
license_title The open license under which the dataset is published.
resources Downloadable files or data endpoints included in the dataset.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://dados.gov.pt/api/3/action/package_search?q=population&rows=5";
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

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

No results for English search terms Dataset titles and descriptions may only be available in Portuguese.
Try Portuguese keywords (e.g., "populacao", "saude", "transportes") or browse the web portal to find dataset identifiers.
Connection refused or timeout The server may be temporarily down for maintenance.
Retry after a few minutes and add error handling with exponential backoff in your application.
404 for dataset resource The resource URL stored in the dataset may link to a file that was moved or deleted.
Re-fetch the dataset metadata to check for updated resource URLs before attempting downloads.

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 YES
Category Government
Difficulty Beginner
Listing details not endpoint-verified

Similar APIs

View All →