# Brazil Public Procurement Scraper (PNCP) (`merrily_beryl/br-public-procurement-pncp`) Actor

Search and export Brazilian public procurement notices from the official PNCP API: buyer, state, object, value, proposal deadlines.

- **URL**: https://apify.com/merrily_beryl/br-public-procurement-pncp.md
- **Developed by:** [João Pedro Faria](https://apify.com/merrily_beryl) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 result (tender notice)s

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

## Brazil Public Procurement Scraper (PNCP)

Search and export **Brazilian public procurement notices** (pregão, concorrência, dispensa, inexigibilidade...) straight from the **official PNCP API** (Portal Nacional de Contratações Públicas, Lei 14.133/2021). No HTML scraping, no login, no proxies: only public notices published by government bodies.

### What you get

For every notice: PNCP control number, publication date, object description (in Portuguese), modality, status, buyer body name and CNPJ, state and city, estimated and awarded value (BRL), proposal opening and closing dates, legal basis, process number, link to the notice on pncp.gov.br and link to the originating e-procurement system.

### Use cases

- **Tender monitoring**: get new bids in your sector and state every day (schedule the Actor).
- **Market research**: which municipalities, states and federal bodies buy IT, medical supplies, construction or services.
- **Lead lists for suppliers**: public bodies that buy what you sell (organisations only).
- **Competitive intelligence** on public spending by modality and value.

### Input

| Field | Description |
|---|---|
| `mode` | `published` (date range) or `openForBids` (still accepting proposals). |
| `modalities` | PNCP modality codes: 4, 5 tenders; 6 electronic pregão; 7 in-person pregão; 8 dispensa; 9 inexigibilidade; 12 credenciamento. Empty = all 13. |
| `states` | Two-letter state codes (SP, RJ, MG...). Empty = all. |
| `keywords` | Words in the object description, in Portuguese (any match). |
| `publishedFrom` / `publishedTo` | Date range `YYYY-MM-DD` (default: last 3 days). |
| `minValueBrl` | Minimum estimated value in BRL. |
| `maxResults` | Maximum notices returned (you pay per result). |

Example:

```json
{"modalities": ["6", "8"], "states": ["SP", "RJ"], "keywords": ["software", "informática"], "maxResults": 200}
```

### Output example

```json
{
  "controlNumber": "94436342000100-1-000058/2026",
  "publishedAt": "2026-11-01T02:14:33",
  "object": "Registro de Preços para serviços de divulgação institucional ...",
  "modality": "Pregão - Eletrônico",
  "status": "Divulgada no PNCP",
  "buyerName": "MUNICIPIO DE MAQUINE",
  "buyerCnpj": "94436342000100",
  "state": "RS",
  "city": "Maquiné",
  "estimatedValue": 32799.96,
  "currency": "BRL",
  "proposalsCloseAt": "2026-07-17T09:00:00",
  "url": "https://pncp.gov.br/app/editais/94436342000100/2026/58"
}
```

### Pricing

Pay per event: **you pay per notice returned** (event `result-item`). Use `maxResults` to cap your spend.

### FAQ

**Is this legal?** Yes. PNCP is the official open-data portal required by Brazil's procurement law and the access-to-information law; this Actor uses its public consultation API. Output contains public bodies and their notices, not data about private individuals.

**How fresh is the data?** Notices appear in PNCP shortly after the buyer publishes them.

**Can I run it daily?** Yes: use Apify schedules with a rolling date range, or integrate via API, Make, Zapier or n8n.

### Limitations

Fields depend on what the buyer filled in; some notices have no value or dates (returned as `null`). Object descriptions are in Portuguese. Always check the official notice before bidding. The modality filter is required by the PNCP API, so the Actor queries each selected modality in turn.

# Actor input Schema

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

'published' = notices published between the dates below. 'openForBids' = notices still accepting proposals (until the 'Published to' date).

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

PNCP procurement modality codes: 4 competitive e-tender, 5 in-person tender, 6 electronic reverse auction (pregão), 7 in-person reverse auction, 8 direct award (dispensa), 9 non-competitive (inexigibilidade), 12 accreditation. Leave empty for all 13.

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

Two-letter state codes such as SP, RJ, MG. Leave empty for all states.

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

Keep notices whose object description contains any of these words (Portuguese, case-insensitive).

## `publishedFrom` (type: `string`):

Date YYYY-MM-DD. Default: 3 days ago.

## `publishedTo` (type: `string`):

Date YYYY-MM-DD. Default: today.

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

Only notices with an estimated value at or above this amount.

## `maxResults` (type: `integer`):

Maximum number of notices to return (you are charged per result).

## Actor input object example

```json
{
  "mode": "published",
  "modalities": [
    "6"
  ],
  "maxResults": 100
}
```

# Actor output Schema

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

All results (one item per record) in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("merrily_beryl/br-public-procurement-pncp").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("merrily_beryl/br-public-procurement-pncp").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 '{}' |
apify call merrily_beryl/br-public-procurement-pncp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,merrily_beryl/br-public-procurement-pncp"
        }
    }
}
```

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/xBhjW7t7uYmuESuxk/builds/sVuO1ChmyuMfdF3Uu/openapi.json
