{
  "openapi": "3.0.1",
  "info": {
    "title": "RUES Colombia Company Registry & NIT Scraper",
    "description": "RUES Colombia scraper and NIT lookup API. Search the unified business registry by name, NIT or matricula: get razon social, estado, camara de comercio, CIIU, dates and NIT check digit. Companies and ESAL non-profits. Export JSON, CSV, Excel. No login.",
    "version": "0.2",
    "x-build-id": "3HFG4EwKRjfS7qWhA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~rues-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-rues-scraper",
        "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/scrapers_lat~rues-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-rues-scraper",
        "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/scrapers_lat~rues-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-rues-scraper",
        "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": {
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "Company names, NIT tax-IDs or matrícula (registration) numbers to search in RUES. Numeric terms are treated as NIT/matrícula lookups; text terms search by legal name. Add one or more.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "auto",
              "nit",
              "name",
              "matricula"
            ],
            "type": "string",
            "description": "How to interpret each search term. Auto detects numeric terms as NIT/matrícula and text as legal name.",
            "default": "auto"
          },
          "nits": {
            "title": "NITs",
            "type": "array",
            "description": "Optional. NIT tax-IDs to look up (any format, e.g. 890.903.938-8 or 890903938). Merged with Search Terms.",
            "items": {
              "type": "string"
            }
          },
          "companyNames": {
            "title": "Company Names",
            "type": "array",
            "description": "Optional. Legal names to search by. Merged with Search Terms.",
            "items": {
              "type": "string"
            }
          },
          "matriculas": {
            "title": "Matrículas",
            "type": "array",
            "description": "Optional. Matrícula (mercantile registration) numbers to look up. Merged with Search Terms.",
            "items": {
              "type": "string"
            }
          },
          "maxCompanies": {
            "title": "Max Companies",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of companies to collect across all search terms. Optional."
          },
          "withDetails": {
            "title": "Fetch Full Details",
            "type": "boolean",
            "description": "When enabled, also fetch each company's full registry record (society type, up to four CIIU activity codes with descriptions, renewal, validity, update and cancellation dates, and status flags). Slower but richer. Available to paid Apify plans.",
            "default": true
          },
          "validateCheckDigit": {
            "title": "Validate NIT Check Digit",
            "type": "boolean",
            "description": "When enabled, recompute the NIT verification digit (DIAN algorithm) and return whether it matches the registry value.",
            "default": true
          },
          "register": {
            "title": "Registry",
            "enum": [
              "RM",
              "ESAL"
            ],
            "type": "string",
            "description": "Which RUES registry to search: RM = Registro Mercantil (companies/merchants, default) or ESAL = Entidades Sin Ánimo de Lucro (non-profits, foundations, NGOs).",
            "default": "RM"
          },
          "status": {
            "title": "Registration Status",
            "type": "array",
            "description": "Filter by merchant registration status. Defaults to active companies only.",
            "items": {
              "type": "string",
              "enum": [
                "ACTIVA",
                "CANCELADA",
                "NO ACTIVA"
              ],
              "enumTitles": [
                "Active",
                "Cancelled",
                "Inactive"
              ]
            },
            "default": [
              "ACTIVA"
            ]
          },
          "includeRaw": {
            "title": "Include Raw Record",
            "type": "boolean",
            "description": "When enabled and details are fetched, attach the raw registry detail record under `raw` for debugging or custom mapping.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used to reach the RUES service, which geo-restricts by IP. Defaults to Apify Residential proxy in Colombia; leave as-is unless you know what you are doing.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "CO"
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}