# Brazil Public Tenders Scraper (PNCP) — Licitações e Editais (`joao_crevellari/licitacoes-pncp`) Actor

Brazilian government tenders (licitações, pregão eletrônico, dispensa, concorrência, editais) from the official PNCP API. Filter by keyword, state (UF), procurement type, value and agency CNPJ; daily only-new alerts for B2G sales. Pay only per tender delivered.

- **URL**: https://apify.com/joao_crevellari/licitacoes-pncp.md
- **Developed by:** [João Crevellari](https://apify.com/joao_crevellari) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 tenders

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Licitações Brasil (PNCP) — daily tender alerts

Find **open Brazilian public tenders** (licitações, pregões, dispensas) from the **official PNCP API**, filter them by keyword, state, procurement type, government level and value, and get **only the new ones** on every scheduled run.

🇧🇷 [Leia em português](#português)

### Why this Actor

- **Official source.** Data comes from the public consultation API of the Portal Nacional de Contratações Públicas (PNCP), where every federal, state and municipal agency must publish since Law 14.133/2021. No scraping of HTML, no login, no CAPTCHA.
- **Built for alerts.** Run it daily with `publishedWithinDays = 1` and `onlyNew = true`: you receive each tender once, the day it is published.
- **Accent-insensitive keywords.** `veiculo` matches `VEÍCULO`, `Veículo` and `veículos`.
- **Clean, flat output** with a direct link to the tender page on PNCP and to the original purchasing system.
- **You pay only for delivered tenders.** Filters that discard tenders are free.

### Who uses it

- Suppliers and sales teams that sell to the government (IT, vehicles, health, construction, services).
- Bid consultancies that monitor many clients and niches.
- Journalists, researchers and civic-tech projects tracking public spending.
- AI agents and automations (n8n, Make, Zapier) that need a reliable tender feed.

### Input

| Field | What it does | Default |
|---|---|---|
| `keywords` | Tender object or agency must contain **any** of these words. Empty = all. | — |
| `excludeKeywords` | Drop tenders that contain any of these words. | — |
| `status` | `open` = still receiving proposals; `all` = everything published in the period. | `open` |
| `publishedWithinDays` | Look back N days (1–30). Use 1 for a daily schedule. | `1` |
| `states` | Brazilian states (UF), e.g. `["SP","PR"]`. Empty = whole country. | — |
| `modalities` | Procurement types (pregão eletrônico, dispensa, concorrência…). Empty = all 13. | — |
| `spheres` | `F` federal, `E` state, `M` municipal, `D` district. | — |
| `agencyCnpj` | Only one agency. | — |
| `minValue` / `maxValue` | Estimated value range in BRL. | — |
| `onlyNew` + `monitorName` | Never deliver the same tender twice for this monitor. | `false` |
| `maxResults` | Stop after N tenders. | `100` |

Example — new IT tenders in São Paulo and Paraná, above R$ 50,000:

```json
{
  "keywords": ["notebook", "computador", "servidor", "software"],
  "excludeKeywords": ["locação de veículos"],
  "states": ["SP", "PR"],
  "minValue": 50000,
  "publishedWithinDays": 1,
  "onlyNew": true,
  "monitorName": "ti-sul-sudeste"
}
```

### Output

One row per tender (real example):

```json
{
  "id": "53415717000160-1-000081/2026",
  "object": "Contratação de empresa especializada para execução de serviços de reforma e adequação do Barracão Espaço do Agronegócio do Município de Ourinhos-SP...",
  "agencyName": "MUNICIPIO DE OURINHOS",
  "agencyCnpj": "53415717000160",
  "unitName": "Prefeitura Municipal de Ourinhos",
  "sphere": "Municipal",
  "city": "Ourinhos",
  "state": "SP",
  "ibgeCode": "3534708",
  "modality": "Pregão - Eletrônico",
  "disputeMode": "Aberto",
  "situation": "Divulgada no PNCP",
  "processNumber": "197/2026",
  "purchaseNumber": "38",
  "estimatedValue": 49999.55,
  "homologatedValue": null,
  "isPriceRegistration": false,
  "publishedAt": "2026-11-14T10:30:23",
  "proposalsOpenAt": "2026-11-13T08:00:00",
  "proposalsCloseAt": "2026-12-02T08:59:00",
  "isOpenForProposals": true,
  "legalBasis": "Lei 14.133/2021, Art. 28, I",
  "sourceSystem": "SMARAPD INFORMATICA LTDA",
  "pncpUrl": "https://pncp.gov.br/app/editais/53415717000160/2026/81",
  "originUrl": null,
  "matchedKeywords": []
}
```

Dates are in Brasília time (UTC−3), exactly as published by PNCP. Export as JSON, CSV, Excel or connect through the Apify API.

### Pricing

Pay per event:

- **US$ 0.003 per tender delivered** (US$ 3 per 1,000).
- **US$ 0.001 per run.**

A daily alert that finds 20 tenders costs about US$ 0.06 per day. Set a maximum spend per run in Apify and the Actor stops cleanly when it is reached.

### Tips and limits

- PNCP limits request rate, so the Actor reads slowly on purpose (about 10–30 pages per minute). Scanning all of Brazil for 1 day takes roughly 10–15 minutes; for longer periods, filter by state or procurement type.
- Values and dates are what the agency published. Some tenders have no estimated value (confidential budget), so value filters skip them.
- Only tenders (editais and avisos de contratação). Contracts and price-registration minutes are not included in this version.

### Legal

Uses only public data published by law on PNCP, with no login and no personal data. Agencies are public bodies identified by CNPJ.

***

### Português

#### Licitações Brasil (PNCP) — alerta diário de editais

Encontre **licitações públicas abertas no Brasil inteiro** (pregões, dispensas, concorrências) direto da **API oficial do PNCP**. Filtre por palavra-chave, UF, modalidade, esfera e valor, e receba **só as novidades** a cada execução agendada.

**Por que usar**

- **Fonte oficial**: API pública de consulta do Portal Nacional de Contratações Públicas, onde todo órgão federal, estadual e municipal publica por força da Lei 14.133/2021. Sem login e sem CAPTCHA.
- **Feito para alerta diário**: agende com `publishedWithinDays = 1` e `onlyNew = true`. Cada licitação chega uma vez, no dia em que sai.
- **Palavra-chave sem acento**: `veiculo` acha `VEÍCULO` e `veículos`.
- **Saída limpa**, com link direto do edital no PNCP e no sistema de compras de origem.
- **Você paga só pelas licitações entregues**; o que os filtros descartam é grátis.

**Para quem**: fornecedores e equipes de venda para governo, consultorias de licitação, jornalistas e pesquisadores, automações (n8n, Make, Zapier) e agentes de IA.

**Entrada**: veja a tabela acima. Exemplo: licitações novas de TI em SP e PR acima de R$ 50 mil, com o JSON de exemplo da seção em inglês.

**Preço**: US$ 0,003 por licitação entregue (US$ 3 por mil) + US$ 0,001 por execução. Um alerta diário que acha 20 licitações custa cerca de US$ 0,06 por dia.

**Limites**: o PNCP limita o ritmo, então o robô lê devagar de propósito. Varrer o Brasil inteiro em 1 dia leva de 10 a 15 minutos; para períodos maiores, filtre por UF ou modalidade. Nesta versão entram só editais e avisos de contratação (contratos e atas ficam para depois).

**Legal**: só dados públicos publicados por lei no PNCP, sem login e sem dado pessoal.

# Actor input Schema

## `keywords` (type: `array`):

Returns tenders whose object or agency contains ANY of these words (accent- and case-insensitive), e.g. \["notebook","software"]. Empty = all. / Entrega licitações cujo objeto ou órgão contenha QUALQUER uma destas palavras (acentos e maiúsculas não importam). Vazio = todas.

## `excludeKeywords` (type: `array`):

Descarta licitações que contenham qualquer uma destas palavras. / Drops tenders containing any of these words.

## `status` (type: `string`):

Open = only tenders still receiving proposals. All = every tender published in the period. / Abertas = só as que ainda recebem propostas. Todas = tudo o que foi publicado no período.

## `publishedWithinDays` (type: `integer`):

1 = só hoje (ideal para alerta diário agendado). Máximo 30. / 1 = today only (best for a daily schedule). Max 30.

## `states` (type: `array`):

Two-letter Brazilian state codes (UF), e.g. \["SP","RJ"]. Empty = all of Brazil (slower: 10–15 min). / Siglas das UFs. Vazio = Brasil inteiro (mais lento).

## `modalities` (type: `array`):

Procurement type codes (strings). Most used: "6" = Pregão Eletrônico, "8" = Dispensa de Licitação, "4" = Concorrência Eletrônica, "9" = Inexigibilidade, "12" = Credenciamento. Empty = all 13 types. / Códigos das modalidades. Vazio = todas.

## `spheres` (type: `array`):

Federal, state, municipal or Federal District. Empty = all. / Federal, estadual, municipal ou distrital. Vazio = todas.

## `agencyCnpj` (type: `string`):

Opcional: só licitações deste órgão. / Optional: only this agency.

## `minValue` (type: `integer`):

Minimum estimated value in BRL. / Valor estimado mínimo, em reais.

## `maxValue` (type: `integer`):

Maximum estimated value in BRL. / Valor estimado máximo, em reais.

## `onlyNew` (type: `boolean`):

Não repete licitações já entregues em execuções anteriores com o mesmo nome de monitor. / Skips tenders delivered in previous runs with the same monitor name.

## `monitorName` (type: `string`):

Use um nome por alerta quando tiver vários agendamentos. / One name per alert.

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

Stop after N tenders. You only pay for delivered tenders (US$ 0.003 each). / Para depois de N licitações. Você só paga pelas entregues.

## Actor input object example

```json
{
  "status": "open",
  "publishedWithinDays": 3,
  "states": [
    "SP"
  ],
  "modalities": [
    "6"
  ],
  "onlyNew": false,
  "monitorName": "padrao",
  "maxResults": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One row per public tender from PNCP: object, agency, state, estimated value, dates and official link.

# 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 = {
    "publishedWithinDays": 3,
    "states": [
        "SP"
    ],
    "modalities": [
        "6"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("joao_crevellari/licitacoes-pncp").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 = {
    "publishedWithinDays": 3,
    "states": ["SP"],
    "modalities": ["6"],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("joao_crevellari/licitacoes-pncp").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "publishedWithinDays": 3,
  "states": [
    "SP"
  ],
  "modalities": [
    "6"
  ],
  "maxResults": 20
}' |
apify call joao_crevellari/licitacoes-pncp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,joao_crevellari/licitacoes-pncp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wpr0CmI0dCudCQ89y/builds/mro96iUo3gYLGsu1J/openapi.json
