Alfil Contratación API

The Contratación API from Alfil — 4 operation(s) for contratación.

Operations 4

GET /v1/contratos Buscar contratos (SECOP) #
GET /v1/contratos/{id} Detalle de contrato #
GET /v1/contratacion/procesos/{id} Proponentes de un proceso de contratación #
GET /v1/contratos/{id}/adiciones Adiciones de un contrato (SECOP II) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/alfil-co:alfil-co-contrataci-n-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

alfil-co-contrataci-n-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Alfil Contratación API
  version: v1
  description: API pública de transparencia política de Alfil. Read-only. Cada respuesta incluye su fuente oficial y fecha de corte. Ver la política de datos personales en ADR-020.
servers:
- url: https://api.alfil.co
security:
- oauth2:
  - buscar:read
tags:
- name: Contratación
paths:
  /v1/contratos:
    get:
      summary: Buscar contratos (SECOP)
      tags:
      - Contratación
      parameters:
      - in: query
        name: cursor
        schema:
          type: string
        description: Cursor de paginación
      - in: query
        name: limit
        schema:
          default: 25
          type: integer
          minimum: 1
          maximum: 100
        description: Máximo de resultados (1-100, default 25)
      - in: query
        name: q
        schema:
          type: string
          minLength: 2
        description: 'Texto libre: objeto, entidad o contratista'
      - in: query
        name: nit
        schema:
          type: string
        description: NIT de la entidad contratante
      - in: query
        name: cedula
        schema:
          type: string
        description: Cédula como filtro de búsqueda (cruce legítimo de control social)
      responses:
        '200':
          description: Contratos en listado (sin cédula)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContratosBuscarResponse'
        '401':
          description: Token faltante, expirado o de emisor inesperado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Scope insuficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Cuota agotada o rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getV1Contratos
      x-operation-id-source: derived
  /v1/contratos/{id}:
    get:
      summary: Detalle de contrato
      description: Incluye la cédula del contratista persona natural en identifier (solo en detalle, ADR-020).
      tags:
      - Contratación
      parameters:
      - in: path
        name: id
        schema:
          type: string
        description: Id del contrato
        required: true
      responses:
        '200':
          description: Detalle de contrato
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contrato'
        '401':
          description: Token faltante, expirado o de emisor inesperado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Scope insuficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Cuota agotada o rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getV1ContratosById
      x-operation-id-source: derived
  /v1/contratacion/procesos/{id}:
    get:
      summary: Proponentes de un proceso de contratación
      description: Ganadores y no ganadores de un proceso — un único proponente se declara explícitamente.
      tags:
      - Contratación
      parameters:
      - in: path
        name: id
        schema:
          type: string
        description: Id del proceso de contratación (SECOP)
        required: true
      responses:
        '200':
          description: Proceso con sus proponentes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcesoContratacion'
        '401':
          description: Token faltante, expirado o de emisor inesperado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Scope insuficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Cuota agotada o rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getV1ContratacionProcesosById
      x-operation-id-source: derived
  /v1/contratos/{id}/adiciones:
    get:
      summary: Adiciones de un contrato (SECOP II)
      description: Modificaciones de valor en orden cronológico, nunca un total corregido.
      tags:
      - Contratación
      parameters:
      - in: path
        name: id
        schema:
          type: string
        description: Id del contrato
        required: true
      responses:
        '200':
          description: Adiciones del contrato
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContratoAdicionesResponse'
        '401':
          description: Token faltante, expirado o de emisor inesperado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Scope insuficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Cuota agotada o rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getV1ContratosByIdAdiciones
      x-operation-id-source: derived
components:
  schemas:
    ContratoAdicionesResponse:
      type: object
      properties:
        id:
          type: string
        adiciones:
          oneOf:
          - type: object
            properties:
              estado_fuente:
                type: string
                const: no_consultado
              registros:
                type: 'null'
              truncado:
                type: 'null'
              corte:
                type: 'null'
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          - type: object
            properties:
              estado_fuente:
                type: string
                const: ok
              registros:
                type: array
                items:
                  $ref: '#/components/schemas/Adicion'
              truncado:
                type: boolean
                description: Si la lista alcanzó el límite de la consulta (posiblemente incompleta)
              corte:
                type: string
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          - type: object
            properties:
              estado_fuente:
                type: string
                const: error
              registros:
                type: 'null'
              truncado:
                type: 'null'
              corte:
                type: 'null'
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          type: object
      required:
      - id
      - adiciones
      additionalProperties: false
      description: Adiciones (modificaciones de valor) de un contrato SECOP II
    Identifier:
      type: object
      properties:
        scheme:
          type: string
          enum:
          - COL-NIT
          - COL-IDCARD
          description: Esquema del identificador (OCDS)
        id:
          type: string
          description: Número de identificación
          example: '18610581'
      required:
      - scheme
      - id
      additionalProperties: false
      description: Identificador de persona o entidad (estándar OCDS)
    Page:
      type: object
      properties:
        cursor:
          anyOf:
          - type: string
          - type: 'null'
          description: Cursor opaco de la siguiente página; null si no hay más
        has_more:
          type: boolean
          description: Indica si existen más resultados
      required:
      - cursor
      - has_more
      additionalProperties: false
      description: Paginación por cursor opaco (no offset)
    Adicion:
      type: object
      properties:
        id:
          type: string
        tipo:
          type: string
        descripcion:
          type: string
          description: Texto libre de la fuente; cualquier valor monetario de la adición vive acá, sin parsear
        fecha_registro:
          type: string
      required:
      - id
      - tipo
      - descripcion
      - fecha_registro
      additionalProperties: false
      description: Adición (modificación de valor) de un contrato SECOP II
    Proponente:
      type: object
      properties:
        nombre:
          type: string
        adjudicado:
          type: boolean
          description: Si este proponente resultó adjudicatario
        calificacion:
          type: string
        fuente:
          type: string
          enum:
          - SECOP I
          - SECOP II
      required:
      - nombre
      - adjudicado
      - calificacion
      - fuente
      additionalProperties: false
      description: Proponente de un proceso de contratación (ganador o no)
    Referencia:
      type: object
      properties:
        tipo:
          type: string
          enum:
          - pagina_alfil
          - registro_oficial
          - documento_oficial
          - coleccion_oficial
        titulo:
          type: string
        url:
          type: string
          pattern: ^[hH][tT][tT][pP][sS]:\/\/[^/?#@]+(?:[/?#].*)?$
          format: uri
        proveedor:
          type: string
        id_externo:
          type: string
      required:
      - tipo
      - titulo
      - url
      - proveedor
      additionalProperties: false
      description: Enlace HTTPS navegable a Alfil o a una fuente oficial
    Contrato:
      type: object
      properties:
        id:
          type: string
        objeto:
          type: string
        entidad:
          type: object
          properties:
            nombre:
              type: string
            nit:
              type: string
          required:
          - nombre
          - nit
          additionalProperties: false
        contratista:
          type: object
          properties:
            nombre:
              type: string
            tipo:
              type: string
              enum:
              - persona_juridica
              - persona_natural
            identifier:
              anyOf:
              - $ref: '#/components/schemas/Identifier'
              - type: 'null'
              description: Cédula/NIT completo — solo en detalle (ADR-020)
          required:
          - nombre
          - tipo
          - identifier
          additionalProperties: false
        valor_cop:
          type: string
        valor_dudoso:
          type: boolean
          description: true cuando el valor publicado no pasa la regla de plausibilidad de Alfil y ninguna fuente lo confirmó como está
          example: false
        veredicto_valor:
          type: string
          enum:
          - plausible
          - recovered
          - document_verified
          - unverifiable
          description: 'Veredicto de Alfil sobre el valor publicado: plausible, recuperado de las fuentes de financiación, verificado en el contrato firmado o sin verificar'
          example: plausible
        valor_corregido:
          anyOf:
          - type: number
          - type: 'null'
          description: Valor en COP que confirman las fuentes de financiación o el contrato firmado; null cuando no hay corrección
          example: null
        fecha_firma:
          type: string
        fuente:
          $ref: '#/components/schemas/Fuente'
        referencias:
          type: array
          items:
            $ref: '#/components/schemas/Referencia'
      required:
      - id
      - objeto
      - entidad
      - contratista
      - valor_cop
      - valor_dudoso
      - veredicto_valor
      - valor_corregido
      - fuente
      - referencias
      additionalProperties: false
      description: Detalle de contrato SECOP (sin datos de contacto semiprivados)
    ContratosBuscarResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ContratoListItem'
        page:
          $ref: '#/components/schemas/Page'
        fuente:
          $ref: '#/components/schemas/Fuente'
      required:
      - data
      - page
      - fuente
      additionalProperties: false
    ContratoListItem:
      type: object
      properties:
        id:
          type: string
          example: CO1.PCCNTR.4821993
        objeto:
          type: string
        entidad:
          type: object
          properties:
            nombre:
              type: string
            nit:
              type: string
          required:
          - nombre
          - nit
          additionalProperties: false
        contratista:
          type: object
          properties:
            nombre:
              type: string
            tipo:
              type: string
              enum:
              - persona_juridica
              - persona_natural
          required:
          - nombre
          - tipo
          additionalProperties: false
        valor_cop:
          type: string
          description: Valor en COP (bigint como string)
          example: '54000000'
        valor_dudoso:
          type: boolean
          description: true cuando el valor publicado no pasa la regla de plausibilidad de Alfil y ninguna fuente lo confirmó como está
          example: false
        veredicto_valor:
          type: string
          enum:
          - plausible
          - recovered
          - document_verified
          - unverifiable
          description: 'Veredicto de Alfil sobre el valor publicado: plausible, recuperado de las fuentes de financiación, verificado en el contrato firmado o sin verificar'
          example: plausible
        valor_corregido:
          anyOf:
          - type: number
          - type: 'null'
          description: Valor en COP que confirman las fuentes de financiación o el contrato firmado; null cuando no hay corrección
          example: null
        referencias:
          type: array
          items:
            $ref: '#/components/schemas/Referencia'
        origen:
          description: Dataset SECOP de origen del contrato (búsqueda dual, fix 2026-07-13)
          example: SECOP II
          type: string
          enum:
          - SECOP I
          - SECOP II
      required:
      - id
      - objeto
      - entidad
      - contratista
      - valor_cop
      - valor_dudoso
      - veredicto_valor
      - valor_corregido
      - referencias
      additionalProperties: false
      description: Contrato en listado (sin cédula)
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Código de error estable (ASCII)
              example: quota_exceeded
            message:
              type: string
            metric:
              type: string
            resetAt:
              type: string
          required:
          - code
          additionalProperties: false
      required:
      - error
      additionalProperties: false
    ProcesoContratacion:
      type: object
      properties:
        id:
          type: string
        proponentes:
          oneOf:
          - type: object
            properties:
              estado_fuente:
                type: string
                const: no_consultado
              registros:
                type: 'null'
              unico_proponente:
                type: 'null'
              truncado:
                type: 'null'
              corte:
                type: 'null'
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - unico_proponente
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          - type: object
            properties:
              estado_fuente:
                type: string
                const: ok
              registros:
                type: array
                items:
                  $ref: '#/components/schemas/Proponente'
              unico_proponente:
                type: boolean
                description: Si únicamente se presentó un proponente — el hallazgo que expone esta feature
              truncado:
                type: boolean
                description: Si la lista alcanzó el límite de la consulta (posiblemente incompleta)
              corte:
                type: string
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - unico_proponente
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          - type: object
            properties:
              estado_fuente:
                type: string
                const: error
              registros:
                type: 'null'
              unico_proponente:
                type: 'null'
              truncado:
                type: 'null'
              corte:
                type: 'null'
              consultado_en:
                type: string
            required:
            - estado_fuente
            - registros
            - unico_proponente
            - truncado
            - corte
            - consultado_en
            additionalProperties: false
          type: object
      required:
      - id
      - proponentes
      additionalProperties: false
      description: Proceso de contratación con sus proponentes, ganadores y no ganadores
    Fuente:
      type: object
      properties:
        nombre:
          type: string
          description: Fuente oficial del dato
          example: SECOP II — datos.gov.co
        url:
          description: URL de la fuente oficial
          type: string
        corte:
          type: string
          description: Fecha de corte del dato (ISO 8601)
          example: '2026-07-09'
        licencia:
          description: Licencia de la fuente
          example: CC BY-SA 4.0
          type: string
      required:
      - nombre
      - corte
      additionalProperties: false
      description: 'Proveniencia: fuente oficial y fecha de corte (atribución Ley 1712)'
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.1 con la cuenta Alfil (Supabase Auth como authorization server).
      flows:
        authorizationCode:
          authorizationUrl: https://api.alfil.co/oauth/authorize
          tokenUrl: https://api.alfil.co/oauth/token
          scopes:
            buscar:read: Búsqueda federada
            politicos:read: Perfiles y búsqueda de políticos
            partidos:read: Perfiles de partidos
            contratos:read: Contratación SECOP
            electoral:read: Resultados electorales
            congreso:read: Actividad legislativa
            finanzas:read: Finanzas públicas territoriales
            geografias:read: Catálogo DIVIPOLA