# PNCP Licitacoes Hunter - Brazilian Public Tenders (`aldodantas/pncp-licitacoes`) Actor

Monitor open public tenders from the Brazilian Portal Nacional de Contratacoes Publicas (PNCP). Filter by state, modality, keywords or agency CNPJ. Official data, no scraping needed.

- **URL**: https://apify.com/aldodantas/pncp-licitacoes.md
- **Developed by:** [Aldo Dantas](https://apify.com/aldodantas) (community)
- **Categories:** Agents, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## PNCP Licitacoes Hunter

> 🇧🇷 **Português abaixo** | Scroll down for Portuguese version

---

### 🇬🇧 English

Apify Actor that monitors active public tender notices from Brazil's **Portal Nacional de Contratacoes Publicas (PNCP)** — the official government platform for all public procurement since 2023.

#### What it does

Calls the [PNCP public consultation API](https://pncp.gov.br/api/consulta/swagger-ui/index.html) and returns open tender notices (editais) where proposal submission is still accepting — i.e., live opportunities companies can still participate in.

#### Use cases

- **Opportunity monitoring** — a company wants every IT procurement open in the state of Goiás in the next 30 days
- **Compliance / auditing** — list all active procurements from a specific government agency by CNPJ
- **Market analysis** — download tenders by modality to understand volumes, average values, main agencies

#### Input

All filters optional. By default returns electronic auctions open in the next 30 days nationwide.

| Field | Type | Default | Example |
|---|---|---|---|
| `uf` | string (2 letters) | all | `"GO"` |
| `modalidades` | array of int | `[6]` (electronic auction) | `[6, 8]` |
| `palavrasChave` | array of string | `[]` | `["software", "IT"]` |
| `cnpjOrgao` | string (14 digits) | all | `"00394544000185"` |
| `diasAFrente` | int 1-180 | 30 | `60` |
| `maxResults` | int 1-5000 | 500 | `100` |

**Modality codes:** `1=Open bidding`, `2=Electronic open bidding`, `4=Contest`, `5=Auction`, `6=Electronic auction (pregão eletrônico)`, `7=In-person auction`, `8=Dispense`, `9=Non-biddable`, `12=Accreditation`.

#### Output

Each dataset item is normalized to a clean schema:

```json
{
  "numeroControlePNCP": "00394544000185-1-002206/2024",
  "objetoCompra": "Refrigerated truck rental service...",
  "modalidadeNome": "Pregão - Eletrônico",
  "situacaoCompraNome": "Divulgada no PNCP",
  "valorTotalEstimado": 2708607.24,
  "dataAberturaProposta": "2026-04-10T08:00:00",
  "dataEncerramentoProposta": "2026-04-29T09:00:00",
  "dataPublicacaoPncp": "2024-11-18T07:04:17",
  "orgao": {
    "cnpj": "00394544000185",
    "razaoSocial": "MINISTERIO DA SAUDE",
    "poderId": "E",
    "esferaId": "F"
  },
  "unidade": {
    "nome": "EMP. BRAS. DE HEMODERIVADOS E BIOTECNOLOGIA",
    "uf": "Pernambuco",
    "municipio": "Recife",
    "codigoIbge": "2611606"
  },
  "linkSistemaOrigem": "https://cnetmobile.estaleiro.serpro.gov.br/..."
}
````

Download in JSON, CSV, HTML or Excel directly from the Apify dataset.

#### Why use it

- **Official source** — data comes directly from PNCP, the mandatory platform for Brazilian public procurement since 2023
- **No rate limit** declared for the public PNCP API
- **Flexible filtering** — combine state + modality + keyword in a single request
- **Integration-ready** — structured JSON output, works with Zapier / Make / n8n / your backend

#### Known limitations

- PNCP API returns up to 50 items per page. Pagination is automatic but large requests can take minutes
- `valorTotalEstimado` may be `0` or `null` — some agencies flag the estimated value as confidential
- Tender objects are in Portuguese (as on the original PNCP system)

#### Support

Use the **"Report issue"** button on this Apify listing to report bugs or request features. Response time is async — best effort, no SLA.

***

### 🇧🇷 Português

Apify Actor que monitora editais ativos no **Portal Nacional de Contratações Públicas (PNCP)** com filtros por UF, modalidade, palavras-chave e CNPJ do órgão.

#### O que faz

Consulta a [API pública do PNCP](https://pncp.gov.br/api/consulta/swagger-ui/index.html) e retorna editais com recebimento de propostas aberto — ou seja, oportunidades em que empresas ainda podem participar.

#### Casos de uso

- **Monitoramento de oportunidades:** empresa quer saber todos os pregões eletrônicos em TI abertos em GO nos próximos 30 dias
- **Compliance / auditoria:** listar contratações ativas de um órgão específico por CNPJ
- **Análise de mercado:** baixar editais de uma modalidade para entender volume, valores médios, principais órgãos

#### Input

Todos os filtros são opcionais. Por default retorna pregões eletrônicos abertos nos próximos 30 dias em todo o Brasil.

| Campo | Tipo | Default | Exemplo |
|---|---|---|---|
| `uf` | string (2 letras) | todas | `"GO"` |
| `modalidades` | array<int> | `[6]` (Pregão Eletrônico) | `[6, 8]` |
| `palavrasChave` | array<string> | `[]` | `["software", "TI"]` |
| `cnpjOrgao` | string (14 dígitos) | todos | `"00394544000185"` |
| `diasAFrente` | int 1-180 | 30 | `60` |
| `maxResults` | int 1-5000 | 500 | `100` |

**Códigos de modalidade:** `1=Concorrência`, `2=Concorrência Eletrônica`, `4=Concurso`, `5=Leilão`, `6=Pregão Eletrônico`, `7=Pregão Presencial`, `8=Dispensa`, `9=Inexigibilidade`, `12=Credenciamento`.

#### Output

Cada item no dataset tem o schema normalizado (veja exemplo JSON na seção em inglês acima).

Download em JSON, CSV, HTML ou Excel direto do dataset Apify.

#### Por que usar

- **Dados oficiais** — fonte primária é o PNCP, mandatório por lei para contratações públicas desde 2023
- **Sem rate limit** declarado na API pública do PNCP
- **Filtragem flexível** — cruza UF + modalidade + palavra-chave num único request
- **Integração direta** — output em JSON estruturado, pronto pra Zapier / Make / n8n / seu próprio backend

#### Limitações conhecidas

- A API PNCP retorna até 50 items por página. Paginação é automática, mas requests grandes podem levar minutos
- `valorTotalEstimado` pode vir como `0` ou `null` — alguns órgãos marcam como sigiloso

#### Suporte

Use o botão **"Report issue"** aqui no listing do Apify para reportar bugs ou pedir features. Resposta async — best effort, sem SLA.

***

### License

MIT — uso livre, sem garantias / free use, no warranties.

# Actor input Schema

## `uf` (type: `string`):

Sigla de 2 letras. Deixe em branco para todos os estados.

## `modalidades` (type: `array`):

Codigos: 1=Concorrencia, 2=Concorrencia Eletronica, 4=Concurso, 5=Leilao, 6=Pregao Eletronico, 7=Pregao Presencial, 8=Dispensa, 9=Inexigibilidade, 12=Credenciamento. Default: 6.

## `palavrasChave` (type: `array`):

Filtra editais cujo objeto contenha pelo menos uma destas palavras (case-insensitive). Deixe vazio para nao filtrar.

## `cnpjOrgao` (type: `string`):

CNPJ do orgao publicador (14 digitos, sem formatacao). Deixe em branco para todos.

## `diasAFrente` (type: `integer`):

Horizonte em dias para dataFinal (fase de proposta aberta). Default 30.

## `maxResults` (type: `integer`):

Hard cap para evitar scraping ilimitado. Default 500.

## Actor input object example

```json
{
  "modalidades": [
    6
  ],
  "palavrasChave": [],
  "diasAFrente": 30,
  "maxResults": 500
}
```

# Actor output Schema

## `editais` (type: `string`):

Lista de editais ativos no PNCP matching os filtros de input

## `editaisCsv` (type: `string`):

Mesmos editais em formato CSV para import em Excel/Sheets

# 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 = {
    "uf": "",
    "modalidades": [
        6
    ],
    "palavrasChave": [],
    "cnpjOrgao": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("aldodantas/pncp-licitacoes").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 = {
    "uf": "",
    "modalidades": [6],
    "palavrasChave": [],
    "cnpjOrgao": "",
}

# Run the Actor and wait for it to finish
run = client.actor("aldodantas/pncp-licitacoes").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 '{
  "uf": "",
  "modalidades": [
    6
  ],
  "palavrasChave": [],
  "cnpjOrgao": ""
}' |
apify call aldodantas/pncp-licitacoes --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PNCP Licitacoes Hunter - Brazilian Public Tenders",
        "description": "Monitor open public tenders from the Brazilian Portal Nacional de Contratacoes Publicas (PNCP). Filter by state, modality, keywords or agency CNPJ. Official data, no scraping needed.",
        "version": "0.1",
        "x-build-id": "X41goOaZHTZaVfGy8"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/aldodantas~pncp-licitacoes/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-aldodantas-pncp-licitacoes",
                "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/aldodantas~pncp-licitacoes/runs": {
            "post": {
                "operationId": "runs-sync-aldodantas-pncp-licitacoes",
                "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/aldodantas~pncp-licitacoes/run-sync": {
            "post": {
                "operationId": "run-sync-aldodantas-pncp-licitacoes",
                "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": {
                    "uf": {
                        "title": "UF (sigla do estado)",
                        "pattern": "^$|^[A-Za-z]{2}$",
                        "type": "string",
                        "description": "Sigla de 2 letras. Deixe em branco para todos os estados."
                    },
                    "modalidades": {
                        "title": "Modalidades de contratacao",
                        "type": "array",
                        "description": "Codigos: 1=Concorrencia, 2=Concorrencia Eletronica, 4=Concurso, 5=Leilao, 6=Pregao Eletronico, 7=Pregao Presencial, 8=Dispensa, 9=Inexigibilidade, 12=Credenciamento. Default: 6.",
                        "default": [
                            6
                        ]
                    },
                    "palavrasChave": {
                        "title": "Palavras-chave",
                        "type": "array",
                        "description": "Filtra editais cujo objeto contenha pelo menos uma destas palavras (case-insensitive). Deixe vazio para nao filtrar.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "cnpjOrgao": {
                        "title": "CNPJ do orgao",
                        "type": "string",
                        "description": "CNPJ do orgao publicador (14 digitos, sem formatacao). Deixe em branco para todos."
                    },
                    "diasAFrente": {
                        "title": "Dias a frente",
                        "minimum": 1,
                        "maximum": 180,
                        "type": "integer",
                        "description": "Horizonte em dias para dataFinal (fase de proposta aberta). Default 30.",
                        "default": 30
                    },
                    "maxResults": {
                        "title": "Maximo de resultados",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Hard cap para evitar scraping ilimitado. Default 500.",
                        "default": 500
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
