# Brazil Public Tenders & Contracts (PNCP) — MCP Ready (`translucent_paste/pncp-brazil-tenders`) Actor

Extract active and published Brazilian public tenders (licitações, pregões, dispensas) from the official PNCP government API (Law 14.133/2021). Filters by keyword, state (UF), modality, value, and active status. Built for B2B sales, GovTech, n8n, and AI Agents (MCP).

- **URL**: https://apify.com/translucent_paste/pncp-brazil-tenders.md
- **Developed by:** [Douglas Freitas](https://apify.com/translucent_paste) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 tender extracteds

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 Tenders & Contracts (PNCP) — MCP Ready

Extract active and published Brazilian public tenders (*licitações, pregões eletrônicos, dispensas e concorrências*) directly from the official **PNCP (Portal Nacional de Contratações Públicas — Law 14.133/2021)** public government API.

Designed for **B2B sales teams, GovTech platforms, n8n/Make workflows, and AI Agents via Model Context Protocol (MCP)**.

### Key Features

- **100% Official Government API:** Zero fragile HTML scraping and zero proxy overhead — fast, reliable, structured data straight from `pncp.gov.br`.
- **Active Proposals Mode (`open_proposals`):** Fetch tenders currently accepting bids right now, with automatic `daysUntilDeadline` calculation.
- **Smart Filtering:** Filter by multiple accent-insensitive keywords (`software`, `saúde`, `engenharia`, etc.), Brazilian state (`UF`), modality (`Pregão Eletrônico`, `Dispensa`, `Concorrência`), estimated BRL value range, and buyer CNPJ.
- **Excludes Suspended/Canceled Tenders by Default:** Cleanly skips suspended or annulled notices (`situacaoCompraId != 1`) so your team only sees actionable opportunities.
- **Direct Portal Links:** Every record includes the clickable official PNCP URL (`https://pncp.gov.br/app/editais/{cnpj}/{year}/{seq}`).
- **AI Agent & MCP Ready:** Clean flat JSON schema compatible with `mcp.apify.com` and `maxTotalChargeUsd` budget caps.

### Example Input

```json
{
  "mode": "open_proposals",
  "keywords": ["software", "nuvem", "sistemas"],
  "uf": "SP",
  "modalities": [6, 8],
  "minValueBrl": 50000,
  "onlyActive": true,
  "maxResults": 50
}
```

### Example Output

```json
{
  "pncpControlNumber": "87613535000116-1-000435/2025",
  "status": "Divulgada no PNCP",
  "modality": "Pregão - Eletrônico",
  "buyerCnpj": "87613535000116",
  "buyerName": "MUNICIPIO DE CARAZINHO",
  "stateUf": "RS",
  "municipality": "Carazinho",
  "estimatedValueBrl": 150000.5,
  "proposalClosingDate": "2026-11-28T08:30:00",
  "daysUntilDeadline": 6,
  "objectDescription": "CONTRATAÇÃO DE SOFTWARE EM NUVEM PARA GESTÃO PÚBLICA",
  "pncpPortalUrl": "https://pncp.gov.br/app/editais/87613535000116/2025/435"
}
```

### Pricing (Pay-per-Event)

- **Actor Start:** `$0.005` per run
- **Matching Tender Extracted:** `$0.002` per tender returned (`$2.00` per 1,000 matching tenders)

### Legal & Compliance

This Actor exclusively queries the official, unauthenticated public transparency REST API of Brazil's **Portal Nacional de Contratações Públicas (PNCP)** under Brazilian Federal Law nº 14.133/2021 (Public Procurement Transparency). No private or personal data is collected.

# Actor input Schema

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

Choose 'open_proposals' to fetch tenders currently accepting bids, or 'published' to fetch tenders published in a specific date range.

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

Filter tenders matching ANY of these keywords in the title/object or notes (accent- and case-insensitive). Leave empty to return all matching tenders.

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

Filter by 2-letter Brazilian state code (e.g., SP, RJ, MG, DF). Leave empty for all states.

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

PNCP modality codes to query: 6 = Pregão Eletrônico, 8 = Dispensa de Licitação, 4 = Concorrência Eletrônica, 9 = Inexigibilidade.

## `startDate` (type: `string`):

Used in 'published' mode. Defaults to 7 days ago if empty.

## `endDate` (type: `string`):

In 'open_proposals' mode, maximum proposal closing date (defaults to 60 days ahead). In 'published' mode, end of publication window (defaults to today).

## `minValueBrl` (type: `number`):

Filter tenders with estimated value greater than or equal to this amount in BRL (0 = no minimum).

## `maxValueBrl` (type: `number`):

Filter tenders with estimated value less than or equal to this amount in BRL (0 = no maximum).

## `buyerCnpj` (type: `string`):

14-digit CNPJ of a specific government agency (digits only or formatted).

## `onlyActive` (type: `boolean`):

When enabled, excludes suspended, revoked, or annulled tenders (situacaoCompraId != 1).

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

Maximum number of matching tenders to return.

## `maxPagesPerModality` (type: `integer`):

Safety cap on PNCP API pages scanned per modality (50 records per page).

## Actor input object example

```json
{
  "mode": "open_proposals",
  "keywords": [
    "software",
    "cloud",
    "ti"
  ],
  "uf": "",
  "modalities": [
    6,
    8
  ],
  "startDate": "",
  "endDate": "",
  "minValueBrl": 0,
  "maxValueBrl": 0,
  "buyerCnpj": "",
  "onlyActive": true,
  "maxResults": 50,
  "maxPagesPerModality": 10
}
```

# Actor output Schema

## `tenders` (type: `string`):

No description

## `overview` (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",
        "cloud",
        "ti"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("translucent_paste/pncp-brazil-tenders").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",
        "cloud",
        "ti",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("translucent_paste/pncp-brazil-tenders").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",
    "cloud",
    "ti"
  ]
}' |
apify call translucent_paste/pncp-brazil-tenders --silent --output-dataset

```

## MCP server setup

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

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/iAzGHnZqw8fEiLKCs/builds/6YcIObhVMvzhjBJii/openapi.json
