# PNCP Brazil Procurement — licitações, contratos, atas (`t0ld/pncp-licitacoes-scraper`) Actor

Scrape Brazil's PNCP: editais/licitações (pregão, dispensa, concorrência), signed contracts with supplier CNPJ and value, and atas de registro de preço. Filter by date, modality, state, keywords, value. Official API.

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

## Pricing

$3.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 Brazil Public Procurement Scraper — licitações, contratos e atas

Extract public procurement data from the **PNCP — Portal Nacional de Contratações Públicas** (pncp.gov.br), the official Brazilian government portal where every federal, state and municipal body publishes its **editais (licitações, pregões, dispensas)**, **signed contracts** and **price registration records (atas de registro de preço)**. Get clean, flat data: organization CNPJ and name, state, city, object description, modality, estimated/contract values, dates, supplier CNPJ and name, and a direct link to the PNCP page.

It uses the official open PNCP API (no login, no browser), so **100 records take a few seconds**.

### What can I use it for?

- **Bid monitoring for suppliers**: get new pregões, dispensas and concorrências matching your keywords every day (`editais` or `open` with `keywords`).
- **Lead generation (B2B sales to government)**: find which companies just won contracts in your niche and how much they signed (`contratos` with supplier CNPJ, name and value).
- **Market intelligence and price research**: track values by object, state, modality and organization.
- **Competitor tracking**: watch the contracts and atas of a given supplier's customers by organization CNPJ.
- **Journalism, compliance and transparency dashboards**: monitor spending by órgão, state or municipality.

### Input

| Field | Description |
|---|---|
| `datasetType` | `editais` (notices by publication date), `open` (editais still open for proposals), `contratos` (signed contracts) or `atas` (price registration records created/updated in the period). |
| `daysBack` | Last N days (default 7). Used when `dateFrom` is empty. |
| `dateFrom` / `dateTo` | Date range in `YYYY-MM-DD`. For `open`, `dateTo` is the latest proposal deadline (empty = 90 days from today). |
| `modalities` | Multi-select, editais only: Pregão Eletrônico (6), Pregão Presencial (7), Dispensa (8), Inexigibilidade (9), Concorrência Eletrônica (4), Concorrência Presencial (5), Credenciamento (12), Leilão Eletrônico (1), Leilão Presencial (13), Concurso (3), Diálogo Competitivo (2), Manifestação de Interesse (10), Pré-qualificação (11). Default: Pregão Eletrônico. |
| `uf` | State code (e.g. `SP`). Not available for atas. |
| `cnpj` | Contracting organization CNPJ (14 digits). |
| `municipalityIbge` | 7-digit IBGE municipality code (editais only). |
| `keywords` | Keep only records whose object text contains at least one keyword (case- and accent-insensitive). |
| `minValue` | Minimum value in R$ (editais and contratos). |
| `maxItems` | Maximum number of records to return. |

Example:

```json
{
  "datasetType": "editais",
  "daysBack": 7,
  "modalities": ["6", "8"],
  "uf": "SP",
  "keywords": ["software", "computadores"],
  "minValue": 50000,
  "maxItems": 500
}
```

### Output

Editais (`datasetType: editais` or `open`):

```json
{
  "type": "edital",
  "id": "18291377000102-1-000225/2026",
  "orgCnpj": "18291377000102",
  "orgName": "MUNICIPIO DE CARMO DO CAJURU",
  "unitName": "ADMINISTRAÇÃO E RH",
  "uf": "MG",
  "city": "Carmo do Cajuru",
  "ibgeCode": "3114204",
  "processNumber": "PE 48",
  "object": "Registro de preços para futuras aquisições de produtos médico-hospitalares ...",
  "modality": "Pregão - Eletrônico",
  "modalityCode": 6,
  "status": "Divulgada no PNCP",
  "estimatedValue": 1722240.6,
  "homologatedValue": null,
  "publishedAt": "2026-11-15T17:47:51",
  "proposalStart": "2026-11-18T09:00:00",
  "proposalDeadline": "2026-12-02T08:45:00",
  "url": "https://pncp.gov.br/app/editais/18291377000102/2026/225"
}
```

Contratos add `supplierCnpj`, `supplierName`, `contractValue`, `signedAt`, `validFrom`, `validUntil`, `contractType`, `category`. Atas add `ataNumber`, `validFrom`, `validUntil`, `canceled`.

Download the results as JSON, CSV, Excel, XML or HTML, or get them through the Apify API, webhooks and integrations (Google Sheets, Zapier, Make, n8n).

### Pricing

Pay only for results: **$3.00 per 1,000 records**. No subscription and no extra proxy fees. Duplicates are removed automatically, and records filtered out by your keywords, state or value are never charged.

### Tips

- For daily monitoring, schedule the Actor with `daysBack: 1` and your keywords.
- Contracts cannot be filtered by state or keyword on the PNCP side, so those filters are applied after download; narrow with `cnpj` and a short date range for faster runs.
- `atas` lists price registration records created or updated in the period (the PNCP source filters by update date) and has no state/city data.
- The PNCP API is occasionally unavailable (503); the Actor retries automatically with backoff.

### Is it legal?

This Actor only reads public data published by Brazilian public bodies on PNCP, an open data portal created by Lei 14.133/2021 (Lei de Licitações). Supplier CNPJs and names of companies are public records; contracts with individuals (CPF) may contain personal names, so make sure your use of the data follows the LGPD/GDPR.

### Support

Found a bug or need an extra field? Open an issue in the **Issues** tab and it will be fixed quickly.

# Actor input Schema

## `datasetType` (type: `string`):

editais = procurement notices (licitações, dispensas, etc.) by publication date; open = editais still open for proposals; contratos = signed contracts; atas = price registration records (atas de registro de preço) created/updated in the period.

## `daysBack` (type: `integer`):

Used when 'Date from' is empty: collect records from the last N days up to today (or 'Date to'). Default 7.

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

Start date in YYYY-MM-DD format (e.g. 2026-11-01). Leave empty to use 'Last N days'.

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

End date in YYYY-MM-DD format. Leave empty for today. For 'open' editais this is the latest proposal deadline (empty = 90 days from today).

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

Procurement modalities to collect for editais / open editais. Each selected modality is queried separately. For 'open' editais, leave empty to include all modalities. Ignored for contratos and atas.

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

Filter by Brazilian state of the contracting unit. Not available for atas (the source has no state data).

## `cnpj` (type: `string`):

Only records from this contracting organization (órgão), 14 digits, e.g. 46395000000139. Punctuation is ignored.

## `municipalityIbge` (type: `string`):

Only editais from this municipality, 7-digit IBGE code (e.g. 3550308 for São Paulo). Editais and open editais only.

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

Keep only records whose object text (objeto) contains at least one of these words or phrases. Case- and accent-insensitive, applied after download. Leave empty for no filter.

## `minValue` (type: `number`):

Keep only editais with estimated/homologated value, or contracts with global value, of at least this amount in BRL. 0 = no filter. Not applied to atas.

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

Maximum number of records to return (total). Each saved record is billed.

## Actor input object example

```json
{
  "datasetType": "editais",
  "daysBack": 7,
  "modalities": [
    "6"
  ],
  "uf": "",
  "keywords": [],
  "minValue": 0,
  "maxItems": 100
}
```

# Actor output Schema

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

All scraped procurement records.

## `recordsFull` (type: `string`):

All fields of every record.

# 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 = {
    "modalities": [
        "6"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("t0ld/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 = { "modalities": ["6"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,t0ld/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/1xM0XRC3lSNDvYq1r/builds/mJHi65J5VRYVTCtAp/openapi.json
