# Colombia SECOP II - Licitaciones y Contratación Pública Scraper (`teslagp/secop-ii-licitaciones-scraper`) Actor

Extrae licitaciones y procesos de contratación pública abiertos de Colombia (SECOP II) desde la API de Datos Abiertos. Filtra por entidad, departamento, cuantía, fechas, estado y modalidad.

- **URL**: https://apify.com/teslagp/secop-ii-licitaciones-scraper.md
- **Developed by:** [Juan Galeano Patiño](https://apify.com/teslagp) (community)
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $10.00 / 1,000 licitaciones

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

## Colombia SECOP II - Licitaciones y Contratación Pública Scraper

Extrae procesos contractuales y licitaciones públicas abiertas de Colombia desde la API oficial de Datos Abiertos (SECOP II), de forma rápida, estructurada y sin bloqueos.

A diferencia de otros scrapers que usan navegadores headless y lidian con CAPTCHAs, este Actor consulta directamente la API REST de Socrata (`p6dx-8zbt`), lo que resulta en tiempos de respuesta de menos de 2 segundos por corrida.

***

### Características principales

- **Filtros avanzados por SoQL**: palabras clave, entidad, NIT, departamento, estado, fase, modalidad y tipo de contrato.
- **Filtrado financiero y temporal**: rangos de cuantía (`precio_base`), fechas de publicación y paginación automática.
- **Rápido y liviano**: consulta directa a la API de Datos Abiertos. Sin navegadores, sin CAPTCHA, sin consumo innecesario de RAM.
- **Datos normalizados**: montos numéricos, fechas en formato `YYYY-MM-DD`, y enlaces directos a cada proceso en SECOP II.

***

### Casos de uso

- Empresas y contratistas que necesitan detectar oportunidades de licitación a tiempo.
- Firmas de ingeniería, consultoría y proveedores del Estado que monitorean sectores específicos.
- Analistas que rastrean la contratación pública por región, entidad o presupuesto.
- Integradores que alimentan CRMs o tableros con oportunidades activas.

***

### Parámetros de Entrada (Input)

| Campo | Tipo | Descripción | Ejemplo |
| :--- | :--- | :--- | :--- |
| `keywords` | Array | Palabras clave en el nombre o descripción del proceso | `["software", "computadores"]` |
| `entidad` | String | Nombre parcial o NIT de la entidad pública | `"Alcaldía"` o `"899999027"` |
| `departamento` | String | Departamento de la entidad contratante | `"Antioquia"` |
| `estado` | String | Estado del procedimiento. Valores válidos: `Abierto`, `Aprobado`, `Borrador`, `Cancelado`, `En aprobación`, `Evaluación`, `Publicado`, `Seleccionado`, `Suspendido` | `"Publicado"` |
| `fase` | String | Fase actual del procedimiento | `"Presentación de oferta"` |
| `modalidad` | String | Modalidad de contratación | `"Licitación pública"` |
| `tipo_de_contrato` | String | Tipo de contrato | `"Prestación de servicios"` |
| `precio_min` | Integer | Presupuesto mínimo en COP | `10000000` |
| `precio_max` | Integer | Presupuesto máximo en COP | `500000000` |
| `fecha_desde` | String | Fecha mínima de publicación (`YYYY-MM-DD`) | `"2026-01-01"` |
| `fecha_hasta` | String | Fecha máxima de publicación (`YYYY-MM-DD`) | `"2026-12-31"` |
| `maxItems` | Integer | Límite de procesos a extraer (default: 100, máx: 10000) | `500` |
| `appToken` | String | Socrata App Token opcional para mitigar rate limits | `"abc123..."` |

***

### Datos de Salida (Output)

Cada resultado guardado en el Dataset contiene 25 campos normalizados:

```json
{
  "id_proceso": "CO1.REQ.10564862",
  "referencia": "RE-005-2026",
  "entidad": "INSTITUCION EDUCATIVA DE LA VENTURA",
  "nit_entidad": "806014617",
  "departamento": "Bolívar",
  "ciudad": "Tiquisio",
  "orden_entidad": "Territorial",
  "nombre_procedimiento": "LICENCIA DE USO SOFTWARE CONTABLE...",
  "descripcion": "LICENCIA DE USO SOFTWARE CONTABLE, FINANCIERO Y PRESUPUESTAL...",
  "fase": "Presentación de oferta",
  "estado": "Publicado",
  "precio_base": 3000000.0,
  "modalidad": "Contratación régimen especial",
  "tipo_contrato": "Compraventa",
  "duracion": 8,
  "unidad_duracion": "Mes(es)",
  "fecha_publicacion": "2026-09-16",
  "fecha_ultima_actualizacion": "2026-09-16",
  "id_portafolio": "CO1.BDOS.10383757",
  "categoria_unspsc": "V1.81112501",
  "estado_apertura": "Abierto",
  "adjudicado": "No",
  "nombre_proveedor": "No Definido",
  "valor_adjudicado": "0",
  "codigo_entidad": "718955438",
  "url_secop": "https://community.secop.gov.co/Public/Tendering/OpportunityDetail/Index?noticeUID=CO1.NTC.10906260"
}
```

Ejemplo de uso

Extraer las licitaciones abiertas de software publicadas en 2026 con presupuesto mayor a 50 millones de COP:

```json
{
  "keywords": ["software"],
  "estado": "Publicado",
  "precio_min": 50000000,
  "fecha_desde": "2026-01-01",
  "maxItems": 100
}
```

Fuente de datos

Datos Abiertos Colombia - Procesos de Contratación (SECOP II)
Dataset: p6dx-8zbt
Endpoint: https://www.datos.gov.co/resource/p6dx-8zbt.json

# Actor input Schema

## `keywords` (type: `array`):

Términos a buscar en el nombre o descripción del proceso. La búsqueda será case-insensitive usando UPPER() + LIKE en SoQL. Ej: 'software', 'interventoría', 'alimentación'.

## `entidad` (type: `string`):

Filtro por nombre parcial de la entidad o su NIT exacto. Case-insensitive.

## `departamento` (type: `string`):

Departamento de la entidad contratante. Ej: 'Bogotá D.C.', 'Antioquia', 'Valle del Cauca'.

## `estado` (type: `string`):

Estado actual del procedimiento. Ejemplos: 'Presentación de ofertas', 'En evaluación', 'Adjudicado', 'Desierto', 'Cancelado'. Vacío = todos.

## `fase` (type: `string`):

Fase actual del procedimiento. Ejemplos: 'Planeación', 'Selección', 'Contratación'. Vacío = todas.

## `modalidad` (type: `string`):

Modalidad del proceso contractual. Ejemplos: 'Licitación pública', 'Selección abreviada menor cuantía', 'Contratación directa', 'Mínima cuantía'. Vacío = todas.

## `precio_min` (type: `number`):

Valor mínimo estimado del contrato en pesos colombianos (COP).

## `precio_max` (type: `number`):

Valor máximo estimado del contrato en pesos colombianos (COP).

## `fecha_desde` (type: `string`):

Fecha inicial de publicación del proceso en formato YYYY-MM-DD.

## `fecha_hasta` (type: `string`):

Fecha final de publicación del proceso en formato YYYY-MM-DD.

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

Máximo de procesos a extraer. Socrata limita a 1000 por petición; el Actor paginará automáticamente con $offset.

## `appToken` (type: `string`):

Token de Datos.gov.co (App Token) para mitigar rate limits en extracciones masivas.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "maxItems": 100
}
```

# Actor output Schema

## `results` (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 = {
    "keywords": [
        "software"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("teslagp/secop-ii-licitaciones-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 = { "keywords": ["software"] }

# Run the Actor and wait for it to finish
run = client.actor("teslagp/secop-ii-licitaciones-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 '{
  "keywords": [
    "software"
  ]
}' |
apify call teslagp/secop-ii-licitaciones-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,teslagp/secop-ii-licitaciones-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/TlCMsHkmhH9V8M5Ax/builds/ed7XYkKY6RmSeSTP9/openapi.json
