# Brazil Government Tenders & Contracts (PNCP Licitações) (`dottti/brazil-pncp-tenders`) Actor

Brazilian public tenders (licitações) and signed contracts from the official PNCP API as clean JSON: agency, state, city, modality, proposal deadline, estimated value in BRL, document links, winning company and contract value. Keyword, state and agency filters, new-only alerts.

- **URL**: https://apify.com/dottti/brazil-pncp-tenders.md
- **Developed by:** [Dottti](https://apify.com/dottti) (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.50 / 1,000 tender delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Brazil Government Tenders & Contracts (PNCP Licitações)

Get Brazilian public tenders (licitações) and signed contracts from the PNCP as clean JSON, CSV or Excel. The PNCP (Portal Nacional de Contratações Públicas) is the official national procurement portal. Federal, state and municipal buyers must publish there under Lei 14.133/2021.

Filter by keyword, state (UF), modality, agency and value. Schedule it every morning and you have a tender alert feed for your sector.

- **Planned price:** $5.00 per 1,000 tenders and $12.00 per 1,000 awards. You pay only for records that pass your filters. `maxItems` caps the cost of any run.
- **First run:** click **Start** with the default input. You get the 20 newest tenders that are open for proposals, with their document links, in about a minute.

### Who uses this

- **Suppliers and contractors** get a daily list of new tenders in their state and sector.
- **Bid teams** see the proposal deadline, the estimated value and the edital PDF in one row.
- **Market analysts** see which companies win contracts, with which agencies, and for how much.

### What you get

Two record types share one dataset. The `recordType` field tells them apart.

#### Tender (`recordType: "tender"`)

Taken from a real run on 5 November 2026:

```json
{
  "recordType": "tender",
  "pncpId": "12474705000120-1-000027/2027",
  "title": "CONSTITUIÇÃO DE SISTEMA DE REGISTRO DE PREÇOS PARA AQUISIÇÃO FUTURA DE MATERIAIS MÉDICO-HOSPITALARES ...",
  "agency": "HOSPITAL DAS CLINICAS DA FACULDADE DE MEDICINA DE BOTUCATU",
  "agencyCnpj": "12474705000120",
  "state": "SP",
  "city": "Botucatu",
  "sphere": "Estadual",
  "modality": "Pregão - Eletrônico",
  "disputeMode": "Aberto-Fechado",
  "legalBasis": "Lei 14.133/2021, Art. 28, I",
  "status": "Divulgada no PNCP",
  "publishedAt": "2026-11-05T07:59:55",
  "proposalOpensAt": "2026-11-06T08:00:00",
  "proposalClosesAt": "2026-11-23T09:00:00",
  "daysLeft": 18,
  "currency": "BRL",
  "estimatedValueBrl": 0,
  "url": "https://pncp.gov.br/app/editais/12474705000120/2027/27",
  "documents": [
    { "title": "EDITAL UNIFICADO ASSINADO.pdf", "type": "Edital", "url": "https://pncp.gov.br/pncp-api/v1/orgaos/12474705000120/compras/2027/27/arquivos/1" }
  ]
}
```

#### Award (`recordType: "award"`)

One row per signed contract, with the supplier company and the values:

```json
{
  "recordType": "award",
  "pncpId": "10479670000196-2-000915/2026",
  "tenderPncpId": "12075748000132-1-000022/2026",
  "title": "MATERIAIS PARA HIGIENIZAÇÃO E LIMPEZA - LEI 14.133/2021",
  "agency": "FUNDO MUNICIPAL DE SAUDE DE PENHA",
  "state": "SC",
  "city": "Penha",
  "supplierType": "company",
  "supplierName": "GOEDERT LTDA",
  "supplierCnpj": "79846465000118",
  "currency": "BRL",
  "totalValueBrl": 1935,
  "signedDate": "2026-11-03",
  "endDate": "2026-11-18",
  "tenderUrl": "https://pncp.gov.br/app/editais/12075748000132/2026/22"
}
```

Notes on the fields:

- Text fields keep the Portuguese wording exactly as the agency published it. You can search the PNCP site for any of it.
- Dates are the buyer's local time, as PNCP publishes them. `daysLeft` reads them as Brasília time.
- All amounts are in Brazilian reais (BRL). Some tenders show `0` as the estimated value. This is how PNCP shows a value the agency did not publish, for example a confidential budget (orçamento sigiloso).
- `url` opens the tender page on pncp.gov.br. `documents` links straight to each published file (edital, termo de referência, ETP).
- When the supplier is an individual (pessoa física), the name and CPF are withheld and `supplierType` is `individual`. Company names and CNPJs are kept as published.

### Input

| Field | What it does |
| --- | --- |
| `recordTypes` | `tenders`, `awards` or both. |
| `tenderStatus` | `open` (default): tenders still receiving proposals, newest first. `published`: every tender published in the date window. |
| `keywords` | Matched against the object, extra information and agency. Accents and case are ignored, so `licitacao` matches `licitação`. |
| `states` | Two-letter UF codes, for example `SP`, `MG`, `RJ`. |
| `modalities` | PNCP modality codes. `6` is Pregão - Eletrônico, `8` is Dispensa de Licitação, `4` is Concorrência - Eletrônica. |
| `agencyCnpj` | 14-digit CNPJ of one buying agency. Sent to the API, so it is fast. |
| `agencyContains`, `cityContains`, `supplierContains` | Text filters on agency, city (município) and supplier. |
| `minValueBrl` | Minimum estimated value (tenders) or contract value (awards). |
| `publishedWithinDays`, `publishedSince` | Date window for published tenders and awards. |
| `includeDocuments` | Adds document links. One extra request per tender. On by default. |
| `onlyNew`, `stateKey` | Daily alert mode. Records delivered before are skipped. |
| `maxItems` | Cap per record type, newest first. This is also your cost cap. |

#### Example: school meal tenders in São Paulo and Minas Gerais

```json
{
  "keywords": ["merenda escolar", "alimentação escolar", "gêneros alimentícios"],
  "states": ["SP", "MG"],
  "maxItems": 50
}
```

#### Example: contracts above R$ 500,000 signed in Rio de Janeiro this week

```json
{
  "recordTypes": ["awards"],
  "states": ["RJ"],
  "minValueBrl": 500000,
  "publishedWithinDays": 7,
  "maxItems": 200
}
```

### Daily alert in 3 steps

1. Set your filters and turn on `onlyNew`.
2. Click **Save as a new task**, then add a daily schedule.
3. Connect the task to email, Slack or Google Sheets from the **Integrations** tab.

### Status rows and run summary

Every run ends with status SUCCEEDED when the input can be read. Problems come back as free rows with `recordType: "status"`:

- `bad_input`: a value in your input is wrong, for example a CNPJ with too few digits. Nothing is fetched or charged.
- `no_results` or `no_new_results`: the filters matched nothing.
- `failed`: the PNCP API did not answer after retries.

The `RUN_SUMMARY` record in the key-value store lists each query, the rows read, the rows matched and the requests made.

### Pricing

Pay per record delivered to your dataset. Status rows are free. Platform usage is included in the price. When you set a maximum cost per run, the Actor stops at that limit and keeps what it already delivered.

### Notes and limits

- Data comes from the PNCP public consultation API (pncp.gov.br/api/consulta). No login and no key.
- The API has no keyword search. Keywords are matched on our side, page by page. A rare keyword over a wide window needs a higher `maxPages`.
- The PNCP API can be slow, about 2 to 10 seconds per page. A run over many states and modalities takes several minutes.
- Award rows come from the PNCP contracts list. Agencies publish a contract days or weeks after signing.
- Fields the agency leaves empty come back as `null`.

# Actor input Schema

## `recordTypes` (type: `array`):

Tenders are notices from the PNCP (editais, pregões, dispensas). Awards are signed contracts with the winning company and the contract value.

## `tenderStatus` (type: `string`):

open: tenders still receiving proposals, newest first. published: every tender published in the date window, open or not.

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

Words matched against the object (objeto), extra information, agency and unit. Accents and case are ignored, so licitacao matches licitação. Portuguese works best, for example software, veículos or merenda escolar. Leave empty for everything.

## `matchMode` (type: `string`):

any: at least one keyword. all: every keyword.

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

Keep records from these states. One query is sent per state.

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

PNCP contracting modality. Pregão Eletrônico (6) is the most common competitive one. Leave empty for all.

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

14-digit CNPJ of the buying agency (órgão), for example 00394445000101. Sent to the API, so it is fast.

## `agencyContains` (type: `string`):

Keep records whose agency or unit name contains this text, for example prefeitura de campinas or ministério da saúde.

## `cityContains` (type: `string`):

Keep records whose city (município) contains this text, for example Recife.

## `supplierContains` (type: `string`):

Keep contracts whose supplier company name or CNPJ contains this text.

## `minValueBrl` (type: `integer`):

Tenders: estimated value. Awards: total contract value. In Brazilian reais.

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

Date window for published tenders and for awards. Not used for open tenders.

## `publishedSince` (type: `string`):

Date in YYYY-MM-DD format. Overrides the N days setting.

## `includeDocuments` (type: `boolean`):

Adds the list of published files (edital, termo de referência, ETP) with direct download links. One extra request per tender.

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

Remember delivered IDs and skip them next time. Use it with a daily schedule for alerts.

## `stateKey` (type: `string`):

Separate memory for each alert when you run several schedules with onlyNew.

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

Hard cap on delivered tenders and, separately, on delivered awards, newest first. You pay per record delivered, so this is also your cost cap.

## `maxPages` (type: `integer`):

Tender pages hold 50 rows, contract pages 200. Keyword filters are applied on our side, so raise this to search deeper.

## `requestDelayMs` (type: `integer`):

Pause before each request to the public API. Never lower than 500 ms.

## `maxRetries` (type: `integer`):

Retries with backoff when the API fails or asks to slow down.

## Actor input object example

```json
{
  "recordTypes": [
    "tenders"
  ],
  "tenderStatus": "open",
  "matchMode": "any",
  "publishedWithinDays": 3,
  "includeDocuments": true,
  "onlyNew": false,
  "stateKey": "default",
  "maxItems": 20,
  "maxPages": 20,
  "requestDelayMs": 500,
  "maxRetries": 4
}
```

# Actor output Schema

## `records` (type: `string`):

Tenders with deadline, estimated value and documents; awards with supplier and contract value in BRL.

## `summary` (type: `string`):

Queries run, rows read and matched, delivered counts, requests and any failure.

# 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 = {
    "recordTypes": [
        "tenders"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("dottti/brazil-pncp-tenders").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 = {
    "recordTypes": ["tenders"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("dottti/brazil-pncp-tenders").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 '{
  "recordTypes": [
    "tenders"
  ],
  "maxItems": 20
}' |
apify call dottti/brazil-pncp-tenders --silent --output-dataset

```

## MCP server setup

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

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/d7PUPeSx72RExA311/builds/aZ4y9uYaDpX36UGRK/openapi.json
