# Brazil PNCP Public Procurement Scraper (`talcoe/pncp-brazil`) Actor

Brazilian government tenders from the official PNCP database, filtered by state, contract type, keyword and date window. Priced per result.

- **URL**: https://apify.com/talcoe/pncp-brazil.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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

### Data source

Data comes directly from the official PNCP (Portal Nacional de Contratacoes Publicas) public JSON API at pncp.gov.br/api/consulta, which government agencies publish to in real time as new tenders go live.

### What does Brazil PNCP Public Procurement Scraper do?

This Actor pulls Brazilian government tenders (licitacoes) straight from the PNCP, the federal system every public agency in Brazil must publish procurement notices to. Each result includes the contracting agency, the object of the tender, the estimated value, the state and city, the contract modality, and the proposal open and close dates. Filters for contract type, state, keyword and date window keep runs focused and small, and you pay per result returned, not per page crawled.

### Why use it?

- Lead generation: find open tenders in your industry before your competitors do.
- Market research: track how much a state or municipality spends on a category of goods or services.
- Compliance and monitoring: watch a state or agency for new procurement activity on a schedule.
- Due diligence: pull the history of tenders tied to a specific agency or region.

It replaces manually browsing the PNCP web portal page by page, which has no bulk export and only lets you look at one notice at a time.

### How to use it

1. Open the Actor and set the contract type, state, keyword and days back filters.
2. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new tenders automatically.

### Input

| Field | Description |
|---|---|
| `modalidade` | Contract modality to search (Pregao Eletronico, Dispensa, Concorrencia, and so on). Defaults to Pregao Eletronico, the most common. |
| `uf` | Two letter Brazilian state code to limit results to one state. Blank searches nationwide. |
| `keyword` | Keeps only tenders whose object description contains this text, case insensitive. Blank keeps everything. |
| `daysBack` | How many days back from today to search, by PNCP publication date. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs. |

Example input:

```json
{
    "modalidade": "6",
    "uf": "",
    "keyword": "",
    "daysBack": 3,
    "maxResults": 60
}
```

### Output

Every record has the same shape:

```json
{
    "id": "88254875000160-1-000437/2026",
    "object": "[Portal de Compras Publicas] - PREGAO ELETRONICO PARA REGISTRO DE PRECOS DE VAGAS NO SERVICO DE ACOLHIMENTO PARA IDOSOS NO MUNICIPIO DE NOVO HAMBURGO.",
    "agency": "MUNICIPIO DE NOVO HAMBURGO",
    "uf": "RS",
    "city": "Novo Hamburgo",
    "modality": "Pregao - Eletronico",
    "estimatedValue": 2709588.12,
    "closeDate": "2026-07-09T08:59:00-03:00",
    "status": "Divulgada no PNCP",
    "openDate": "2026-06-15T15:00:00-03:00",
    "publishedDate": "2026-09-16T00:29:54-03:00",
    "processNumber": "240 / 2026 - 2595",
    "purchaseNumber": "43",
    "cnpj": "88254875000160",
    "url": "https://pncp.gov.br/app/editais/88254875000160/2026/437",
    "sourceSystemUrl": "https://www.portaldecompraspublicas.com.br/processos/RS/Prefeitura-Municipal-de-Novo-Hamburgo-43/RPE-43-2026-2026-488088",
    "scrapedAt": "2026-09-19T01:43:51.919Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key (PNCP control number), safe for deduplication between runs |
| `object` | What is being procured, in the agency's own words |
| `agency` | Name of the contracting government entity |
| `uf` | Two letter Brazilian state code |
| `city` | Municipality of the contracting entity |
| `modality` | Contract modality (Pregao Eletronico, Dispensa, and so on) |
| `estimatedValue` | Estimated contract value in Brazilian reais, when published |
| `closeDate` | Proposal submission deadline, ISO 8601, America/Sao\_Paulo time |
| `status` | Current status of the notice on PNCP |
| `openDate` | Proposal window opening date |
| `publishedDate` | Date the notice was published to PNCP |
| `processNumber` | Agency's internal process number |
| `purchaseNumber` | Agency's internal purchase number |
| `cnpj` | Tax ID of the contracting entity |
| `url` | Public PNCP page for this notice |
| `sourceSystemUrl` | Link to the originating procurement system, when the agency provides one |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Covers notices published through the PNCP consulta API. Contract modality is a required filter on the source API, so one run covers one modality at a time.
- Keyword filtering happens after the agency's own published text, so results depend on how each agency wrote the object description.
- The API rate limits aggressively; this Actor paces requests to stay under that limit, so very narrow filters (rare keyword plus a single state) can take longer to fill `maxResults`.

### FAQ

**Is this legal?** The Actor reads the PNCP consulta API, a public endpoint the Brazilian federal government publishes for anyone to query without a login, and stores only procurement information the government already publishes for that purpose. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

## `modalidade` (type: `string`):

PNCP contract modality to search. Pregao Eletronico is the most common and covers most open competitive tenders.

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

Limit results to one Brazilian state. Leave as All states for a nationwide search.

## `keyword` (type: `string`):

Only keep tenders whose object description contains this text, case insensitive. Leave blank to keep everything.

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

How many days back from today to search, by PNCP publication date.

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

Hard stop for the run. You are billed per result, so this caps the cost.

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

Apify proxy is recommended for larger runs.

## Actor input object example

```json
{
  "modalidade": "6",
  "uf": "",
  "keyword": "",
  "daysBack": 3,
  "maxResults": 60,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "modalidade": "6",
    "uf": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/pncp-brazil").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 = {
    "modalidade": "6",
    "uf": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/pncp-brazil").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 '{
  "modalidade": "6",
  "uf": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/pncp-brazil --silent --output-dataset

```

## MCP server setup

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

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/f8KTa07pEImYVf8wM/builds/d6DFikopdTq0mETHz/openapi.json
