# Mexico CDMX Government Tenders Scraper & Monitor (`abisael/cdmx-active-tender-monitor`) Actor

Find active Mexico City government tenders and export structured procurement data by keyword, agency, deadline, and procedure type.

- **URL**: https://apify.com/abisael/cdmx-active-tender-monitor.md
- **Developed by:** [vladimir ramirez gonzalez](https://apify.com/abisael) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Mexico CDMX Government Tenders Scraper & Monitor

Find active Mexico City government tenders and export structured procurement data for B2G sales, consulting, APIs, dashboards, and AI agents.

### What it does

This Actor monitors public active procurement opportunities from **CDMX Concurso Digital**, the official Mexico City public procurement source used by the current MVP. It returns clean JSON records for active tenders, including tender IDs, titles, agencies, deadlines, procedure types, official detail URLs, and public document links.

The Actor is built for fast discovery: search by keyword, agency, deadline window, and procedure type, then use the dataset in Apify Console, API workflows, spreadsheets, BI tools, or MCP-powered AI agents.

### Who it is for

- **Government suppliers** looking for new Mexico City opportunities.
- **B2G sales teams** building lead lists from public procurement data.
- **Procurement consultants** monitoring deadlines and public calls for clients.
- **IT, security, facilities, construction, and service vendors** tracking relevant bids.
- **Developers and AI agents** that need a public procurement API for CDMX tenders.

### What data it returns

Each dataset item contains:

- `tenderId` — stable ID decoded from the official public detail URL
- `title` and `description` — official procedure text when available
- `agency` — publishing CDMX entity
- `procedureType` and `procurementMethod`
- `character` — national/international scope when available
- `publicationDate` and `deadline`
- `documents` — public document URLs, not downloaded files
- `sourceUrl` — official public detail page
- `scrapedAt` — UTC timestamp of the run
- optional `changeType` when change detection is enabled

### How much it costs

Monetization is **not active yet** in this pre-publish build.

Recommended launch pricing for human review:

- **Pay-per-event model** for AI/MCP compatibility.
- `apify-actor-start`: **$0.01 per run**.
- `apify-default-dataset-item`: **$0.00010 per result** (**$0.10 per 1,000 tender records**).

Based on measured cloud test cost of about **$0.00025 per run**, this keeps early user costs low while covering platform usage. The final price shown by Apify should always be reviewed before publishing.

### Example input

Find IT / systems opportunities:

```json
{
  "keyword": "sistemas",
  "maxItems": 100
}
```

Get all active CDMX tenders:

```json
{
  "maxItems": 100
}
```

Filter by agency:

```json
{
  "agency": "SISTEMA DE AGUAS",
  "maxItems": 100
}
```

Find opportunities closing soon:

```json
{
  "deadlineAfter": "2026-08-13",
  "deadlineBefore": "2026-08-20",
  "maxItems": 100
}
```

### Example output

```json
{
  "tenderId": "6217",
  "title": "SUMINISTRO E INSTALACIÓN PARA LA IMPLEMENTACIÓN POR CONTRATO ABIERTO DE 150 NUEVOS SISTEMAS TECNOLÓGICOS DE VIDEOVIGILANCIA CON POSTES DE 9 METROS PARA EL CENTRO DE COMANDO, CONTROL, CÓMPUTO, COMUNICACIONES Y CONTACTO CIUDADANO DE LA CIUDAD DE MÉXICO C5",
  "agency": "CENTRO DE COMANDO, CONTROL, CÓMPUTO, COMUNICACIONES Y CONTACTO CIUDADANO",
  "deadline": "2026-08-26T10:00:00",
  "procedureType": "Prestación de Servicios",
  "documents": [
    {
      "name": "Bases de licitación",
      "url": "https://concursodigital.finanzas.cdmx.gob.mx/storage/oportunidades/BaseAnexo_7082/base_licitacion.pdf"
    },
    {
      "name": "Anexo Técnico",
      "url": "https://concursodigital.finanzas.cdmx.gob.mx/storage/oportunidades/BaseAnexo_7082/anexo_tecnico.pdf"
    },
    {
      "name": "Otros anexos o documentos",
      "url": "https://concursodigital.finanzas.cdmx.gob.mx/storage/oportunidades/BaseAnexo_7082/otros_anexos.pdf"
    }
  ],
  "sourceUrl": "https://concursodigital.finanzas.cdmx.gob.mx/proveedores/detalle_convocatoria/NjIxNw=="
}
```

### Search examples

#### Software / IT

```json
{ "keyword": "sistemas", "maxItems": 100 }
```

#### Services / maintenance-style opportunities

```json
{ "keyword": "servicio", "maxItems": 100 }
```

Try related Spanish terms depending on the market you serve, such as `mantenimiento`, `vehículos`, `seguridad`, `software`, `equipo`, `material`, or `obra`.

#### Specific agency

```json
{ "agency": "SISTEMA DE AGUAS", "maxItems": 100 }
```

#### Deadline window

```json
{
  "deadlineAfter": "2026-08-13",
  "deadlineBefore": "2026-08-20",
  "maxItems": 100
}
```

### Input fields

| Field | Type | Description |
| --- | --- | --- |
| `keyword` | string | Case-insensitive and accent-tolerant search across title, description, agency, procedure type, procurement method, and character. |
| `agency` | string | Partial CDMX agency/entity name. |
| `deadlineBefore` | string | Latest proposal deadline date, `YYYY-MM-DD`. |
| `deadlineAfter` | string | Earliest proposal deadline date, `YYYY-MM-DD`. |
| `procedureType` | string | Partial procedure type, for example `Adquisición de Bienes`. |
| `maxItems` | integer | Maximum records emitted, from `1` to `1000`. |
| `detectChanges` | boolean | Adds `changeType` by comparing with the previous snapshot for the same filters. |
| `includeDetails` | boolean | Opens public detail pages to add descriptions and document URLs. |

### Data source and important disclaimers

Source: [CDMX Concurso Digital](https://concursodigital.finanzas.cdmx.gob.mx/convocatorias_publicas)

- This Actor uses public web pages from an official CDMX procurement source.
- This Actor is **not affiliated with, endorsed by, or operated by the Government of Mexico or the Government of Mexico City**.
- Users should always verify official documents and source pages before making business decisions.
- The Actor does **not** guarantee tender eligibility, award probability, contract value, or procurement outcomes.
- Data availability, field completeness, deadlines, and document URLs depend on the official source.
- Missing official fields are returned as `null`; data is not invented.
- Tender documents are not downloaded by default; only public URLs are returned.

### API and automation usage

Read results from the default dataset:

```text
{{links.apiDefaultDatasetUrl}}/items
```

Read the run summary from the default key-value store:

```text
{{links.apiDefaultKeyValueStoreUrl}}/records/OUTPUT
```

The output schema and dataset schema are structured for API clients, spreadsheets, dashboards, and AI agents.

### MCP / AI agent usage

Suggested agent prompt:

> Find active Mexico City government tenders related to software that close in the next 30 days.

The Actor is designed for agentic discovery once it is public and configured with pay-per-event pricing:

- predictable camelCase fields
- structured output schema
- default dataset results
- public source URLs
- no full-account permissions required
- no browser, CAPTCHA, login, proxy, or private data collection

### Current cloud validation

Most recent private cloud validation:

- Build: `0.1.5`
- All active tenders: `8` results
- `keyword = sistemas`: `1` result
- Measured cloud cost: about `$0.0003697` / `$0.0002466` USD per run
- Local tests: 33 passing

### Limitations

- Current MVP covers CDMX Concurso Digital only.
- The source is public server-rendered HTML, not a documented JSON API.
- Active listing volume can be low depending on the official source.
- Amount/budget is not currently available in normalized fields.
- Some official fields may be blank on the source page and are returned as `null`.
- Change detection requires persistent Apify Key-Value Store state across runs.

### Roadmap

CDMX → federal Mexico → other states → awarded contracts → vendor/award intelligence.

Planned improvements:

- ComprasMX and federal procurement sources.
- Other Mexican state procurement portals.
- Historical awarded contract data.
- Supplier/vendor intelligence.
- Optional document text extraction and classification.
- Alerts for newly published tenders.

### Local development

```powershell
$env:PYTHONPATH=(Resolve-Path ".").Path
python -m src.main
python -m unittest discover -s tests -v
```

No Apify billing setup, card, paid API, browser runtime, proxies, or private accounts are required for local testing.

# Actor input Schema

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

Optional keyword searched across title, description, agency, contract type and method. Matching is case-insensitive and accent-tolerant.

## `agency` (type: `string`):

Optional partial name of the CDMX agency or public entity, for example SISTEMA DE AGUAS or SECRETARÍA DE MOVILIDAD.

## `deadlineBefore` (type: `string`):

Optional latest proposal deadline date in YYYY-MM-DD format. The full selected day is included.

## `deadlineAfter` (type: `string`):

Optional earliest proposal deadline date in YYYY-MM-DD format.

## `procedureType` (type: `string`):

Optional contract type filter. You can select a common value or enter a partial custom value.

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

Maximum number of tenders to return after filters are applied.

## `detectChanges` (type: `boolean`):

Compare this run with the previous snapshot for the same filter set and add changeType to each item.

## `includeDetails` (type: `boolean`):

Open each public detail page to enrich results with description and document URLs. Documents are not downloaded.

## Actor input object example

```json
{
  "keyword": "software",
  "agency": "SISTEMA DE AGUAS",
  "maxItems": 100,
  "detectChanges": false,
  "includeDetails": true
}
```

# Actor output Schema

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

Structured tender items stored in the default dataset.

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

Input, metrics and optional change-detection summary.

# 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 = {
    "keyword": "software",
    "agency": "SISTEMA DE AGUAS"
};

// Run the Actor and wait for it to finish
const run = await client.actor("abisael/cdmx-active-tender-monitor").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 = {
    "keyword": "software",
    "agency": "SISTEMA DE AGUAS",
}

# Run the Actor and wait for it to finish
run = client.actor("abisael/cdmx-active-tender-monitor").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 '{
  "keyword": "software",
  "agency": "SISTEMA DE AGUAS"
}' |
apify call abisael/cdmx-active-tender-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,abisael/cdmx-active-tender-monitor"
        }
    }
}

```

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/jh4RHYvCckQREfVFG/builds/sYsQRX5DeHqEtkai7/openapi.json
