# PNCP Brazil Public Tenders Scraper (`automatic/pncp-tenders-scraper`) Actor

Search Brazilian public tenders on PNCP: open bids by default, with buyer, CNPJ, state, municipality, method, status, estimated value in BRL, publication date and proposal deadline. Filter by keyword, state, method, government level, buyer and date for daily tender alerts.

- **URL**: https://apify.com/automatic/pncp-tenders-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 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

## PNCP Brazil Public Tenders Scraper

Find Brazilian government tenders on PNCP (Portal Nacional de Contratações Públicas, pncp.gov.br), the national portal where federal, state and municipal buyers publish their procurement notices. By default you get only tenders that are open for bids right now, newest first, one clean row per tender: subject, buyer and CNPJ, state and municipality, procurement method, status, estimated value in BRL, publication date and the proposal deadline with its time zone. Turn on details to add document links (edital, terms of reference, annexes), item category codes and a description excerpt.

### Use cases

- **Tender alerts:** schedule a daily run with "Published or updated since" set to yesterday, your keywords and states, and send new rows to email, Slack or a spreadsheet.
- **Sales pipeline:** list every open pregão for your product category in the states you serve, with the deadline and estimated value to qualify each one.
- **Buyer watch:** follow specific ministries, state agencies or city halls by CNPJ.
- **Market research:** count tenders and estimated spend by method, state or government level.

### Input

| Field | Type | Default | What it does |
|---|---|---:|---|
| `keywords` | string | `""` | Words searched in the tender subject, buyer and notice. Every word must match; accents and case do not matter. PNCP also matches related word forms (`hospitalares` finds `hospitalar` and `hospital`), so a row's title may not contain your exact words. |
| `status` | string | `open` | `open` (deadline still ahead), `closed` (proposal period ended) or `all`. |
| `states` | array | `[]` | Buyer states as UF codes, e.g. `SP`, `RJ`, `DF`. |
| `modalities` | array | `[]` | Procurement methods by id, e.g. `6` Pregão - Eletrônico, `4` Concorrência - Eletrônica, `8` Dispensa. |
| `spheres` | array | `[]` | Government level: `F` federal, `E` state, `M` municipal, `D` Federal District. |
| `buyerCnpjs` | array | `[]` | Buyer CNPJs, with or without punctuation, up to 20. |
| `publishedSince` | string | `""` | Only tenders published or changed on or after this date (`YYYY-MM-DD`, Brasília time). |
| `includeDetails` | boolean | `false` | Adds documents, item category codes, item count and a description excerpt, and confirms the deadline with the official record. Slower. |
| `maxItems` | integer | `50` | Maximum tenders returned, newest first. Up to 10,000 (1,000 with details). |

All filters are optional and can be combined. There is no municipality or product-category search filter: PNCP's search does not offer one. Filter on `municipality` or, with details on, `categoryCodes` in the output instead.

### Example queries

Open tenders, newest first:

```json
{"maxItems": 20}
```

Open software pregões in São Paulo and Minas Gerais, with documents:

```json
{"keywords": "software", "states": ["SP", "MG"], "modalities": ["6"], "includeDetails": true, "maxItems": 100}
```

Daily monitoring of everything a federal institute publishes or changes:

```json
{"buyerCnpjs": ["08.829.974/0001-94"], "status": "all", "publishedSince": "2026-11-02"}
```

### What it returns

Every row has `tenderId`, `noticeNumber`, `noticeType`, `title`, `buyerName`, `buyerId`, `buyerUnitName`, `buyerUnitCode`, `sphere`, `country`, `region`, `regionName`, `municipality`, `municipalityIbgeCode`, `procurementMethod`, `procurementMethodId`, `disputeMode`, `legalBasis`, `priceRegistration`, `status`, `statusLabel`, `isOpenForBids`, `categoryCodes`, `itemsCount`, `itemKinds`, `estimatedValue`, `currency`, `budgetConfidential`, `publishedAt`, `updatedAt`, `proposalsOpenAt`, `deadline`, `documents`, `url`, `submissionUrl`, `descriptionExcerpt`, `detailsFetched`, `detailsError`, `sourceQuery`, `source` and `scrapedAt`.

- `status` is `open`, `closed`, `awarded`, `cancelled` or `suspended`; `isOpenForBids` is true while the deadline is still ahead.
- Dates are ISO 8601 with an offset, so they sort and compare correctly. `publishedAt` and `updatedAt` are Brasília time (`-03:00`). `proposalsOpenAt` and `deadline` are in the buyer's local time: `-04:00` for Amazonas, Roraima, Rondônia, Mato Grosso and Mato Grosso do Sul, `-05:00` for Acre, `-02:00` for Fernando de Noronha, `-03:00` elsewhere.
- `estimatedValue` is in BRL and only filled when the buyer published it; confidential budgets are marked with `budgetConfidential` and left empty.
- `categoryCodes`, `itemsCount`, `itemKinds`, `documents` and `descriptionExcerpt` are filled when details are on and empty otherwise.
- `url` is the official notice page; `submissionUrl` is the buyer's e-procurement page where proposals are sent, when given.

### Output example

```json
{"tenderId": "08829974000194-1-000080/2026", "noticeNumber": "10/2026", "noticeType": "Edital", "title": "Aquisição de bens destinados à implantação e/ou ampliação de sistemas de Circuito Fechado de Televisão – CFTV, organizados em 3 (três) grupos, e 3 (três) itens avulsos (racks de parede, nobreaks e monitores) visando atender às demandas das Unidades de Conservação Federais vinculadas à Gerência…", "buyerName": "INSTITUTO CHICO MENDES DE CONSERVACAO DA BIODIVERSIDADE", "buyerId": "08829974000194", "buyerUnitName": "UNID. AVANÇADA DE ADM. E FINAN.FOZ DO IGUAÇU", "buyerUnitCode": "443048", "sphere": "Federal", "country": "BR", "region": "PR", "regionName": "Paraná", "municipality": "Foz do Iguaçu", "municipalityIbgeCode": "4108304", "procurementMethod": "Pregão - Eletrônico", "procurementMethodId": "6", "disputeMode": "Aberto", "legalBasis": "Lei 14.133/2021, Art. 28, I", "priceRegistration": true, "status": "open", "statusLabel": "Divulgada no PNCP", "isOpenForBids": true, "categoryCodes": [{"scheme": "Catálogo do Compras.gov.br", "code": "623909"}, {"scheme": "NCM/NBS", "code": "852580"}, {"scheme": "Catálogo do Compras.gov.br", "code": "635156"}], "itemsCount": 14, "itemKinds": ["goods"], "estimatedValue": 635350.04, "currency": "BRL", "budgetConfidential": false, "publishedAt": "2026-11-03T13:52:34-03:00", "updatedAt": "2026-11-03T13:52:34-03:00", "proposalsOpenAt": "2026-11-04T08:00:00-03:00", "deadline": "2026-11-16T09:00:00-03:00", "documents": [{"title": "PE 90004_26 (2).zip", "type": "Edital", "url": "https://pncp.gov.br/pncp-api/v1/orgaos/08829974000194/compras/2026/80/arquivos/1", "publishedAt": "2026-11-03T13:52:35-03:00"}, {"title": "14/2026.pdf", "type": "Termo de Referência", "url": "https://pncp.gov.br/pncp-api/v1/orgaos/08829974000194/compras/2026/80/arquivos/2", "publishedAt": "2026-11-03T13:53:36-03:00"}], "url": "https://pncp.gov.br/app/editais/08829974000194/2026/80", "submissionUrl": "https://cnetmobile.estaleiro.serpro.gov.br/comprasnet-web/public/compras/acompanhamento-compra?compra=44304805000102026", "descriptionExcerpt": "Aquisição de bens destinados à implantação e/ou ampliação de sistemas de Circuito Fechado de Televisão – CFTV, organizados em 3 (três) grupos, e 3 (três) itens avulsos (racks de parede, nobreaks e monitores) visando atender às demandas das Unidades de Conservação Federais vinculadas à Gerência Regional 5 Sul (GR-5 Sul) do ICMBio,", "detailsFetched": true, "detailsError": null, "sourceQuery": "status=open states=PR modalities=6", "source": "pncp.gov.br", "scrapedAt": "2026-11-03T17:05:00+00:00"}
```

### Limits and caveats

- Up to 10,000 tenders per run (1,000 with details). Narrow the filters to go further.
- Details take about 3 seconds per tender.
- A tender published in the last few minutes may not have its official record yet; its row then keeps the dates shown in the search.
- PNCP publishes proposal times without a time zone; they are read in the buyer's state time zone. The western tip of Amazonas uses `-05:00` locally but is read as `-04:00`.
- Titles and descriptions retain the text published by the buying body, including public contact information.

### FAQ

**How fresh is the data?** Every run reads PNCP live; buyers publish new tenders all day.

**How do I get only new tenders each day?** Schedule a daily run with `publishedSince` set to the previous day. Rows are unique per `tenderId`, so you can deduplicate across runs on it.

**What happens when nothing matches?** The run succeeds with an empty dataset and says so in its status. An invalid value (an unknown state code, a CNPJ without 14 digits) stops the run with a clear message.

### Price

You pay per result: each delivered tender row is one result, plus a small run-start charge. The run-start event is charged per GB of memory; the default 512 MB run is one start event. See the Pricing tab for the current prices.

### Support

For questions or issues, contact us from the Actor page.

# Actor input Schema

## `keywords` (type: `string`):

Words searched in the tender subject, buyer and notice, e.g. 'software' or 'merenda escolar'. Every word must match; accents and case do not matter. PNCP also matches related word forms, so titles may not contain your exact words. Up to 200 characters.

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

Open: tenders still accepting proposals (deadline in the future). Closed: proposal period ended. All: both.

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

Brazilian states of the buyer. Leave empty for the whole country.

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

Procurement method (modalidade), e.g. Pregão - Eletrônico. Leave empty for all methods.

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

Federal, state, municipal or Federal District buyers. Leave empty for all.

## `buyerCnpjs` (type: `array`):

Only tenders of these buying organisations, by CNPJ (14 digits, with or without punctuation, e.g. 08.829.974/0001-94). Up to 20.

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

Only tenders published or changed on or after this date (YYYY-MM-DD, Brasília time). Use it for daily monitoring: schedule a run with yesterday's date.

## `includeDetails` (type: `boolean`):

Also collect document links, item category codes, item count, a description excerpt and the deadline from the official record. Slower: about 3 seconds per tender, up to 1,000 tenders per run.

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

Maximum tenders returned, newest first. Up to 10,000 (1,000 with details).

## Actor input object example

```json
{
  "keywords": "",
  "status": "open",
  "states": [],
  "modalities": [],
  "spheres": [],
  "buyerCnpjs": [],
  "publishedSince": "",
  "includeDetails": false,
  "maxItems": 20
}
```

# 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": "",
    "states": [],
    "modalities": [],
    "spheres": [],
    "buyerCnpjs": [],
    "publishedSince": "",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/pncp-tenders-scraper").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": "",
    "states": [],
    "modalities": [],
    "spheres": [],
    "buyerCnpjs": [],
    "publishedSince": "",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/pncp-tenders-scraper").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": "",
  "states": [],
  "modalities": [],
  "spheres": [],
  "buyerCnpjs": [],
  "publishedSince": "",
  "maxItems": 20
}' |
apify call automatic/pncp-tenders-scraper --silent --output-dataset

```

## MCP server setup

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

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/BXwOf5m4fwitxF4pu/builds/08BimFSPJD2q7GjqZ/openapi.json
