Overview

The Peru Open Government Data API (datosabiertos.gob.pe) offers free access to official datasets published by Peruvian government institutions, covering areas like economy, health, and social programs. No authentication is required, making it easy to explore without setup. The platform follows the CKAN open data standard, so developers familiar with other CKAN-based portals will find it immediately intuitive.

Beginner Tip

This portal uses the standard CKAN API — try "https://www.datosabiertos.gob.pe/api/3/action/package_search?q=salud" to search for health-related datasets. Many datasets include CSV downloads that are easy to process.

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 peru government open data data into web and mobile applications
Open Government, Peru 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, Peru",
    "description": "Peru Government Open Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

success Indicates whether the request was handled successfully.
count Total datasets found matching the search query.
results Array of dataset metadata objects.
title Name of the dataset, typically in Spanish.
organization The government agency that published this dataset.
resources List of file downloads or API endpoints for the dataset.

Implementation Example

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

Request
const url = "https://www.datosabiertos.gob.pe/api/3/action/package_search?q=economia&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.

Empty search results The query keyword may not match any dataset titles in Spanish.
Use Spanish language keywords (e.g., "salud", "educacion", "transporte") to search more effectively.
Slow response times Government servers may have limited bandwidth during peak hours.
Make requests during off-peak hours and implement caching to reduce redundant calls.
Resource URL not accessible Some dataset file links may be outdated or point to restricted servers.
Check the "last_modified" field and try alternative resource formats listed in the dataset metadata.

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
Listing details not endpoint-verified

Similar APIs

View All →