# Biodatos Adres (`devalexanderdaz/biodatos-adres-crawlee`) Actor

This is a Crawlee + PlaywrightCrawler + Camoufox + TypeScript crawler for querying the Colombian ADRES (Administradora de los Recursos del Sistema General de Seguridad Social en Salud) database.

- **URL**: https://apify.com/devalexanderdaz/biodatos-adres-crawlee.md
- **Developed by:** [Alexander Daza](https://apify.com/devalexanderdaz) (community)
- **Categories:** Integrations, Automation, Other
- **Stats:** 13 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ADRES Colombian Document Scraper

This is a Crawlee + PlaywrightCrawler + Camoufox + TypeScript crawler for querying the Colombian ADRES (Administradora de los Recursos del Sistema General de Seguridad Social en Salud) database.

### Features

- Support for 14 Colombian document types (see `E_DOCUMENT_TYPE` in [src/types.ts](src/types.ts))
- Automatic document number cleaning and validation
- CLI and environment variable configuration
- Headless and headful browser support
- Proxy rotation support

If you're looking for Crawlee examples or want to learn more visit:

- [Documentation](https://crawlee.dev/js/api/playwright-crawler/class/PlaywrightCrawler)
- [Examples](https://crawlee.dev/js/docs/examples/playwright-crawler)

### Document Types

Valid values for `DOCUMENT_TYPE`:

- `TI` (TARJETA\_IDENTIDAD) - Tarjeta de Identidad
- `CC` (CEDULA\_CIUDADANIA) - Cédula de Ciudadanía
- `MS` (MENOR\_SIN\_IDENTIFICACION) - Menor sin Identificación
- `SC` (SALVO\_CONDUCTO) - Salvo Conducto
- `AS` (ADULTO\_SIN\_IDENTIFICACION) - Adulto sin identificación
- `CD` (CARNET\_DIPLOMATICO) - Carnet diplomático
- `NI` (NUMERO\_IDENTIFICACION\_TRIBUTARIA) - Número Identificación Tributaria
- `PA` (PASAPORTE) - Pasaporte
- `RC` (REGISTRO\_CIVIL) - Registro Civil
- `PT` (PERMISO\_POR\_PROTECCION\_TEMPORAL) - Permiso por Protección Temporal
- `NU` (NO\_UNICO\_DE\_ID\_PERSONAL) - No. Único de Id. Personal
- `CN` (CERTIFICADO\_NACIDO\_VIVO) - Certificado Nacido Vivo
- `PE` (PER\_ESPECIAL\_PERMANENCIA) - Per Especial Permanencia
- `CE` (CEDULA\_DE\_EXTRANJERIA) - Cédula de Extranjería

### Run (local)

```bash
npm ci

## Via CLI arguments
npm run start:dev CEDULA_CIUDADANIA 1234567890

## Or via environment variables
cp .env.example .env
## Edit .env with your values
npm run start:dev
```

**Environment variables:**

```bash
## REQUIRED - CAPTCHA Service (required for form submission)
CAPTCHA_SOLUTION_SERVICE=2captcha  # 2captcha, anticaptcha, or capmonster
CAPTCHA_API_KEY=...                # Your API key for the CAPTCHA service

## REQUIRED - Document Input
DOCUMENT_TYPE=CC                   # CC, TI, PA, NU, etc. (see Document Types section)
DOCUMENT_NUMBER=...                # Colombian ID number (4-15 digits)

## OPTIONAL - Browser & Logging
HEADLESS=true|false                # Default: true
CRAWLEE_LOG_LEVEL=INFO             # Default: INFO (DEBUG, INFO, WARN, ERROR)
CRAWLEE_STORAGE_DIR=./storage      # Default: ./storage

## OPTIONAL - Concurrency
MIN_CONCURRENCY=1                  # Default: 1
MAX_CONCURRENCY=10                 # Default: 10
MAX_REQUESTS_PER_CRAWL=1           # Default: 1
```

### Docker

```bash
docker build -t biodatos-adres:local .
docker run --rm -it \
  -e HEADLESS=true \
  -e CRAWLEE_LOG_LEVEL=INFO \
  -e CRAWLEE_STORAGE_DIR=./storage \
  -e DOCUMENT_TYPE=CEDULA_CIUDADANIA \
  -e DOCUMENT_NUMBER=1234567890 \
  -e PROXY_URLS="http://user:pass@proxy:3128" \
	-e MIN_CONCURRENCY=1 -e MAX_CONCURRENCY=10 \
	-v "$PWD/storage:/home/myuser/storage" \
	biodatos-adres:local
```

# Actor input Schema

## `documentType` (type: `string`):

One of Colombian ID types (TI, CC, MS, SC, AS, CD, NI, PA, RC, PT, NU, CN, PE, CE)

## `documentNumber` (type: `string`):

Colombian ID number (4–15 digits). Currently only numeric supported.

## `headless` (type: `boolean`):

When false, runs with browser UI for debugging

## `minConcurrency` (type: `integer`):

Minimum number of concurrent requests

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent requests

## `maxRequestsPerCrawl` (type: `integer`):

Maximum number of requests to process during the crawl

## Actor input object example

```json
{
  "documentType": "CC",
  "documentNumber": "1032440675",
  "headless": true,
  "minConcurrency": 1,
  "maxConcurrency": 10,
  "maxRequestsPerCrawl": 1
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "documentNumber": "1032440675"
};

// Run the Actor and wait for it to finish
const run = await client.actor("devalexanderdaz/biodatos-adres-crawlee").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "documentNumber": "1032440675" }

# Run the Actor and wait for it to finish
run = client.actor("devalexanderdaz/biodatos-adres-crawlee").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "documentNumber": "1032440675"
}' |
apify call devalexanderdaz/biodatos-adres-crawlee --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=devalexanderdaz/biodatos-adres-crawlee",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ZAOOOLkzaQGZqkDB7/builds/6CHP8VdtQvweADpZG/openapi.json
