{
  "openapi": "3.0.1",
  "info": {
    "title": "SECOP Contracts Colombia — Entity & Contractor History",
    "description": "Colombian public contracts by contractor or entity, SECOP I + II: value, payments and % paid, funding sources such as royalties, standard bidding docs, yearly summaries and new-contract alerts.",
    "version": "0.1",
    "x-build-id": "4OsWV8mgD7eBWH0th"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/polyglot-data~secop-contracts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-polyglot-data-secop-contracts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/polyglot-data~secop-contracts/runs": {
      "post": {
        "operationId": "runs-sync-polyglot-data-secop-contracts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/polyglot-data~secop-contracts/run-sync": {
      "post": {
        "operationId": "run-sync-polyglot-data-secop-contracts",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "contractors": {
            "title": "Contractors",
            "type": "array",
            "description": "Contractors to profile: a NIT or document number (digits only; a NIT with its check digit also works) or part of the contractor's name. Accents are ignored for names. Leave empty to search by entity, keyword or other filters.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "entities": {
            "title": "Contracting entities",
            "type": "array",
            "description": "Contracting entities to profile: part of the entity name (e.g. \"Bogotá\") or the entity's NIT digits (exact match in SECOP II, prefix match in SECOP I; with or without the check digit). An entity NIT is the tax ID of a public institution, not a person's ID.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words to find in the contract object or description. Accents are ignored, so \"construccion\" also matches \"construcción\". A contract is kept if any keyword matches.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "SECOP II holds the contracts signed on the current platform. SECOP I is the previous platform and holds the history (mostly contracts up to 2021). Keep both for full contractor and entity histories.",
            "items": {
              "type": "string",
              "enum": [
                "secop2",
                "secop1"
              ],
              "enumTitles": [
                "SECOP II (current platform)",
                "SECOP I (historical archive)"
              ]
            },
            "default": [
              "secop2",
              "secop1"
            ]
          },
          "contractTypes": {
            "title": "Contract types",
            "type": "array",
            "description": "Contract type as published by SECOP, e.g. \"Obra\" (works), \"Servicios\", \"Suministros\", \"Compraventa\" or \"Consultoría\". Leave empty for all types.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "modalities": {
            "title": "Procurement modalities",
            "type": "array",
            "description": "Procurement method used to sign the contract. All eight groups are included by default. Unselect groups to narrow the results.",
            "items": {
              "type": "string",
              "enum": [
                "licitacion",
                "seleccion_abreviada",
                "minima_cuantia",
                "concurso_meritos",
                "con_ofertas",
                "regimen_especial",
                "contratacion_directa",
                "otros"
              ],
              "enumTitles": [
                "Public tender (licitación pública)",
                "Abbreviated selection (selección abreviada)",
                "Minimum amount (mínima cuantía)",
                "Merit contest (concurso de méritos)",
                "Special regime or direct contracting with offers",
                "Special regime (régimen especial, no offers)",
                "Direct contracting (contratación directa)",
                "Other (asset sales, APPs, multi-party contracts, supplier requests)"
              ]
            },
            "default": [
              "licitacion",
              "seleccion_abreviada",
              "minima_cuantia",
              "concurso_meritos",
              "con_ofertas",
              "regimen_especial",
              "contratacion_directa",
              "otros"
            ]
          },
          "departments": {
            "title": "Departments",
            "type": "array",
            "description": "Department of the contracting entity. Leave empty for all of Colombia. Municipality-level filters are not available.",
            "items": {
              "type": "string",
              "enum": [
                "Amazonas",
                "Antioquia",
                "Arauca",
                "Atlántico",
                "Bolívar",
                "Boyacá",
                "Bogotá D.C.",
                "Caldas",
                "Caquetá",
                "Casanare",
                "Cauca",
                "Cesar",
                "Chocó",
                "Córdoba",
                "Cundinamarca",
                "Guainía",
                "Guaviare",
                "Huila",
                "La Guajira",
                "Magdalena",
                "Meta",
                "Nariño",
                "Norte de Santander",
                "Putumayo",
                "Quindío",
                "Risaralda",
                "San Andrés, Providencia y Santa Catalina",
                "Santander",
                "Sucre",
                "Tolima",
                "Valle del Cauca",
                "Vaupés",
                "Vichada"
              ]
            },
            "default": []
          },
          "fundingSources": {
            "title": "Funding sources",
            "type": "array",
            "description": "SECOP II only: keep contracts with a positive amount in at least one of these funding sources. When set, SECOP I is skipped because it has no funding columns. Empty means no funding filter.",
            "items": {
              "type": "string",
              "enum": [
                "pgn",
                "sgp",
                "royalties",
                "ownTerritorial",
                "credit",
                "own"
              ],
              "enumTitles": [
                "National budget (PGN)",
                "General Participation System (SGP)",
                "Royalties (SGR)",
                "Own resources of municipalities/departments/indigenous reserves",
                "Credit",
                "Own resources"
              ]
            },
            "default": []
          },
          "contractorKind": {
            "title": "Contractor type",
            "enum": [
              "any",
              "company",
              "person"
            ],
            "type": "string",
            "description": "Filter by the kind of contractor. \"Companies\" keeps NIT holders, \"Persons\" keeps natural persons identified by a personal document. \"Any\" keeps both.",
            "default": "any"
          },
          "onlyStandardBiddingDocs": {
            "title": "Only standard bidding documents",
            "type": "boolean",
            "description": "Keep only contracts whose bidding documents were marked as standard (pliegos tipo). Contracts without that information are dropped when this is on.",
            "default": false
          },
          "minValue": {
            "title": "Minimum contract value (COP)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep contracts with a value of at least this amount, in Colombian pesos (COP). Empty means no minimum."
          },
          "maxValue": {
            "title": "Maximum contract value (COP)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep contracts with a value of at most this amount, in Colombian pesos (COP). Empty means no maximum."
          },
          "signedFrom": {
            "title": "Signed from (date)",
            "type": "string",
            "description": "Only contracts signed on or after this date (YYYY-MM-DD). Empty with no contractor or entity set means the last 365 days. When a contractor or an entity is set, the history has no date limit unless you fill this field or the next one."
          },
          "signedTo": {
            "title": "Signed to (date)",
            "type": "string",
            "description": "Only contracts signed on or before this date (YYYY-MM-DD)."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of contracts to save in one run.",
            "default": 1000
          },
          "onlyNew": {
            "title": "Only new or changed (alert mode)",
            "type": "boolean",
            "description": "Save only contracts that are new, or whose status, payments or last update changed since the previous run with the same filters. Combine with a daily schedule to get alerts. The first run saves everything. Unchanged contracts are not charged.",
            "default": false
          },
          "includeSummary": {
            "title": "Save summary",
            "type": "boolean",
            "description": "Save a SUMMARY record in the key-value store with totals by contractor, by entity and by year. The summary is not charged.",
            "default": true
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional datos.gov.co app token. It raises the rate limit for heavy use. Leave empty for normal runs."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}