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:
- SECOP II – Contratos Electrónicos (
jbjy-vk9h): signed contracts, with agency, purpose, procurement method, values, dates and supplier. - SECOP II – Procesos de Contratación (
p6dx-8zbt): published processes, with phase, status, base price, bid deadline and a link to the process.
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 -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
datasetparameter to choose betweencontratos(contracts) andprocesos(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
| Parameter | What it does |
|---|---|
dataset | contratos (default) or procesos |
query | Free text, for example software or interventoría vial |
entity / entityNit | Part of the buying agency's name or its NIT (digits only, no check digit) |
supplierNit | NIT of the awarded supplier (digits only) |
department | The agency's department, for example Antioquia or Bogotá |
fromDate / toDate | YYYY-MM-DD dates: contract signing or process publication |
minValue | Minimum value in Colombian pesos (contract value or base price) |
status | Status, partial match: En ejecución, terminado, Publicado, Adjudicado… |
maxItems / offset | Results 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 -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:
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.
{
"mcpServers": {
"better-llama": {
"url": "https://mcp.betterllama.com/mcp"
}
}
}claude mcp add --transport http better-llama https://mcp.betterllama.com/mcpSetup 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:
{
"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
- Chile open data APIs: official sources by API and MCP — map of the official Chilean sources available by API and MCP, how to find the tool with search_tools, one real call per family and an index of every guide.
- Chile public procurement API: Mercado Público tenders and purchase orders — ChileCompra ticket, curl and Python examples, and MCP usage.
- Chile economic indicators API: UF, dollar, euro, CPI and TPM — One real call per indicator (UF, dollar, euro, UTM, CPI, TMC, TIP, TPM, Imacec, GDP, unemployment and real exchange rate), from the CMF or the Central Bank, with curl, Python, JavaScript and MCP.
- Chile fuel prices API: gasoline 93, 95, 97, diesel and LPG from Bencina en Línea — CNE data with no sign-up, the cheapest by comuna or near a point, curl, Python and JavaScript examples, and MCP usage.
- Chilexpress API: coverage by comuna, shipping quotes and tracking — covered comunas and sectors with their code and no key, names that differ from the official ones, quotes and tracking with your free keys, and MCP usage.
- Chile earthquakes API: latest quake, magnitude, depth and alerts — Public-domain USGS data with Chile local time, no USGS key, curl and Python examples, and MCP usage.
- Peru BCRP API: exchange rate, inflation and rates — BCRPData series with no key, curl and Python examples, and MCP usage.
- Colombia TRM API: today's TRM and the COP/USD rate — Superintendencia Financiera data via datos.gov.co with no key, curl and Python examples, and MCP usage.
- Chile public holidays API: 2026 holidays, business days and RUT — National, regional and local holidays with no key, curl and Python examples, and MCP usage.
- Chile Official Gazette API: laws, decrees and new companies — Laws, decrees, notices and company incorporations with CVE and official PDF, no key, curl and Python examples, and MCP usage.
- Banxico API: Mexico's FIX exchange rate, UDIS and TIIE — Banco de México SIE indicators with no token to request, curl and Python examples, and MCP usage.
- Chile electricity market API: marginal cost, generation and demand — Coordinador Eléctrico Nacional grid data with no user_key to request, curl and Python examples, and MCP usage.
- Chile CMF API: UF value, dollar, UTM and maximum conventional rate — the seven API CMF Bancos series with no API key to request, curl and Python examples, and MCP usage.
- Chile USD/CLP exchange rate API: the observed dollar as JSON — today's rate, daily series by month, range or year and the warning for values published in advance, with CMF data, curl, Python and JavaScript examples, and MCP usage.
- Chile UF API: the Unidad de Fomento value as JSON — today's UF, full month, next month's days already published, range or year, with CMF data and a Central Bank cross-check, curl, Python and JavaScript examples, and MCP usage.
- Central Bank of Chile API: BDE series as JSON — dollar, UF, policy rate, CPI, Imacec, GDP, unemployment and any series by code, series search, curl, Python and JavaScript examples, and MCP usage.
- Chile RUT validation API: check digit as JSON — the modulo 11 algorithm, accepted formats, computing the check digit, batches and privacy, curl, Python and JavaScript examples, and MCP usage.
- Chile communes API: regions, provinces and CUT codes — all 346 communes with CUT codes, region filters, name search, curl, Python and JavaScript examples, and MCP usage.
- Chile business days API: deadlines and business-day counts — business-day deadlines from a notice date, Saturdays as business days, calendar days, business days per month, regional holidays and edge cases, with curl, Python and JavaScript, and MCP usage.
This guide is also available en español.