Guide · Public procurement in Colombia

SECOP II API: how to query Colombia's public procurement contracts and processes

How to get SECOP II open data from your code or an AI agent: which datasets datos.gov.co publishes, how to query them directly, and how to receive contracts and processes as compact JSON with Better Llama's MCP tool, with no key.

What is SECOP II and what open data does it publish?

SECOP II (Sistema Electrónico de Contratación Pública) is Colombia's electronic public procurement system, run by the national public procurement agency, Agencia Nacional de Contratación Pública – Colombia Compra Eficiente. Government entities use it to publish their procurement processes and manage their contracts.

That information is published as open data on the datos.gov.co Open Data Portal under the CC BY-SA 4.0 license. The two most useful datasets are:

With this data you can build alerts for new processes, see what each agency buys, follow competitors by NIT (tax ID) or let an AI agent look for business opportunities for you.

Two ways to access the SECOP API

1. The datos.gov.co open data API

Every datos.gov.co dataset has a public JSON endpoint (Socrata SODA API) that accepts SoQL queries: $select, $where, $q (free text), $order and $limit. No key is required; Socrata recommends a free app token if you make many requests. For example, supervision (interventoría) processes published in Bogotá since November 1:

curl · datos.gov.co
curl -s -G "https://www.datos.gov.co/resource/p6dx-8zbt.json" \
  --data-urlencode "\$select=id_del_proceso,entidad,nombre_del_procedimiento,precio_base,fecha_de_publicacion_del" \
  --data-urlencode "\$where=departamento_entidad='Distrito Capital de Bogotá' AND fecha_de_publicacion_del >= '2026-11-01'" \
  --data-urlencode "\$q=interventoría" \
  --data-urlencode "\$order=fecha_de_publicacion_del DESC" \
  --data-urlencode "\$limit=5"

The integration is on your side: knowing the column names (for example, fecha_de_publicacion_del), converting amounts that arrive as text, paging, and deciding what to do with columns that can identify natural persons, such as the supplier's or awarding official's name.

2. Better Llama's SECOP II tool (over MCP)

Our Colombian public contracts (SECOP II) tool, colombia_secop_search, queries those same datos.gov.co datasets and returns the result ready to use:

  • A single dataset parameter to choose between contratos (contracts) and procesos (processes), with the same filters for both.
  • Filters by free text, buying agency (name or NIT), supplier NIT, department, date range, minimum value in pesos and status.
  • Compact JSON: agency and supplier grouped, COP values as numbers, dates, procurement method and a link to the process on SECOP.
  • Every response includes sourceUpdatedAt, the dataset's last update date on datos.gov.co, and the license attribution.
  • It does not return legal representatives, officials, bank accounts, or names or ID numbers of suppliers who are natural persons.

Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.

Step by step: search SECOP II contracts and processes

Step 1. Choose the dataset

Use contratos for contracts already signed (filtered by signing date) or procesos for published processes, for example to find open calls for bids (filtered by publication date).

Step 2. Connect the MCP server

Use the MCP https://mcp.betterllama.com/mcp in your client or call it over HTTP with JSON-RPC, as in the examples. This tool needs no key, and no account or sign-up is needed during the beta.

Step 3. Set your query

ParameterWhat it does
datasetcontratos (default) or procesos
queryFree text, for example software or interventoría vial
entity / entityNitPart of the buying agency's name or its NIT (digits only, no check digit)
supplierNitNIT of the awarded supplier (digits only)
departmentThe agency's department, for example Antioquia or Bogotá
fromDate / toDateYYYY-MM-DD dates: contract signing or process publication
minValueMinimum value in Colombian pesos (contract value or base price)
statusStatus, partial match: En ejecución, terminado, Publicado, Adjudicado…
maxItems / offsetResults per call (1 to 50, default 10) and how many to skip when paging

Results come newest first. If there are more, the response says so in warnings, with the offset for the next page.

Step 4. Call the tool with curl

A JSON-RPC POST returns the result as JSON. This call searches supervision processes in Bogotá:

curl
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "colombia_secop_search", "arguments": {"dataset": "procesos", "query": "interventoría", "department": "Bogotá", "maxItems": 3}}}'

The same in Python

Software contracts signed in Antioquia since November 1:

python
import json
import requests

URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}
arguments = {
    "dataset": "contratos",
    "query": "software",
    "department": "Antioquia",
    "fromDate": "2026-11-01",
    "maxItems": 10
}
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
        "params": {"name": "colombia_secop_search", "arguments": arguments}}
resp = requests.post(URL, json=body, headers=HEADERS, timeout=60)
resp.raise_for_status()
data = json.loads(resp.json()["result"]["content"][0]["text"])
for item in data["results"]:
    print(item["id_contrato"], item["entidad"]["nombre"], item["valor_contrato"], item["fecha_firma"])
print("Updated:", data["sourceUpdatedAt"])

From JavaScript or any other language, a POST with the same JSON-RPC body is enough (for example, with fetch).

Use the SECOP II API from an AI agent (MCP)

Add the Better Llama MCP server to your client (Claude, Cursor, VS Code or any other client with remote MCP). One MCP brings colombia_secop_search and the rest of the catalog, with no sign-up during the beta.

Cursor · mcp.json
{
  "mcpServers": {
    "better-llama": {
      "url": "https://mcp.betterllama.com/mcp"
    }
  }
}
Claude Code
claude mcp add --transport http better-llama https://mcp.betterllama.com/mcp

Setup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.

Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.

Then ask, for example: “Find SECOP II processes published this week in Antioquia about software and give me the agency, base price, bid deadline and link.”

Beta: free and with no sign-up while we test the service.

Which fields it returns

Field names are in Spanish, as in the source. For contratos, each result includes, among others: id_contrato, referencia, proceso, estado, objeto, tipo_contrato, modalidad, entidad (name, NIT, department, city, level, sector), proveedor, valor_contrato, valor_pagado, fecha_firma, fecha_fin and duracion. For procesos: id_proceso, nombre, fase, estado, modalidad, precio_base, fecha_publicacion, fecha_recepcion_ofertas, adjudicado and url.

If the supplier is a natural person, their name and ID number are omitted: proveedor only states tipo_persona.

Real response to the curl call above (November 19, 2026, 20:19 Chile time), trimmed to 1 of 3 results and without the descripcion field:

json
{
  "tool": "colombia_secop_search",
  "count": 3,
  "results": [
    {
      "tipo_registro": "proceso",
      "id_proceso": "CO1.REQ.11332186",
      "referencia": "IDPC-CMA-004-2026",
      "nombre": "Interventoría e iluminación Plaza Bolívar",
      "fase": "Presentación de observaciones",
      "estado": "Publicado",
      "estado_apertura": "Abierto",
      "modalidad": "Concurso de méritos abierto",
      "tipo_contrato": "Interventoría",
      "entidad": {
        "nombre": "INSTITUTO DISTRITAL DE PATRIMONIO CULTURAL",
        "nit": "860506170",
        "departamento": "Distrito Capital de Bogotá",
        "ciudad": "Bogotá",
        "orden": "Territorial"
      },
      "moneda": "COP",
      "precio_base": 691929130,
      "duracion": "9 Mes(es)",
      "fecha_publicacion": "2026-11-17T21:06:11.576",
      "fecha_recepcion_ofertas": "2026-12-09T10:00:00.000",
      "adjudicado": "No",
      "respuestas": 0,
      "url": "https://community.secop.gov.co/Public/Tendering/OpportunityDetail/Index?noticeUID=CO1.NTC.11240793"
    }
  ],
  "attribution": "Fuente: Portal de Datos Abiertos www.datos.gov.co — SECOP II (Agencia Nacional de Contratación Pública – Colombia Compra Eficiente). Licencia CC BY-SA 4.0. La fecha de última actualización del conjunto viene en sourceUpdatedAt.",
  "sourceUpdatedAt": "2026-11-19T09:23:58.000Z",
  "retrievedAt": "2026-11-19T23:19:22.277Z"
}

If you reuse the data, cite «Fuente: Portal de Datos Abiertos www.datos.gov.co» with the sourceUpdatedAt date and share derived works under the same license (CC BY-SA 4.0).

Price

Free during the beta, with no sign-up and a limit of 60 requests per minute per IP. If paid plans come later, we will announce them on betterllama.com first. This tool needs no key.

Frequently asked questions

Does SECOP II have an API?

Yes. SECOP II data is published as open data on datos.gov.co, and every dataset has a public JSON endpoint (Socrata SODA API) queried with SoQL. The most used are SECOP II Contratos Electrónicos (jbjy-vk9h) and SECOP II Procesos de Contratación (p6dx-8zbt). Better Llama's colombia_secop_search tool queries those datasets and returns compact JSON over MCP.

Do I need a key or token for the SECOP API?

No. Better Llama's tool needs no key and is free during the beta, with a limit of 60 requests per minute per IP. If you query datos.gov.co directly you don't need a key either, although Socrata recommends a free app token for heavy use.

What is the difference between contracts and processes?

Contracts (SECOP II Contratos Electrónicos) are contracts already signed, with supplier, value and signing and end dates. Processes (SECOP II Procesos de Contratación) are the processes published by agencies, with phase, status, base price and bid deadline; use them to find open calls for bids.

How up to date is the data?

It depends on publication on datos.gov.co. Every response includes sourceUpdatedAt, the dataset's last update date on the portal, and retrievedAt, the time of the query. Responses may be served from cache for up to 30 minutes.

Does Better Llama's API return personal data?

It does not return legal representatives, officials, bank accounts, or names or ID numbers of suppliers who are natural persons. In those cases the supplier appears only as a natural person, with name and ID omitted.

Can I use the SECOP API from Claude, Cursor or another AI agent?

Yes. Add the Better Llama MCP server (https://mcp.betterllama.com/mcp) to your client and the agent can use colombia_secop_search to search contracts and processes in natural language.

Is Better Llama affiliated with Colombia Compra Eficiente?

No. Better Llama is an independent project, not affiliated with, sponsored by or endorsed by Agencia Nacional de Contratación Pública – Colombia Compra Eficiente or datos.gov.co. The data source is the datos.gov.co Open Data Portal, under the CC BY-SA 4.0 license.

Other guides

This guide is also available en español.