# Chile Open Data Scraper (`parseforge/chile-datos-gob-cl-scraper`) Actor

Scrapes dataset metadata and full rows from Chile's official open data portal, datos.gob.cl. Returns each record as a flat row for export to CSV, JSON, Excel, or XML.

- **URL**: https://apify.com/parseforge/chile-datos-gob-cl-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $13.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner-v4.webp)](https://apify.com/parseforge?fpr=vmoqkp)

### Chile Open Data Scraper

**Scrape Chile Open Data from datos.gob.cl, the official government open data portal.** Get dataset metadata or pull full rows from any datastore resource, up to a million records per run. No API key required. Export to CSV, JSON, Excel, or XML.

Chile's official open data portal, datos.gob.cl, hosts thousands of public datasets from government agencies, but browsing and downloading them manually is slow. This Actor reads the portal's public CKAN API directly, so you can list the catalog with metadata or pull complete rows from any dataset resource. No registration, no API key, no rate limits to manage.

| Who uses it | What they scrape Chile Open Data for |
|---|---|
| Data journalists | Find and download government datasets for investigative stories |
| Researchers | Build a local copy of Chilean public data for analysis |
| Government agencies | Monitor datasets published by other Chilean institutions |
| NGOs and civil society | Track public spending, demographics, or environmental data |
| Developers | Integrate Chilean open data into applications or dashboards |

### What it does

This Actor collects dataset metadata from the Chile Open Data catalog or full rows from a specific dataset resource, and returns each record as a flat row.

- 📋 **Catalog mode:** list all datasets with title, description, tags, publisher, and update date, optionally filtered by a search term.
- 📊 **Dataset mode:** pull every row from a specific datastore resource by dataset ID, with optional resource ID to target a particular table.
- 🔎 **Search filter:** narrow the catalog by keyword across titles, descriptions, and tags before any data is collected.
- ⚙️ **Flexible limits:** set a maximum number of datasets or rows per run, from 1 to 1,000,000.
- 📤 **Multiple export formats:** save results as CSV, JSON, Excel, or XML directly from the Apify platform.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Chile Open Data data

**📰 Build a dataset inventory for journalism.**

A data journalist runs catalog mode with a search term like 'salud' to list all health-related datasets, then exports the metadata to plan an investigation.

**📈 Track government spending over time.**

A researcher pulls rows from a budget execution dataset by its ID, collecting every transaction for a fiscal year to analyze spending patterns.

**🌍 Monitor environmental indicators.**

An NGO sets up a scheduled run to pull the latest air quality measurements from a specific resource, feeding a public dashboard.

**🏛️ Compare regional statistics.**

A policy analyst collects demographic datasets for multiple Chilean regions, then joins them in a spreadsheet to compare outcomes.

**💻 Build a data-driven app.**

A developer uses dataset mode to fetch the full contents of a public services directory, then loads it into a mobile app for offline access.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Uses the public CKAN API, no registration or authentication needed |
| **Complete data** | Pull all rows from a datastore resource, not a preview |
| **Up to date** | Reflects the live portal, so you always get current metadata and records |
| **Structured output** | Every record is a flat row with consistent fields, ready for analysis |

### How it compares

No other Store actor targets Chile Open Data the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Chile Open Data Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Chile Open Data changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with a mode, an optional dataset ID and resource ID, and a search term for catalog filtering. Limits are applied as records are read, so only the requested number reaches your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10,
 "mode": "catalog"
}
```

A larger pull:

```json
{
 "maxItems": 200,
 "mode": "catalog"
}
```

### Pricing

Pay-per-result: **$0.01733 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $1.73 |
| 1,000 results | $17.33 |
| 10,000 results | $173.30 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Chile Open Data Scraper](https://apify.com/parseforge/chile-datos-gob-cl-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Chile Open Data through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/chile-datos-gob-cl-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your searchQuery in catalog mode. If it is too specific, it may not match any dataset. In dataset mode, verify that the datasetId is correct and that the dataset has a datastore-enabled resource.

**I get an error about a missing dataset ID.**

In dataset mode, the datasetId field is required. Run catalog mode first to find the correct ID, then enter it in the input.

**The Actor returns fewer records than expected.**

Check the maxItems setting. If it is lower than the total number of records, the Actor will stop early. Increase maxItems to collect more.

**The resource ID I provided does not work.**

Make sure the resource ID is a valid UUID from the dataset. You can find it by viewing the dataset on datos.gob.cl and looking at the resource URL, or by using the CKAN API to list resources.

**The Actor times out on large datasets.**

Try increasing the Actor's timeout in the Apify run settings, or reduce maxItems to pull a smaller subset first. For very large datasets, consider running multiple times with different filters.

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key or registration to use this Actor? | No. The Actor reads the public CKAN API of datos.gob.cl, which does not require authentication. You only need an Apify account to run the Actor. |
| What is the difference between catalog mode and dataset mode? | Catalog mode lists all available datasets with their metadata, such as title, description, tags, and publisher. Dataset mode pulls the actual rows from a specific datastore resource inside a dataset. |
| How do I find the dataset ID or resource ID? | Run the Actor in catalog mode first to see the list of datasets. Each dataset's ID is shown in the output. For resource IDs, you can inspect the dataset on datos.gob.cl or use the CKAN API directly. |
| Can I filter the catalog by keyword? | Yes. Use the searchQuery input to filter datasets by title, description, or tags. The search is performed by the portal's own search engine. |
| What happens if I don't provide a resource ID in dataset mode? | The Actor will use the first datastore-enabled resource within the dataset. If the dataset has multiple resources, you may want to specify the resource ID to target a specific table. |
| Is there a limit to how many records I can pull? | You can set maxItems from 1 to 1,000,000. The Actor will stop after collecting that many records. The portal itself may also impose pagination limits, but the Actor handles pagination automatically. |
| What formats can I export the data to? | On the Apify platform, you can export your results to CSV, JSON, Excel, or XML. You can also download the dataset via API. |
| Does this Actor work with any CKAN portal? | It is designed for datos.gob.cl, the official Chile Open Data portal. It may work with other CKAN-based portals if they expose a similar API, but it is not guaranteed. |
| How often is the data updated? | The Actor reads live data from the portal every time it runs. The freshness depends on how often the portal itself updates its datasets. |
| Can I schedule this Actor to run automatically? | Yes. You can set up a schedule in Apify to run the Actor at regular intervals, such as daily or weekly, to keep your local copy up to date. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Gobierno de Chile. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `maxItems` (type: `integer`):

How many datasets to collect per run.

## `mode` (type: `string`):

'catalog' lists all available datasets with metadata; 'dataset' pulls rows from a specific datastore resource.

## `datasetId` (type: `string`):

Dataset identifier from the catalog.

## `resourceId` (type: `string`):

Resource identifier (UUID) inside the dataset. If omitted, the first datastore-enabled resource is used.

## `searchQuery` (type: `string`):

Filter the catalog by keyword (title, description, tags).

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "catalog"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10,
    "mode": "catalog"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/chile-datos-gob-cl-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "maxItems": 10,
    "mode": "catalog",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/chile-datos-gob-cl-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "mode": "catalog"
}' |
apify call parseforge/chile-datos-gob-cl-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/chile-datos-gob-cl-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jJ16Zku5xpRzhzIey/builds/nARoiEqDzW6WjzBIO/openapi.json
