# Mercado Público Tenders Scraper — Chile Public Procurement (`fabrikit/mercado-publico-scraper`) Actor

Scrape Chile's public procurement from ChileCompra's official Mercado Público API: open tenders (licitaciones) with buyer, dates, estimated amount, UNSPSC items and award results, plus purchase orders with supplier and totals. From US$3 per 1,000 tenders.

- **URL**: https://apify.com/fabrikit/mercado-publico-scraper.md
- **Developed by:** [Fabrikit](https://apify.com/fabrikit) (community)
- **Categories:** Lead generation, Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 tenders

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Mercado Público Tenders Scraper — Chile Public Procurement Data

Get **Chile's public procurement data** from **Mercado Público** (ChileCompra) as clean, analysis-ready JSON: every **open tender (licitación)** with its buyer, dates, estimated budget, requested products (UNSPSC codes and quantities) and — once decided — the **award result with winning suppliers and amounts**. Switch to **purchase-order mode** to get the actual orders the State places every day (buyer, supplier, net/tax/total amounts, line items and prices), including Compra Ágil, Convenio Marco and direct-deal orders.

The Actor talks to ChileCompra's **official REST API** (`api.mercadopublico.cl`) over plain HTTP — no browser, no scraping of HTML, no login. That makes it fast, cheap and stable.

**What you can do with it**

- **Find sales leads**: every tender open for bids right now (~5,000 at any time), filtered by keywords, buyer and region, with closing dates and budgets.
- **Track competitors and prices**: awarded tenders with the winning company's RUT, name and awarded amount per line item; or every purchase order a given supplier received.
- **Monitor a buyer**: everything a municipality, hospital or ministry tenders or buys, day by day.
- **Build datasets**: a full day of tenders or of ~19,000 purchase orders in one run, ready for BI tools, CRMs or LLM pipelines.

### Quick start

1. (Recommended) get your **free API ticket** — see [How to get a free API ticket](#how-to-get-a-free-api-ticket). Without one, the Actor tries ChileCompra's public demo ticket, which works but is shared and slow.
2. Choose **What to scrape**: tenders or purchase orders.
3. Pick a **status**, optional **dates**, **keywords**, **buyer**, **regions** or **supplier RUT**, and a **Max items** cap. Press **Start**.
4. Export the dataset as JSON, CSV or Excel, or connect it to Google Sheets, webhooks, Zapier, Make or the Apify API.

#### Example inputs

All tenders open for bids now that mention computers, in Santiago and Valparaíso:

```json
{
    "mode": "tenders",
    "tenderStatus": "active",
    "keywords": "notebook, computador, impresora",
    "regions": ["13", "5"],
    "maxItems": 200,
    "ticket": "YOUR-FREE-TICKET"
}
```

Tenders awarded last week, with winners and amounts:

```json
{
    "mode": "tenders",
    "tenderStatus": "awarded",
    "dateFrom": "2026-10-05",
    "dateTo": "2026-10-09",
    "fetchDetails": true,
    "maxItems": 1000
}
```

Every Compra Ágil purchase order a competitor received in the last 30 days:

```json
{
    "mode": "purchaseOrders",
    "supplierRut": "76.018.705-4",
    "orderTypes": ["AG"],
    "lastDays": 30,
    "maxItems": 500
}
```

### Input

| Field | Description |
|---|---|
| `mode` | `tenders` (licitaciones) or `purchaseOrders` (órdenes de compra). |
| `ticket` | Your own free Mercado Público API ticket (secret field). Empty = public demo ticket, with a warning. |
| `tenderStatus` | `active` (live snapshot of all tenders open now — dates ignored), or `published`, `closed`, `awarded`, `deserted`, `revoked`, `suspended`, `all` (queried day by day). |
| `orderStatus` | `all`, `sentToSupplier`, `accepted`, `received`, `cancelled`, `pendingReceipt`. |
| `dateFrom` / `dateTo` | Day range (YYYY-MM-DD). The API works per day, so the Actor walks the range newest day first. |
| `lastDays` | When `dateFrom` is empty: the last N days ending on `dateTo`/today (default 7). |
| `keywords` | Comma-separated words matched against the **title** (case/accent-insensitive, ANY word). |
| `buyer` | Organisation code (e.g. `7248`) or part of its name (`MUNICIPALIDAD DE SANTIAGO`). |
| `regions` | Buyer regions (1–16). Needs full details, so it switches `fetchDetails` on. |
| `supplierRut` | Company RUT: only tenders that supplier took part in / orders it received. |
| `orderTypes` | Purchase orders only: `AG` Compra Ágil, `CM` Convenio Marco, `TD` direct award, `SE`, `CC`. |
| `fetchDetails` | Full record per item (default on): description, buyer, dates, amounts, items, award/supplier data. Off = code, title, status and closing date only. |
| `maxItems` | Cap on results (default 50). |

### Output

One item per tender or purchase order. Tenders and orders share one schema (`recordType` tells them apart; fields that don't apply are `null`). Dates are ISO-8601 in Chilean local time (America/Santiago, no offset). Amounts are numbers in the record's `currency` (almost always `CLP`; `CLF` = UF). RUTs are normalised as `12345678-9`.

Example (real awarded tender, trimmed):

```json
{
    "recordType": "tender",
    "code": "1138297-10-LE26",
    "url": "https://www.mercadopublico.cl/Procurement/Modules/RFB/DetailsAcquisition.aspx?idlicitacion=1138297-10-LE26",
    "name": "Servicio de producción de eventos para la realización de la actividad “Invitación de Compradores y Rueda de Negocios Multisectorial” ...",
    "status": "awarded",
    "statusLabel": "Adjudicada",
    "type": "LE",
    "typeDescription": "Public tender 100–1,000 UTM",
    "buyerOrganizationCode": "1674056",
    "buyerOrganizationName": "DIRECCION GENERAL DE PROMOCION DE EXPORTACIONES",
    "buyerRut": "62000680-7",
    "buyerUnitName": "MN FONDO DE TERCEROS",
    "buyerRegion": "Región de Atacama",
    "buyerRegionCode": 3,
    "currency": "CLP",
    "amount": 28000000,
    "estimatedAmount": 28000000,
    "publishedAt": "2026-09-17T11:38:46",
    "questionsDeadlineAt": "2026-09-22T15:00:00",
    "closingAt": "2026-09-28T15:02:00",
    "awardDate": "2026-10-09T00:00:00",
    "numberOfBidders": 1,
    "awardedSuppliers": [
        { "rut": "76866970-8", "name": "Alvarez y Fernandez Ltda.", "isNaturalPerson": false, "awardedAmount": 23100000, "awardedItems": 1 }
    ],
    "awardedTotalAmount": 23100000,
    "supplierName": "Alvarez y Fernandez Ltda.",
    "supplierRut": "76866970-8",
    "items": [
        {
            "line": 1,
            "productCode": 80141607,
            "categoryCode": "80141600",
            "productName": "Producción de eventos",
            "unit": "Global",
            "quantity": 1,
            "unitPrice": 23100000,
            "lineTotal": 23100000,
            "awardedSupplierRut": "76866970-8",
            "awardedSupplierName": "Alvarez y Fernandez Ltda.",
            "awardedQuantity": 1
        }
    ],
    "itemCount": 1,
    "detailsFetched": true,
    "scrapedAt": "2026-10-12T16:40:06.927Z"
}
```

#### Main fields

| Field | Description |
|---|---|
| `recordType` | `tender` or `purchaseOrder` |
| `code`, `url` | Mercado Público code (e.g. `1000-24-LE26`, `1002588-249-AG26`) and public page |
| `name`, `description` | Title and description |
| `status`, `statusCode`, `statusLabel` | Normalised English status, API code and Spanish label |
| `type`, `typeDescription` | Tender type (L1, LE, LP, LQ, LR, …) or order type (AG, CM, TD, SE, CC) |
| `buyerOrganizationCode/Name`, `buyerRut`, `buyerUnitCode/Name`, `buyerAddress`, `buyerComuna`, `buyerRegion`, `buyerRegionCode` | Public buyer (organisation and buying unit) |
| `currency`, `amount` | Headline amount: estimated amount (tenders, or awarded total when the estimate is hidden) / order total |
| `estimatedAmount` | Tender budget, when the buyer publishes it |
| `netAmount`, `taxAmount`, `totalAmount` | Purchase-order totals |
| `createdAt`, `publishedAt`, `questionsDeadlineAt`, `closingAt`, `estimatedAwardDate`, `awardDate` | Tender timeline |
| `sentAt`, `acceptedAt`, `cancelledAt`, `lastModifiedAt` | Purchase-order timeline |
| `numberOfBidders`, `awardActUrl`, `awardedSuppliers[]`, `awardedTotalAmount` | Award result (tenders) |
| `supplierCode/Name/Rut/Activity/Comuna/Region`, `supplierIsNaturalPerson` | Supplier (orders; tenders with a single winner) |
| `tenderCode`, `compraAgilCode` | Tender behind an order / Compra Ágil quote code (`…-COT26`) |
| `items[]`, `itemCount` | Lines: UNSPSC `productCode`, `categoryCode`, `category`, `productName`, `description`, `unit`, `quantity`, `unitPrice`, `lineTotal`, awarded supplier/quantity |
| `detailsFetched`, `scrapedAt` | Whether the full record was fetched; scrape time (UTC) |

A `SUMMARY` record in the run's key-value store lists the filters used, counts, API calls and any errors.

### Pricing

Pay per event — you only pay for results saved to your dataset:

| Event | Price | When |
|---|---|---|
| `tender-result` | US$3.00 / 1,000 tenders | Each tender saved |
| `order-result` | US$2.00 / 1,000 purchase orders | Each purchase order saved |
| `item-details` | US$2.00 / 1,000 records | Add-on: each saved record that includes its full detail (`fetchDetails`) |
| Actor start | US$0.00005 per run | Apify's standard start event |

Examples: 1,000 open tenders with full details = US$5. A full day of ~19,000 purchase orders, list data only = about US$38. Platform usage (compute) is included.

### How to get a free API ticket

ChileCompra gives every user a free personal ticket:

1. Open **https://www.chilecompra.cl/api/** and click **"Pide tu ticket"**.
2. Log in with **ClaveÚnica** and fill in the short form.
3. The ticket (a code like `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX`) arrives in your e-mail within minutes. Paste it into the **Mercado Público API ticket** field — it is stored as a secret.

Without a ticket the Actor uses the demo ticket printed in ChileCompra's documentation. It is shared by everybody, so the API often answers "simultaneous requests" and the Actor slows down to about one detail record per second; ChileCompra can also revoke it at any time — in that case the run stops with these same instructions.

### FAQ

**Is this legal / allowed?** The data is public procurement information published by the Chilean State through its official open API, under ChileCompra's terms of use. The Actor only reads public data, needs no account and does not bypass any protection.

**What about personal data?** The Actor is built for company data. When a winning or supplying party is an individual (a RUT below 50,000,000 = natural person), its name and RUT are withheld (`isNaturalPerson: true`). Names and contact details of public officials are not exported as fields, and e-mail addresses and phone numbers are removed from free-text descriptions.

**Why is "today" empty for tenders?** The API publishes each day's tender list after the day ends. Use `active` for live open tenders, or a range ending yesterday. Purchase orders appear in near real time.

**Why do keyword filters only use the title?** The API's lists contain only code, title, status and closing date; filtering on the title avoids spending a detail call on every non-matching tender. Use broad keywords (several, comma-separated).

**How fast is it?** Lists come back in one call per day. Full details take one call each: with your own ticket several per second; with the demo ticket about one per second.

**Can I get Compra Ágil quotation requests (before the order)?** Purchase-order mode with `orderTypes: ["AG"]` gives the resulting orders. For the open quotation requests themselves, use our separate Compra Ágil Scraper.

### Use cases

- B2G sales teams: daily feed of new tenders in your category and region straight into a CRM or Slack.
- Market intelligence: who wins which contracts, at what unit prices, for which buyers.
- Consultants and journalists: spending analysis by buyer, supplier, region or product (UNSPSC).
- Data/AI teams: structured Chilean public-sector demand data for models and dashboards.

### En español

**Scraper de Mercado Público (ChileCompra)**: obtén las **licitaciones** abiertas hoy (≈5.000), con organismo comprador, región, fechas de cierre, monto estimado, productos (código ONU/UNSPSC y cantidades) y, cuando se adjudican, **los proveedores adjudicados con su RUT y montos**. También descarga **órdenes de compra** (Compra Ágil, Convenio Marco, Trato Directo…) con comprador, proveedor y totales.

- Usa la **API oficial** de ChileCompra: rápido, estable y sin login.
- Filtros: estado, rango de fechas, palabras clave en el título, organismo comprador, región, RUT de proveedor y tipo de orden.
- **Ticket gratuito**: pídelo en https://www.chilecompra.cl/api/ («Pide tu ticket», con ClaveÚnica) y pégalo en el campo del ticket. Sin ticket se usa el ticket de demostración público (más lento).
- Ideal para **proveedores del Estado** que buscan oportunidades de negocio, seguimiento de la competencia y análisis de precios.
- Datos de personas naturales (proveedores persona natural, funcionarios, correos y teléfonos) no se exportan.

# Actor input Schema

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

`tenders` = licitaciones (calls for bids, with award results). `purchaseOrders` = órdenes de compra (actual purchases: buyer, supplier, totals, line items — includes Compra Ágil, Convenio Marco and direct-deal orders).

## `ticket` (type: `string`):

Your own FREE ticket for ChileCompra's official API. Get it in ~2 minutes at https://www.chilecompra.cl/api/ → "Pide tu ticket" → log in with ClaveÚnica → the ticket is e-mailed to you. Leave empty to try the public demo ticket from the API docs: it is shared by everyone, so it is slow (throttled) and may stop working at any time.

## `tenderStatus` (type: `string`):

Tenders mode only. `active` = live snapshot of every tender open for bids right now (dates are ignored, sorted by closing date, latest first). Any other value queries the API day by day over the date range: tenders that were published / closed / awarded / etc. on each day.

## `orderStatus` (type: `string`):

Purchase-orders mode only.

## `dateFrom` (type: `string`):

First day to query (YYYY-MM-DD). The API works per day, so the Actor walks the range day by day, newest day first. Leave empty to use "Last N days". Ignored for tender status `active`.

## `dateTo` (type: `string`):

Last day to query (YYYY-MM-DD). Empty = today (Chile time). Note: tender lists for a day are published by the API after that day ends, so for tenders "today" is usually empty; purchase orders appear in near real time.

## `lastDays` (type: `integer`):

Used only when Date from is empty: query the last N days ending on Date to (or today).

## `keywords` (type: `string`):

Comma-separated keywords matched against the tender / order title, case- and accent-insensitive; an item matches if ANY keyword appears (e.g. `notebook, computador, impresora`). Leave empty for everything.

## `buyer` (type: `string`):

Numeric organisation code (e.g. `7248`) or part of the buyer's official name (e.g. `MUNICIPALIDAD DE SANTIAGO`, `HOSPITAL`). Names are resolved with the API's buyer directory (max 10 matches).

## `regions` (type: `array`):

Keep only items whose buying unit is in these regions. Needs the full record of each item, so it turns on "Fetch full details" automatically.

## `supplierRut` (type: `string`):

Company RUT (e.g. `76.018.705-4`) to get only the tenders where that supplier took part / the orders it received — useful for competitor tracking. Combine with a date range.

## `orderTypes` (type: `array`):

Purchase-orders mode only: keep only these order types (from the order code suffix). Empty = all types.

## `fetchDetails` (type: `boolean`):

One extra API call per tender/order (charged as the `item-details` add-on) to add: description, buyer organisation/unit/RUT/comuna/region, all dates, estimated amount, line items with UNSPSC product codes and quantities, award results with awarded suppliers and amounts (tenders), supplier, totals and line prices (orders). Without it you get only code, title, status and closing date — the API's list format.

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

Stop after this many tenders / orders. About 5,000 tenders are open at any time; a busy weekday has ~1,300 tender events and ~19,000 purchase orders. With the demo ticket, details run at roughly 1 item per second.

## `proxyConfiguration` (type: `object`):

Not needed — the official API answers Apify's servers directly. If it ever starts returning 403 to datacenter IPs, the Actor switches to Chilean residential proxies automatically.

## Actor input object example

```json
{
  "mode": "tenders",
  "tenderStatus": "active",
  "orderStatus": "all",
  "lastDays": 7,
  "keywords": "",
  "buyer": "",
  "regions": [],
  "supplierRut": "",
  "orderTypes": [],
  "fetchDetails": true,
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

All records collected during the run

## `summary` (type: `string`):

Counts, filters used and API errors

# 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 = {
    "mode": "tenders",
    "keywords": "",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabrikit/mercado-publico-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 = {
    "mode": "tenders",
    "keywords": "",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("fabrikit/mercado-publico-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 '{
  "mode": "tenders",
  "keywords": "",
  "maxItems": 50
}' |
apify call fabrikit/mercado-publico-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fabrikit/mercado-publico-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/PgL4XFPM3Zo1DSi7e/builds/cLBxTRiLRWjlFCWr3/openapi.json
