# Licitações Brasil — PNCP Public Tenders Monitor (`thxtype/licitacoes-brasil`) Actor

Brazilian public tenders (licitações, editais, pregões) from the official PNCP API. Filter by keyword, state, municipality, modality, value and agency; get open tenders, item lists and daily alerts of new tenders only.

- **URL**: https://apify.com/thxtype/licitacoes-brasil.md
- **Developed by:** [Thiago Bellotti](https://apify.com/thxtype) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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/actors/running/actors-in-store.md#pay-per-usage

## 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 Public Tenders Monitor

**Find Brazilian public tenders (licitações, editais, pregões) from the official PNCP API, filtered and ready to use.** This Actor reads the **Portal Nacional de Contratações Públicas (PNCP)**, the federal portal where every public body in Brazil (federal, state and municipal) must publish its procurement under Law 14.133/2021. You can filter by keyword, state, city, modality, estimated value and agency, get only tenders still open for proposals, add the item list, and run it every day to get only the new ones.

No login, no browser, no scraping of HTML: the data comes from PNCP's public JSON API, with the same fields for every tender.

### What you get

- **Every modality**: pregão eletrônico, concorrência, dispensa de licitação, inexigibilidade, credenciamento, chamada pública, leilão, concurso, diálogo competitivo and the rest.
- **Open for proposals** (default): tenders still receiving bids, newest first.
- **All published tenders** in a date range, any status (up to 365 days per range; longer ranges are split for you).
- **Item list** per tender (optional): description, quantity, unit, estimated unit price, ME/EPP benefit, NCM/NBS code.
- **Monitor mode**: scheduled runs output only tenders you have not seen yet. Good for daily email or Slack alerts.

#### Output fields

| Field | Example |
|---|---|
| `numeroControlePNCP` | `05816630000152-1-008502/2026` |
| `orgao` | `{ cnpj, razaoSocial, esfera: "Estadual", poder: "Executivo" }` |
| `unidade` | `{ nome, codigo, municipio: "Salvador", codigoIbge: "2927408", uf: "BA" }` |
| `modalidade` / `modalidadeId` | `Pregão - Eletrônico` / `6` |
| `objeto` | `Contratação de empresa para fornecimento de software de gestão...` |
| `valorTotalEstimado` | `2996358.12` (BRL, `0` or `null` when the budget is secret) |
| `situacao` / `openForProposals` | `Divulgada no PNCP` / `true` |
| `dataPublicacao`, `dataAberturaProposta`, `dataEncerramentoProposta` | ISO dates with the Brasília offset, e.g. `2026-11-24T09:00:00-03:00` |
| `linkPNCP` | `https://pncp.gov.br/app/editais/05816630000152/2026/8502` |
| `linkSistemaOrigem` | Link to the buying system (Compras.gov.br, BLL, Licitações-e...) when PNCP has it |
| `amparoLegal` | `{ codigo: 1, nome: "Lei 14.133/2021, Art. 28, I", descricao }` |
| `srp` | `true` for price-registration tenders (Sistema de Registro de Preços) |
| `numeroCompra`, `processo`, `modoDisputa`, `tipoInstrumentoConvocatorio`, `valorTotalHomologado`, `matchedKeywords`, `scrapedAt` | Extra fields |
| `itens`, `itensCount` | Only with `includeItens` |

Example item:

```json
{
  "numeroControlePNCP": "05816630000152-1-008502/2026",
  "orgao": { "cnpj": "05816630000152", "razaoSocial": "FUNDO ESTADUAL DE SAUDE DO ESTADO DA BAHIA", "esfera": "Estadual", "poder": "Executivo" },
  "unidade": { "nome": "FUNDO ESTADUAL DE SAUDE - HOSPITAL GERAL DO ESTADO", "municipio": "Salvador", "codigoIbge": "2927408", "uf": "BA" },
  "modalidade": "Pregão - Eletrônico",
  "objeto": "Aquisição de bens comuns",
  "valorTotalEstimado": 2996358.12,
  "situacao": "Divulgada no PNCP",
  "openForProposals": true,
  "srp": false,
  "amparoLegal": { "codigo": 1, "nome": "Lei 14.133/2021, Art. 28, I" },
  "dataPublicacao": "2026-11-11T08:09:23-03:00",
  "dataAberturaProposta": "2026-11-19T09:00:00-03:00",
  "dataEncerramentoProposta": "2026-11-24T09:00:00-03:00",
  "linkPNCP": "https://pncp.gov.br/app/editais/05816630000152/2026/8502"
}
```

### How to use

1. Type **keywords** to look for in the tender object (`software`, `design`, `material de limpeza`). Leave empty for all tenders.
2. Pick **states**, **municipalities** and **modalities** if you want.
3. Keep **Only open for proposals** on to get tenders you can still bid on, or turn it off to get everything published in a date range.
4. Set **max tenders** and click **Start**. Download the results as JSON, CSV, Excel or HTML, or read them through the Apify API.

A run with empty input returns the 100 newest open tenders in Brazil in a few seconds.

#### Input examples

Open software and design tenders in São Paulo state, published in the last 7 days:

```json
{
  "keywords": ["software", "design", "marketing"],
  "states": ["SP"],
  "lastNDays": 7,
  "maxItems": 500
}
```

Every pregão eletrônico from one agency this year, with items:

```json
{
  "onlyOpenForProposals": false,
  "orgaoCnpjs": ["00394452000103"],
  "modalidades": ["pregao_eletronico"],
  "dateFrom": "2026-01-01",
  "includeItens": true,
  "maxItems": 0
}
```

#### Keyword matching

- Accent and case are ignored: `licitacao` finds `Licitação`.
- Whole words only, with plurals: `software` finds `softwares`, `design` does not find `designação`.
- End a word with `*` for a prefix: `licen*` finds `licença` and `licenciamento`.
- Several words are a phrase: `material de limpeza`.
- A tender is kept when **any** keyword matches. `excludeKeywords` drops tenders that contain any of those words.

### Monitor mode: daily alerts of new tenders

Turn on **monitorMode**. The Actor saves the `numeroControlePNCP` of every tender it returns in the named key-value store `licitacoes-brasil-monitor` (it stays in your account between runs). Next time, with the same filters, only tenders not seen before go to the dataset. After the first complete run, open-tender monitors only read tenders published since the last run (minus 2 days of overlap), so daily runs are fast.

- The memory is tied to your filters. Change a filter and a fresh monitor starts. Set **monitorKey** (e.g. `software-sp`) to give it a fixed name.
- The first run returns everything that currently matches. Later runs return only what is new.

**Set it up:**

1. Save your input as a **Task** (Actor page > Save as new task), with `monitorMode: true`.
2. Go to **Schedules** > **Create new**, pick a time such as every day at 07:00 (cron `0 7 * * *`, timezone America/Sao_Paulo) and add your task.
3. In the task, open **Integrations** and add one:
   - **Email**: "Send email notification" when the run succeeds, with a link to the dataset.
   - **Slack**, **Google Sheets**, **Zapier** or **Make** apps, to post new tenders in a channel or append them to a sheet.
   - **Webhook** on `ACTOR.RUN.SUCCEEDED` to your own URL. Read the new tenders from `https://api.apify.com/v2/datasets/{defaultDatasetId}/items?format=json`.

A run with no new tenders finishes with an empty dataset and costs nothing in results.

### Pricing

This Actor is priced **per result** (pay-per-event):

| Event | Suggested price |
|---|---|
| `tender-result`: one tender saved to the dataset | **$2.00 per 1,000 tenders** |
| `item-result`: one item attached to a tender (only with `includeItens`) | **$0.50 per 1,000 items** |

Tenders that do not match your filters, and tenders skipped by monitor mode, are not charged. You can set a maximum cost per run, and the Actor stops once it reaches it.

### Good to know

- **Speed.** The PNCP API allows about 30 requests per minute per IP (50 tenders per request), and the Actor keeps to that pace so it does not get blocked. Keywords are matched after download, so a keyword search reads every tender of the selected states, modalities and dates. Typical runs: empty input, a few seconds; open tenders in SP published in the last 7 days, about 2,800 tenders read in 2 to 4 minutes; every tender published in SP in the last 7 days, about 7,700 tenders read in 6 minutes. Narrow the search with states, modalities or dates for faster runs.
- **Open for proposals** means the closing date is in the future and the status is "Divulgada no PNCP". Suspended tenders are left out. Turn the option off to see all statuses.
- **Values.** Some tenders hide the estimated value (orçamento sigiloso) and show `0`. When you set `minValue`, those are left out.
- **Dates** are in Brasília time (UTC-3).
- **Links.** `linkPNCP` opens the tender page on PNCP with the edital and attachments. `linkSistemaOrigem` is filled only when the agency sent it.

### Use cases

- Bid alerts for companies that sell to the government (B2G): software, design, marketing, engineering, health, cleaning, food
- Lead lists of public bodies buying what you sell, by state or city
- Market research on public spending by modality, sphere or region
- Feeding CRMs, Google Sheets, Slack or Telegram bots on a schedule

### Data and terms

The data is public by law (Law 14.133/2021 and the Access to Information Law) and comes from the official PNCP API run by the federal government. The Actor does not log in or get around any access control. PNCP is the source of truth: always check the edital on PNCP or in the buying system before you bid.

### FAQ

**Is this the same data as pncp.gov.br?** Yes, it reads the official PNCP consulta API.
**Does it cover state and municipal tenders?** Yes. Every body under Law 14.133 has to publish on PNCP. Some cities still publish only on their own portals or in the Diário Oficial.
**Can I search by city?** Yes, with an IBGE code (`3550308`) or a name (`Campinas`, `Campinas/SP`).
**An endpoint changed and results are empty?** Please open an issue in the Issues tab.

***

### Português

**Licitações Brasil: monitor de licitações do PNCP.** Busque licitações, editais, pregões e dispensas publicados no **Portal Nacional de Contratações Públicas (PNCP)**, direto da API oficial, com os mesmos campos para todos os órgãos: federais, estaduais e municipais.

- **Filtros:** palavras-chave no objeto (sem acento, palavra inteira, plural e prefixo com `*`), palavras para excluir, UF, município (código IBGE ou nome), modalidade (pregão eletrônico, concorrência, dispensa, inexigibilidade, credenciamento...), esfera, CNPJ do órgão, valor estimado mínimo e máximo, publicadas nos últimos N dias ou num período, e propostas que fecham em até N dias.
- **Só com propostas abertas** (padrão): licitações que ainda recebem propostas, das mais novas para as mais antigas. Desligue para trazer tudo o que foi publicado no período.
- **Itens** (opcional): descrição, quantidade, unidade, valor unitário estimado, benefício ME/EPP.
- **Modo monitor:** guarda as licitações já entregues e, nas próximas execuções, traz só as novas. Combine com um Agendamento (Schedule) do Apify e uma integração de e-mail, Slack, Google Sheets ou webhook para receber alertas diários.
- **Campos de saída:** número de controle PNCP, órgão (CNPJ, razão social, esfera, poder), unidade (nome, município, UF), modalidade, objeto, valor total estimado, situação, datas de publicação, abertura e encerramento das propostas, link do PNCP, link do sistema de origem, amparo legal e se é registro de preços (SRP).
- **Preço:** por resultado. Sugerido US$ 2,00 a cada 1.000 licitações e US$ 0,50 a cada 1.000 itens.

Serve para alertas de licitação para empresas que vendem para o governo, prospecção de órgãos públicos, pesquisa de compras públicas e automações com planilhas e CRMs.

*Palavras-chave: licitações, licitações abertas, PNCP, Portal Nacional de Contratações Públicas, editais, pregão eletrônico, pregão, concorrência, dispensa de licitação, compras públicas, compras governamentais, Lei 14.133, alerta de licitações, Brazil public tenders, Brazil government procurement, Brazilian tenders API, B2G Brazil.*

# Changelog

This Actor's version history is a separate document: https://apify.com/thxtype/licitacoes-brasil/changelog.md

# Actor input Schema

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

Words searched in the tender object (objeto), accent-insensitive and whole-word: "software" also matches "softwares" and "SOFTWARE", but not "softwarehouse". End a word with \* for a prefix ("licen\*" matches licença, licenciamento). A tender is kept when ANY keyword matches. Leave empty for all tenders.

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

UF codes (SP, RJ, MG...) or state names. Empty = whole country.

## `municipalities` (type: `array`):

IBGE codes ("3550308") or names ("Campinas", "Campinas/SP"). Names are resolved to IBGE codes automatically. Empty = any.

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

Procurement modalities. Empty = all.

## `onlyOpenForProposals` (type: `boolean`):

On: tenders still receiving proposals (closing date in the future, status "Divulgada no PNCP"), newest first. Off: every tender published in the date range, any status.

## `lastNDays` (type: `integer`):

Only tenders published on PNCP in the last N days. 0 = no limit when "only open" is on; the last 7 days when it is off.

## `dateFrom` (type: `string`):

Start of the publication date range, YYYY-MM-DD. Overrides "last N days".

## `dateTo` (type: `string`):

End of the publication date range, YYYY-MM-DD. Default: today.

## `closingWithinDays` (type: `integer`):

Only tenders whose proposal deadline (dataEncerramentoProposta) is within the next N days. 0 = any deadline.

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

Minimum valorTotalEstimado in BRL. Tenders without an estimated value (secret budget) are dropped when this is set.

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

Maximum valorTotalEstimado in BRL.

## `esferas` (type: `array`):

Federal, state, municipal and/or district bodies. Empty = all.

## `orgaoCnpjs` (type: `array`):

Only tenders from these public bodies (14-digit CNPJ, punctuation optional).

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

Drop tenders whose object contains any of these words (same matching rules as keywords).

## `searchInComplementaryInfo` (type: `boolean`):

Match keywords in the complementary information field as well as the object.

## `includeItens` (type: `boolean`):

Fetch the items of each tender (description, quantity, unit, estimated unit price, ME/EPP benefit). Billed as a separate item-result event per item. Makes the run slower.

## `maxItensPerTender` (type: `integer`):

Cap on items fetched per tender (large price-registration tenders can have thousands).

## `maxItems` (type: `integer`):

Maximum number of tenders to save. 0 = no limit.

## `maxRuntimeSeconds` (type: `integer`):

Stop scanning after this many seconds and save what was found. A keyword search over every open tender in Brazil can read ~700 slow PNCP pages (20+ minutes); narrow it with states or dates, or raise this. 0 = until the run timeout.

## `monitorMode` (type: `boolean`):

Remember the tenders already returned and output only new ones on the next runs. Use with an Apify Schedule for daily alerts. State is kept in the named key-value store "licitacoes-brasil-monitor".

## `monitorKey` (type: `string`):

Optional name for this monitor's memory, e.g. "software-sp". Empty = derived from the filters, so changing a filter starts a fresh monitor.

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

Requests to the PNCP API in flight at the same time.

## `requestsPerMinute` (type: `integer`):

Pace of requests to the PNCP API. PNCP allows about 30 per minute per IP and blocks for ~30 s above that; the Actor slows down by itself when it gets blocked.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "states": [],
  "municipalities": [],
  "modalidades": [],
  "onlyOpenForProposals": true,
  "lastNDays": 0,
  "closingWithinDays": 0,
  "esferas": [],
  "orgaoCnpjs": [],
  "excludeKeywords": [],
  "searchInComplementaryInfo": false,
  "includeItens": false,
  "maxItensPerTender": 100,
  "maxItems": 20,
  "maxRuntimeSeconds": 180,
  "monitorMode": false,
  "maxConcurrency": 4,
  "requestsPerMinute": 28
}
```

# Actor output Schema

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

No description

# 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 = {
    "keywords": [
        "software"
    ],
    "maxItems": 20,
    "maxRuntimeSeconds": 180
};

// Run the Actor and wait for it to finish
const run = await client.actor("thxtype/licitacoes-brasil").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 = {
    "keywords": ["software"],
    "maxItems": 20,
    "maxRuntimeSeconds": 180,
}

# Run the Actor and wait for it to finish
run = client.actor("thxtype/licitacoes-brasil").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 '{
  "keywords": [
    "software"
  ],
  "maxItems": 20,
  "maxRuntimeSeconds": 180
}' |
apify call thxtype/licitacoes-brasil --silent --output-dataset

```

## MCP server setup

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

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/7SiZydnmLxXrTRwNI/builds/2lYEN1ymhM5JBIVHJ/openapi.json
