# ComprasMX Mexico Procurement Scraper (`publicmoney/comprasmx-mexico-scraper`) Actor

Extract Mexican federal procurement from ComprasMX (the successor to CompraNet): current, in-progress and concluded procedures with buyer, law, procedure type, dates, contract terms and the procedure page link.

- **URL**: https://apify.com/publicmoney/comprasmx-mexico-scraper.md
- **Developed by:** [Public Money](https://apify.com/publicmoney) (Apify)
- **Categories:** Business
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.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.
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

This Actor reads **ComprasMX**, Mexico's federal procurement platform (the successor to CompraNet), and returns one record per procurement procedure — current, in progress or concluded — with the buyer, law, procedure and contract type, key dates and, when you ask for it, the full procedure record.

### What it does

- Returns **one record per procedure**, newest first: 687 current, 1,772 in progress and 377,287 concluded when this was verified.
- **Filters at the source**: tab (current / in progress / concluded), procedure name, procedure number, case code, publication-date and opening-date ranges.
- Reads each procedure's **record**: description, law, agency and sector, publication, award-act and estimated contract dates, budget year, currency and everything else ComprasMX returns.
- Handles the request signing the ComprasMX site uses on every call; nothing to configure.

### Use cases

| You need to | How this Actor does it |
| --- | --- |
| Find Mexican federal tenders | Current tab, a keyword, read opening date |
| Track what an agency buys | Concluded tab, group by `agency` |
| Build procurement history | Concluded tab with a publication-date range |
| Watch new procedures | Current tab with `publishedFrom` set to yesterday, scheduled |

### Input

| Field | Type | Default | What it controls |
| --- | --- | --- | --- |
| `status` | string | `current` | `current`, `in_progress`, `concluded` |
| `keyword` | string | empty | Inside the procedure name |
| `procedureNumber` / `caseCode` | string | empty | Exact identifiers |
| `publishedFrom` / `publishedTo` | date | empty | Publication-date range |
| `openingFrom` / `openingTo` | date | empty | Proposal-opening range |
| `fetchDetails` | boolean | `true` | Full procedure record |
| `maxItems` | integer | `500` | Caps how many procedures are returned, and so the cost |

```json
{
    "status": "current",
    "keyword": "mantenimiento",
    "maxItems": 100
}
```

### Output

```json
{
    "procedureNumber": "IO-89-L47-830124970-N-14-2026",
    "caseCode": "E-2026-00109023",
    "name": "REHABILITACION DE REVESTIMIENTO DE LAS CALLES …",
    "status": "VIGENTE",
    "procedureType": "INVITACIÓN A CUANDO MENOS TRES PERSONAS",
    "contractType": "OBRA PÚBLICA",
    "law": "LEY DE OBRAS PÚBLICAS Y SERVICIOS RELACIONADOS CON LAS MISMAS",
    "agency": "PAPANTLA",
    "state": "VERACRUZ",
    "publicationDate": "2026-10-02T23:05:06",
    "openingDate": "2026-10-15T15:00:00",
    "awardActDate": "2026-10-20T09:00:00",
    "procedureUrl": "https://comprasmx.buengobierno.gob.mx/sitiopublico/#/sitiopublico/detalle/b38a0fb2fc094b22994c452f9459e03b/procedimiento"
}
```

### Coverage and limits

- ComprasMX's procedure list carries no contract amounts or winners; the full record is in `detail` as published.
- Dates are as ComprasMX publishes them, without a time-zone offset.

### Pricing

Pay per event: one `tender-scraper` event per procedure written to the dataset. The optional schema.org block is charged once per run.

# Actor input Schema

## `status` (type: `string`):

The site's three tabs. When verified: current 687, in progress 1,772, concluded 377,287.

## `keyword` (type: `string`):

Matched inside the procedure name by ComprasMX. Example: 'mantenimiento' (49 current when verified).

## `procedureNumber` (type: `string`):

e.g. 'LA-81-017-822016996-N-6-2026'.

## `caseCode` (type: `string`):

e.g. 'E-2026-00103620'.

## `publishedFrom` (type: `string`):

Procedures published on or after this date (YYYY-MM-DD). September 2026 had 554 current when verified.

## `publishedTo` (type: `string`):

Procedures published on or before this date (YYYY-MM-DD).

## `openingFrom` (type: `string`):

Proposal-opening date on or after this date (YYYY-MM-DD).

## `openingTo` (type: `string`):

Proposal-opening date on or before this date (YYYY-MM-DD).

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

Reads each procedure's record: description, law, agency and sector, publication, award-act and estimated contract dates, budget year, currency and the full detail as published.

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

Caps how many procedures are written to the dataset, and so caps the cost. Set to 0 for everything matched.

## `schemaOrg` (type: `boolean`):

Appends a `schemaOrg` object to every record, mapping it to schema.org (Demand). Charged once per run, not per record.

## Actor input object example

```json
{
  "status": "current",
  "fetchDetails": true,
  "maxItems": 500,
  "schemaOrg": false
}
```

# Actor output Schema

## `results` (type: `string`):

Projects matched by the run, one item per record, in the default dataset.

# 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": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicmoney/comprasmx-mexico-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": 500 }

# Run the Actor and wait for it to finish
run = client.actor("publicmoney/comprasmx-mexico-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": 500
}' |
apify call publicmoney/comprasmx-mexico-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,publicmoney/comprasmx-mexico-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/degd0uoGHgX8ybi5P/builds/cmIEMRxr6oyJwT17E/openapi.json
