# Brazil Pncp Procurement Scraper (`real-estate-api/brazil-pncp-procurement-scraper`) Actor

Brazil PNCP Procurement Scraper is a Python tool to extract tender notices, contract values, bidding modalities, purchasing entities, and supplier awards from the Portal Nacional de Contratações Públicas. It exports structured public procurement datasets into clean CSV or JSON formats

- **URL**: https://apify.com/real-estate-api/brazil-pncp-procurement-scraper.md
- **Developed by:** [real-estate-api](https://apify.com/real-estate-api) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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.
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 PNCP Procurement Scraper — Public Procurement Notices and Contracting Records

![Brazil PNCP Procurement Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/brazil-pncp-procurement-scraper-cover.png)

Collect public procurement notices from Brazil's National Public Procurement Portal (PNCP — Portal Nacional de Contratações Públicas). Choose a publication date range and procurement modality, set a collection limit, and export structured procurement records as JSON, CSV, Excel, or other supported formats.

### Overview

This actor collects published contracting notices from Brazil's PNCP. You can specify a date window and modality code to retrieve procurement records matching your criteria.

The actor processes multiple result pages, removes duplicate notices using their `numeroControlePNCP` identifiers, and saves one dataset record per notice. Collection stops when the requested item limit is reached or no more results are available.

### Features

- Collect public procurement notices from Brazil's PNCP.
- Filter notices by publication date range.
- Select a procurement modality.
- Retrieve records across multiple result pages.
- Remove duplicate notices using their PNCP control numbers.
- Set a maximum number of records per run.
- Collect contracting authority, procurement, and estimated value details.
- Export results in JSON, CSV, Excel, and other supported formats.
- Schedule recurring collections through Apify.

### Collection Mode

**Procurement Notices:** Collects published contracting notices within the specified date range and modality. The default modality code is `6`, corresponding to electronic auction (*pregão eletrônico*).

### Input Parameters

| Parameter | Type | Description |
|---|---|---|
| `mode` | String | Collection mode. Use `contracts`. |
| `dateFrom` | String | Start publication date in `YYYYMMDD` format. |
| `dateTo` | String | End publication date in `YYYYMMDD` format. |
| `modalidade` | Integer | Procurement modality code. Defaults to `6`. |
| `maxItems` | Integer | Maximum number of procurement notices to collect. |
| `requestDelaySecs` | Number | Delay between page requests, in seconds. |

### Example Input

```json id="pncp01"
{
  "mode": "contracts",
  "dateFrom": "20261001",
  "dateTo": "20261010",
  "modalidade": 6,
  "maxItems": 50,
  "requestDelaySecs": 1
}
```

### What Data Does This Actor Extract?

The actor collects procurement notice fields supplied by PNCP. Available values depend on the individual notice.

| Field | Description |
|---|---|
| `valorTotalHomologado` | Total awarded or approved value, when available. |
| `orgaoEntidade` | Contracting authority details, including CNPJ, legal name, government power, and administrative sphere. |
| `dataInclusao` | Date and time the record was added. |
| `dataAtualizacao` | Date and time of the record's update. |
| `anoCompra` | Procurement year. |
| `srp` | Indicates whether the procurement uses a price registration system. |
| `sequencialCompra` | Sequential procurement identifier. |
| `emendaParlamentar` | Parliamentary amendment information, when available. |
| `numeroCompra` | Procurement number. |
| `processo` | Procurement process reference. |
| `objetoCompra` | Description of the goods or services being procured. |
| `informacaoComplementar` | Additional procurement information, when available. |
| `dataAberturaProposta` | Date and time proposal submission opens. |
| `dataEncerramentoProposta` | Date and time proposal submission closes. |
| `dataPublicacaoPncp` | Publication date on PNCP. |
| `dataAtualizacaoGlobal` | Global record update timestamp. |
| `unidadeOrgao` | Contracting unit details, including state, municipality, IBGE code, and unit name. |
| `orgaoSubRogado` | Delegated contracting authority information, when available. |
| `unidadeSubRogada` | Delegated contracting unit information, when available. |
| `amparoLegal` | Legal basis and procurement modality description. |
| `linkSistemaOrigem` | Link to the originating procurement system, when available. |
| `linkProcessoEletronico` | Link to the electronic procurement process, when available. |
| `justificativaPresencial` | Justification for an in-person procedure, when available. |
| `numeroControlePNCP` | Unique PNCP procurement control number. |
| `valorTotalEstimado` | Estimated total procurement value. |
| `modalidadeId` | Procurement modality identifier. |
| `scraped_at` | Timestamp when the record was collected. |

### Example Output

```json id="pncp02"
{
  "valorTotalHomologado": null,
  "orgaoEntidade": {
    "cnpj": "01612441000107",
    "razaoSocial": "MUNICIPIO DE BELA VISTA DO CAROBA",
    "poderId": "N",
    "esferaId": "M"
  },
  "dataInclusao": "2026-10-01T00:01:07",
  "dataAtualizacao": "2026-10-01T00:01:07",
  "anoCompra": 2026,
  "srp": false,
  "sequencialCompra": 156,
  "emendaParlamentar": null,
  "numeroCompra": "PR66",
  "processo": "PR66/2026",
  "objetoCompra": "AQUISIÇÃO DE MATERIAIS ELÉTRICOS DESTINADOS À INSTALAÇÃO DE CARREGADOR VEICULAR…",
  "informacaoComplementar": null,
  "dataAberturaProposta": "2026-09-28T08:00:01",
  "dataEncerramentoProposta": "2026-10-08T08:00:01",
  "dataPublicacaoPncp": "2026-10-01T00:01:07",
  "dataAtualizacaoGlobal": "2026-10-01T00:01:24",
  "unidadeOrgao": {
    "ufNome": "Paraná",
    "ufSigla": "PR",
    "municipioNome": "Bela Vista da Caroba",
    "codigoIbge": "4102752",
    "codigoUnidade": "1",
    "nomeUnidade": "Prefeitura Municipal de Bela Vista da Caroba"
  },
  "orgaoSubRogado": null,
  "unidadeSubRogada": null,
  "amparoLegal": {
    "nome": "Lei 14.133/2021, Art. 28, I",
    "descricao": "pregão: modalidade de licitação obrigatória para aquisição de bens e serviços comuns",
    "codigo": 1
  },
  "linkSistemaOrigem": null,
  "linkProcessoEletronico": null,
  "justificativaPresencial": null,
  "numeroControlePNCP": "01612441000107-1-000156/2026",
  "valorTotalEstimado": 20901.1,
  "modalidadeId": 6,
  "scraped_at": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Procurement Monitoring:** Track newly published electronic auction notices within a selected date range.
- **Market Research:** Analyze procurement descriptions, estimated values, and contracting authorities across Brazilian municipalities.
- **Vendor Intelligence:** Identify public purchasing opportunities by government organization, location, or procurement category.
- **Public Sector Research:** Study procurement activity and purchasing trends using structured records.
- **Compliance and Recordkeeping:** Export procurement notice details for internal review and documentation.
- **Data Analysis:** Build reports using procurement values, dates, modality codes, and contracting authority information.

### Working with Your Dataset

After the actor finishes running, open its dataset to explore the collected procurement notices. You can:

- Export records as JSON, CSV, Excel, and other supported formats.
- Filter records by municipality, state, procurement modality, or publication date.
- Sort notices by estimated value or publication date.
- Identify individual procurement records using `numeroControlePNCP`.
- Analyze contracting authorities and procurement descriptions.
- Import the exported data into spreadsheets or data analysis tools.

### FAQ

**Who is this actor for?**

It is useful for suppliers, procurement researchers, analysts, consultants, and developers who need structured Brazilian public procurement records.

**What export formats are supported?**

You can export the dataset as JSON, CSV, Excel, and other formats supported by Apify.

**Can I choose a specific procurement modality?**

Yes. Use the `modalidade` parameter to select the procurement modality code. The default is `6`, for electronic auction (*pregão eletrônico*).

**Can I collect notices from a specific date range?**

Yes. Set `dateFrom` and `dateTo` using the `YYYYMMDD` format.

**Can I run it on a schedule?**

Yes. You can configure an Apify schedule to run the actor automatically at your preferred interval.

**What happens if a page cannot be collected?**

The actor continues processing other pages when possible. A failed page may not produce procurement records.

**How many notices can one run collect?**

The `maxItems` parameter controls the maximum number of records collected in a run.

**Does the actor collect complete tender documents?**

No. It collects procurement notice information provided in the returned records. Supporting documents and additional process details may need to be accessed separately when available.

### Disclaimer

This is an independent data collection tool and is not affiliated with, endorsed by, sponsored by, or officially associated with Brazil's National Public Procurement Portal (PNCP) or its operators. PNCP and related names and trademarks belong to their respective owners.

The actor collects information from publicly accessible procurement records. Users are responsible for ensuring that their collection and use of the data comply with applicable laws and the source's terms.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

What to scrape. Procurement notices lists published contracting notices from PNCP.

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

Start date as yyyymmdd for the publication window.

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

End date as yyyymmdd for the publication window.

## `modalidade` (type: `integer`):

codigoModalidadeContratacao (6 = pregão eletrônico).

## `uf` (type: `string`):

Optional state (UF) filter. Untested on the public API.

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between requests.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

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

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "contracts",
  "dateFrom": "20261001",
  "dateTo": "20261010",
  "modalidade": 6,
  "uf": "",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "dateFrom": "20261001",
    "dateTo": "20261010"
};

// Run the Actor and wait for it to finish
const run = await client.actor("real-estate-api/brazil-pncp-procurement-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 = {
    "dateFrom": "20261001",
    "dateTo": "20261010",
}

# Run the Actor and wait for it to finish
run = client.actor("real-estate-api/brazil-pncp-procurement-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 '{
  "dateFrom": "20261001",
  "dateTo": "20261010"
}' |
apify call real-estate-api/brazil-pncp-procurement-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,real-estate-api/brazil-pncp-procurement-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/Pva9ApZALY4xiYX8e/builds/G2NDzExEHpZqDS6eu/openapi.json
