# PNCP Scraper: Brazil Public Tenders (Licitações) (`kareninatech/pncp-licitacoes-scraper`) Actor

Search Brazil's official PNCP portal for public tenders (licitações) by keyword in seconds, nationwide. Filter by state, city, modality, sphere, value and deadline. Get estimated values, deadlines, items, documents, a TENDER_REPORT and a monitor for new tenders.

- **URL**: https://apify.com/kareninatech/pncp-licitacoes-scraper.md
- **Developed by:** [Karen Gisela Gallegos Aguilar](https://apify.com/kareninatech) (community)
- **Categories:** Lead generation, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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 Scraper: Brazil public tenders (licitações)

Use this PNCP API alternative to search **licitações** (public tenders) from all of Brazil on [pncp.gov.br](https://pncp.gov.br/app/editais), the Portal Nacional de Contratações Públicas. Federal, state and municipal buyers must publish their tenders there (Lei 14.133/2021).

Type a keyword (software, merenda escolar, material hospitalar, obras...) and get matching tenders in seconds: deadlines, estimated value in BRL, agency, city and state, modality, the bidding platform link, and optionally the **item list** and the **document links** (edital, termo de referência). Each run also saves a **TENDER_REPORT** with totals by state, modality, sphere, agency and platform.

### Fast: server-side search, no browser

The Actor uses the same public search that the PNCP portal uses. The keyword search runs **on PNCP's side**, so it does not download the whole country to filter it.

- List only: about **1,500 tenders in 14 seconds**, **12,000 tenders in 1.5 minutes** (local tests)
- With items and documents: about **100 tenders in 80 seconds** (2 extra requests per tender)
- Runs at **512 MB**. No proxy needed today. If PNCP ever blocks a run, the Actor moves by itself to Apify datacenter proxy and then to residential proxy in Brazil.
- Polite by default: a small delay between requests and at most 3 at a time.

### What you get

| Field group | Fields |
|---|---|
| Tender | `id` (número de controle PNCP), `url`, `title`, `object`, `additional_info`, `edital_number`, `year`, `sequence` |
| Type and status | `modality`, `modality_id`, `dispute_mode`, `status`, `is_canceled`, `has_result`, `is_price_registration` (SRP), `legal_basis` |
| Dates | `proposals_open_at`, `proposals_close_at`, `days_to_close`, `is_receiving_proposals`, `published_at`, `days_since_published`, `updated_at` (Brasília time) |
| Value | `estimated_value_brl`, `value_band`, `is_confidential_budget`, `items_total_value_brl`, `modality_median_value_brl`, `value_vs_modality_median` |
| Buyer | `agency_name`, `agency_cnpj`, `unit_name`, `unit_code`, `sphere`, `power`, `city`, `state`, `ibge_code`, `budget_sources` |
| Where to bid | `platform` (e.g. Compras.gov.br, BLL, Portal de Compras Públicas), `source_system_url`, `electronic_process_url` |
| Items (optional) | `items[]`: number, description, type, quantity, unit, unit and total value, judgment, ME/EPP benefit, status; `item_count` |
| Documents (optional) | `documents[]`: title, type, download URL, date; `document_count` |

#### Why this Actor is different

- **Keyword search across Brazil in seconds.** No need to read 300+ pages and filter them yourself.
- **Match mode.** Exact phrase (`"material hospitalar"`), all words, or any word, plus **exclude words** (e.g. `locação`). **Keyword must be in the object** is on by default: you get only tenders whose object has the keyword. PNCP also finds words inside item lists and files; turn this option off for a wider search that keeps those too.
- **Deadline fields.** `days_to_close` and **Closes within N days** help you see what you can still bid on.
- **Value vs median.** Each tender's estimated value is compared with the median of the same modality in your run.
- **TENDER_REPORT.** Total and median value, value bands, tenders by state, modality, sphere and power, top agencies and cities, bidding platforms, and the 10 biggest tenders closing in 7 days.
- **Monitor mode.** Schedule it daily and get only new tenders. It stops after a few pages it already knows, so daily runs take seconds.
- **More than 10,000 results.** PNCP shows at most 10,000 results per search. For bigger runs without a state filter, the Actor splits the search by state.

### How to use it

1. Type one or more **keywords**. Leave empty for all tenders.
2. Choose **status**: open for proposals (default), closed, or all.
3. Optional filters: states, cities, modalities, sphere (federal / state / municipal), power, agency CNPJ, value range, published within N days, closes within N days, only price registration (SRP).
4. Set **Max tenders**. Turn on **items** and **documents** if you need them.
5. Run it and download JSON, CSV or Excel. Open `TENDER_REPORT` in the key-value store for the summary.

#### Input example

```json
{
    "keywords": ["merenda escolar", "material hospitalar"],
    "match_mode": "phrase",
    "status": "open",
    "states": ["SP", "Minas Gerais", "PR"],
    "modalities": ["pregao_eletronico", "dispensa"],
    "spheres": ["municipal"],
    "min_value_brl": 50000,
    "closing_within_days": 14,
    "exclude_words": ["locação"],
    "strict_object_match": true,
    "max_items": 300,
    "fetch_items": true,
    "fetch_documents": true
}
```

#### Output example (shortened)

```json
{
    "id": "11546530000156-1-000030/2026",
    "url": "https://pncp.gov.br/app/editais/11546530000156/2026/30",
    "title": "Edital nº 10/2026",
    "object": "CONTRATAÇÃO DE EMPRESA ESPECIALIZADA EM TECNOLOGIA DA INFORMAÇÃO ... SOFTWARE DE GESTÃO DE SAÚDE ...",
    "modality": "Pregão - Eletrônico",
    "proposals_close_at": "2026-11-23T09:30",
    "days_to_close": 4,
    "is_receiving_proposals": true,
    "estimated_value_brl": 1539100.95,
    "value_band": "500k_5m",
    "value_vs_modality_median": 1.85,
    "agency_name": "FUNDO MUNICIPAL DE SAUDE",
    "agency_cnpj": "11546530000156",
    "city": "Aquidabã",
    "state": "SE",
    "sphere": "Municipal",
    "platform": "3Tecnos Tecnologia LTDA",
    "item_count": 9,
    "items": [{ "number": 1, "description": "Cessão de uso de software web de gestão de saúde ...", "quantity": 12, "unit": "MÊS", "unit_value_brl": 37915.15, "total_value_brl": 454981.8, "benefit": "Participação exclusiva para ME/EPP" }],
    "document_count": 11,
    "documents": [{ "title": "Termo_de_Referencia.pdf", "type": "Outros Documentos", "url": "https://pncp.gov.br/pncp-api/v1/orgaos/11546530000156/compras/2026/30/arquivos/2" }]
}
```

### Monitor mode (tender alerts)

Turn on **Monitor mode** and give it a **Monitor name** (for example `software-sp`). The first run saves the matching tenders and remembers them in a named key-value store. Later runs save **only new tenders**. PNCP sorts results by last update, so the Actor stops after 2 pages with no new tenders (you can change this). Schedule it daily and connect it to e-mail, Slack or a webhook with Apify integrations.

### Filters

| Input | What it does |
|---|---|
| `keywords` | One search per keyword. In phrase mode, multi-word keywords are searched as exact phrases. |
| `match_mode` | `phrase`, `all_words`, `any_word`. |
| `strict_object_match` | On by default: keep only tenders whose object or extra info has the keyword. Turn off for a wide search (also matches inside items and files). |
| `exclude_words` | Drop tenders whose object has any of these words. |
| `status` | `open` (receiving proposals), `closed`, `all`. |
| `states`, `cities` | UF codes or names (`SP`, `São Paulo`, `sao paulo`); city names, accents optional. |
| `modalities` | pregão eletrônico, concorrência, dispensa, inexigibilidade, credenciamento, leilão... |
| `spheres`, `powers`, `agency_cnpjs` | Federal / state / municipal; executive / legislative / judiciary; buyer CNPJs. |
| `min_value_brl`, `max_value_brl` | Estimated value range in BRL. |
| `published_within_days`, `closing_within_days` | Recent tenders; deadlines soon. |
| `only_price_registration` | Only Sistema de Registro de Preços (SRP). |

### Who uses this data

- **Companies that sell to the government (B2G):** find open tenders for your products every day.
- **Bid consultants and licitação alert services:** feed your clients with fresh, filtered tenders.
- **Market researchers and journalists:** public spending by state, modality, agency and platform.
- **Sales teams:** agencies buying a category are a direct lead list.

### Limitations

- Brazil only. Data is what agencies publish on PNCP. Some still publish only on their own portals.
- About 10–15% of tenders show no estimated value (zero or confidential budget). When the value is missing and the budget is not confidential, the Actor uses the sum of the items (if items are on).
- Dispensa and inexigibilidade often have no proposal period, so dates and `is_receiving_proposals` are empty for them.
- PNCP shows at most 10,000 results per search. The Actor splits by state above that, but a single state with more than 10,000 results is cut at 10,000 (add filters).
- PNCP updates results while you read them, so a few tenders can appear twice (the Actor removes duplicates) and in rare cases one updated during the run can be missed. Monitor mode catches it next time.
- The keyword search is the portal's own public search. It is not the documented PNCP consultation API and could change.

### Input and output details

### Input reference

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `keywords` | array | No | — | One search per line, e.g. software, material hospitalar, merenda escolar, energia solar, limpeza. Searched in the tender object across all Brazil. Leave empty for the newest tenders. |
| `status` | string | No | `open` | open = receiving proposals now (default). closed = proposals closed. all = both. |
| `max_items` | integer | No | `100` | Maximum tenders to save in total (shared between keywords). |
| `states` | array | No | — | Optional. UF codes or names, e.g. SP, RJ, MG, Paraná. Empty = all Brazil. |
| `cities` | array | No | — | Optional. Keep tenders from these municipalities, e.g. Curitiba, Campinas. Accents are optional. |
| `modalities` | array | No | — | Optional tender modalities, for example Pregão, Dispensa or Concorrência. Leave empty for all. |
| `spheres` | array | No | — | Optional government spheres, for example federal, state or municipal. Leave empty for all. |
| `powers` | array | No | — | Optional government powers, for example executive or legislative. Leave empty for all. |
| `agency_cnpjs` | array | No | — | Optional. Keep tenders from these buyers (órgão CNPJ, with or without punctuation). |
| `min_value_brl` | integer | No | — | Optional, e.g. 100000. Hides tenders without a public estimated value. |
| `max_value_brl` | integer | No | — | Maximum estimated value in Brazilian reais, for example 1000000. Leave empty for no maximum. |
| `closing_within_days` | integer | No | — | Optional, e.g. 7. Only tenders whose proposal deadline is in the next N days. |
| `published_within_days` | integer | No | — | Optional, e.g. 1 or 7. Only tenders published on PNCP in the last N days. |
| `only_price_registration` | boolean | No | `False` | If true, keep only Sistema de Registro de Preços tenders. |
| `match_mode` | string | No | `phrase` | phrase = the exact words together (default, e.g. "material hospitalar"). all_words = all words anywhere in the object. any_word = the site's broad search. |
| `strict_object_match` | boolean | No | `True` | On (default): keep only tenders whose object or extra info has the keyword (exact phrase in phrase mode). PNCP also finds words inside item lists and attached files, which brings loosely related tenders. Turn this off... |
| `exclude_words` | array | No | — | Optional. Skip tenders whose object has any of these words, e.g. locação, manutenção. |
| `fetch_items` | boolean | No | `False` | Adds every item with description, quantity, unit, estimated unit and total value. One extra request per tender. |
| `fetch_documents` | boolean | No | `False` | Adds links to the edital, termo de referência and other files. One extra request per tender. |
| `monitor_mode` | boolean | No | `False` | Remembers tenders between runs and saves only tenders that are new since the last run. Schedule it daily for tender alerts. |
| `monitor_key` | string | No | — | Name for this monitor, e.g. software-sp. Use a different name for each search you monitor. |
| `monitor_stop_after_known_pages` | integer | No | `2` | Monitor only. Results are newest first, so after this many pages (100 tenders each) with no new tenders the search stops. 0 = always read the whole search. |
| `max_concurrency` | integer | No | `3` | How many tenders to enrich at the same time (1-8). |
| `request_delay_ms` | integer | No | `300` | Pause between requests, in milliseconds, for example 500. Use this to be polite to the site. |
| `proxyConfiguration` | object | No | `{"useApifyProxy": false}` | Not needed today. If PNCP blocks the run, the Actor moves by itself to Apify datacenter proxy and then to residential proxy in Brazil. |

### Output fields

| Field | Description |
|-------|-------------|
| `object` | What is being bought (objeto). |
| `agency_name` | Buying agency (órgão). |
| `city` | Municipality. |
| `state` | UF. |
| `modality` | Modality. |
| `estimated_value_brl` | Estimated total value in BRL (null when confidential or not given). |
| `proposals_close_at` | Proposal deadline (Brasília time). |
| `days_to_close` | Days until the proposal deadline. |
| `url` | Tender page on pncp.gov.br. |
| `id` | PNCP control number (numero_controle_pncp). |
| `title` | Edital title. |
| `monitor_status` | new in monitor mode. |
| `scraped_at` | Run start (ISO). |

The dataset also includes 36 further fields. Open the Output tab in the Actor for the full list.

### FAQ

**Is there an official PNCP API?** Yes. PNCP has a public consultation API (Swagger), but it has no keyword search and new tenders can take time to appear there. This Actor uses the portal's public search for keywords and the PNCP API for items and documents.

**Do I need a login or a proxy?** No. PNCP data is open (dados abertos) and needs no login. The Actor works without proxy.

**Does it collect personal data?** No. It collects public tender data published by government bodies. It does not log in and does not collect bidder contact data.

**Can I download the edital PDF?** Yes. Turn on documents. Each document has a direct download URL.

**How often should I run the monitor?** Once or twice a day. PNCP gets thousands of new or updated tenders per working day.

**Something is wrong?** Open an issue on the Actor's Issues tab with your run ID.

### Related Actors

More data extractors by [kareninatech](https://apify.com/kareninatech):

- [COMPRASAL Scraper — El Salvador public tenders](https://apify.com/kareninatech/central-america-tenders-scraper)
- [BOE Subastas Scraper — Spain property auctions](https://apify.com/kareninatech/boe-subastas-scraper)
- [QuintoAndar Scraper — Brazil property data](https://apify.com/kareninatech/quintoandar-scraper)
- [Chaves na Mão Scraper — Brazil property data](https://apify.com/kareninatech/chavesnamao-scraper)
- [Tecnoempleo Scraper — Spain IT jobs and salaries](https://apify.com/kareninatech/tecnoempleo-scraper)

# Actor input Schema

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

One search per line, e.g. software, material hospitalar, merenda escolar, energia solar, limpeza. Searched in the tender object across all Brazil. Leave empty for the newest tenders.

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

open = receiving proposals now (default). closed = proposals closed. all = both.

## `max_items` (type: `integer`):

Maximum tenders to save in total (shared between keywords).

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

Optional. UF codes or names, e.g. SP, RJ, MG, Paraná. Empty = all Brazil.

## `cities` (type: `array`):

Optional. Keep tenders from these municipalities, e.g. Curitiba, Campinas. Accents are optional.

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

Optional tender modalities, for example Pregão, Dispensa or Concorrência. Leave empty for all.

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

Optional government spheres, for example federal, state or municipal. Leave empty for all.

## `powers` (type: `array`):

Optional government powers, for example executive or legislative. Leave empty for all.

## `agency_cnpjs` (type: `array`):

Optional. Keep tenders from these buyers (órgão CNPJ, with or without punctuation).

## `min_value_brl` (type: `integer`):

Optional, e.g. 100000. Hides tenders without a public estimated value.

## `max_value_brl` (type: `integer`):

Maximum estimated value in Brazilian reais, for example 1000000. Leave empty for no maximum.

## `closing_within_days` (type: `integer`):

Optional, e.g. 7. Only tenders whose proposal deadline is in the next N days.

## `published_within_days` (type: `integer`):

Optional, e.g. 1 or 7. Only tenders published on PNCP in the last N days.

## `only_price_registration` (type: `boolean`):

If true, keep only Sistema de Registro de Preços tenders.

## `match_mode` (type: `string`):

phrase = the exact words together (default, e.g. "material hospitalar"). all_words = all words anywhere in the object. any_word = the site's broad search.

## `strict_object_match` (type: `boolean`):

On (default): keep only tenders whose object or extra info has the keyword (exact phrase in phrase mode). PNCP also finds words inside item lists and attached files, which brings loosely related tenders. Turn this off for a wide search that also keeps those matches.

## `exclude_words` (type: `array`):

Optional. Skip tenders whose object has any of these words, e.g. locação, manutenção.

## `fetch_items` (type: `boolean`):

Adds every item with description, quantity, unit, estimated unit and total value. One extra request per tender.

## `fetch_documents` (type: `boolean`):

Adds links to the edital, termo de referência and other files. One extra request per tender.

## `monitor_mode` (type: `boolean`):

Remembers tenders between runs and saves only tenders that are new since the last run. Schedule it daily for tender alerts.

## `monitor_key` (type: `string`):

Name for this monitor, e.g. software-sp. Use a different name for each search you monitor.

## `monitor_stop_after_known_pages` (type: `integer`):

Monitor only. Results are newest first, so after this many pages (100 tenders each) with no new tenders the search stops. 0 = always read the whole search.

## `max_concurrency` (type: `integer`):

How many tenders to enrich at the same time (1-8).

## `request_delay_ms` (type: `integer`):

Pause between requests, in milliseconds, for example 500. Use this to be polite to the site.

## `proxyConfiguration` (type: `object`):

Not needed today. If PNCP blocks the run, the Actor moves by itself to Apify datacenter proxy and then to residential proxy in Brazil.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "status": "open",
  "max_items": 100,
  "only_price_registration": false,
  "match_mode": "phrase",
  "strict_object_match": true,
  "fetch_items": false,
  "fetch_documents": false,
  "monitor_mode": false,
  "monitor_stop_after_known_pages": 2,
  "max_concurrency": 3,
  "request_delay_ms": 300,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped results using the dataset 'overview' view.

## `deadlines` (type: `string`):

No description

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

All scraped results from the default dataset without view transformation.

## `tenderReport` (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"
    ],
    "max_items": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("kareninatech/pncp-licitacoes-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": ["software"],
    "max_items": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("kareninatech/pncp-licitacoes-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": [
    "software"
  ],
  "max_items": 100
}' |
apify call kareninatech/pncp-licitacoes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kareninatech/pncp-licitacoes-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/LxJyBJtS8Tc3Da6Li/builds/JSnrjeKrUqLUwVbXA/openapi.json
