# Brazil Public Tenders Feed - Licitações PNCP (no key) (`moment-data/brazil-pncp-tenders-feed`) Actor

New Brazilian government tenders (licitações: pregão, concorrência, dispensa, leilão) and signed public contracts from the official PNCP API. Filter by state, municipality, buyer CNPJ, keyword, value or open deadline. No API key.

- **URL**: https://apify.com/moment-data/brazil-pncp-tenders-feed.md
- **Developed by:** [Luke Miller](https://apify.com/moment-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 tender records

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 Feed — Licitações PNCP (no API key)

Get **new Brazilian government tenders (licitações)** and **signed public contracts** from the official **PNCP – Portal Nacional de Contratações Públicas**, as clean JSON/CSV/Excel. Federal, state and municipal buyers all publish here under Lei 14.133/2021, so one feed covers *pregão eletrônico, concorrência, dispensa (direct purchase with open quotes), leilão (government auctions)*, credenciamento and more — across all 27 states.

No API key, no login, no browser scraping: the Actor calls the public PNCP *API de Consultas* politely and returns the newest records first.

### Who it's for

- **Suppliers and sales teams** selling to Brazilian municipalities, states and federal bodies — get a daily list of open tenders in your states and categories.
- **Bid consultants / licitação assessorias** — monitor many buyers (by CNPJ) or municipalities (IBGE code) in one schedule.
- **Market-intelligence and B2B lead-gen** — contracts show which *companies* just won public money, for how much, and from whom.
- **Journalists, researchers and compliance teams** — track direct purchases (dispensa/inexigibilidade) and large contracts.

### What you get

**Tenders** (`recordType: "tender"`): PNCP id, modality, dispute mode, instrument (edital / aviso de contratação direta), status, buyer CNPJ + name + sphere (Federal/Estadual/Municipal) + power, buying unit, UF, municipality + IBGE code, process number, object (objeto), estimated and awarded value (BRL), price-registration (SRP) flag, legal basis, proposal open/close times, publication date, link to the buyer's bidding system, and the PNCP page.

**Contracts** (`recordType: "contract"`): contract type and number, buyer, supplier **company** CNPJ and name, object, initial and global value, installments, signature and validity dates, PNCP page.

See `sample-output.json` for full examples.

### Quick start

- **Default `{}`** → ~30 of the newest tenders and contracts published today/yesterday (Brasília time), split fairly.
- **Open tenders in São Paulo and Minas over R$100k:**

```json
{ "recordTypes": ["tenders"], "ufs": ["SP", "MG"], "onlyOpen": true, "minValue": 100000, "lookbackDays": 3, "maxItems": 100 }
```

- **Software / IT contracts signed nationwide this week:**

```json
{ "recordTypes": ["contracts"], "keywords": ["software", "licença", "informática"], "lookbackDays": 7, "maxPagesPerQuery": 30 }
```

- **Government auctions (leilões) — vehicles, scrap, property:**

```json
{ "modalities": ["leilaoEletronico", "leilaoPresencial"], "recordTypes": ["tenders"], "lookbackDays": 14 }
```

- **Daily alert:** schedule with `"mode": "sinceLastRun"` and a `stateKey` per saved search; each run only returns records you haven't received yet.

### Inputs

| Field | Meaning |
|---|---|
| `mode` | `window` (default) or `sinceLastRun` (saved state in a named key-value store, per `stateKey`) |
| `recordTypes` | `tenders`, `contracts` |
| `modalities` | pregão, concorrência, dispensa, inexigibilidade, leilão, diálogo competitivo, concurso, credenciamento… (default: pregão eletrônico, concorrência eletrônica, dispensa) |
| `lookbackDays` | publication window, 1–60 days |
| `ufs`, `municipalityIbgeCodes`, `buyerCnpjs`, `spheres` | where / who is buying (ufs and CNPJs are pushed down to the API) |
| `keywords`, `excludeKeywords` | accent-insensitive match on the object |
| `minValue`, `onlyOpen`, `priceRegistrationOnly` | value floor, future proposal deadline only, SRP only |
| `maxItems` | records per run (default 30) |
| `maxPagesPerQuery`, `autoWiden`, `objectChars` | depth, weekend widening, text length |

### Pricing

Pay per event: **$0.005 per run + $0.003 per record**. The default run costs about $0.095. Set a max charge per run in Apify and the Actor stops at that budget.

### Privacy and data quality

- Entity data only. Contracts with **natural-person (CPF) suppliers are skipped entirely**.
- **MEI and person-named firms** (e.g. `12.345.678 FULANO DE TAL`, `MARIA DE SOUZA ME`) have the supplier name and CNPJ withheld (`supplierWithheld: true`) because they identify an individual.
- Contact fields and operator user names are never output; emails, phone numbers and CPF-like numbers in free text are masked.
- Data is exactly what buyers publish to PNCP: values are as declared, some bodies publish late, and sphere/power may be "Não informado".

### Source and licence

PNCP is the official national procurement portal run by the Brazilian federal government (Ministério da Gestão e da Inovação). Its consultation API is public and keyless; procurement information is public under Lei 14.133/2021 art. 174 and the Lei de Acesso à Informação (Lei 12.527/2011), published as open data (dados.gov.br). This Actor is independent and not affiliated with the Brazilian government. Requests are paced (~3 per second max) with back-off on errors.

### FAQ

**Why fewer records on Mondays?** Few bodies publish on weekends; with `autoWiden` (default) the window extends up to 7 days to fill `maxItems`.
**Does it include the edital PDF?** It links to the PNCP page and the buyer's bidding system, where documents are hosted.
**Can I backfill?** Yes — `lookbackDays` up to 60 and raise `maxPagesPerQuery`; filters by UF/CNPJ are pushed to the API, so they're cheap.

# Actor input Schema

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

window (default): records published in the lookback window, no saved state. sinceLastRun: only records not delivered before for this State key; use for daily schedules.

## `recordTypes` (type: `array`):

tenders: new procurement notices (editais / avisos de contratação). contracts: signed contracts and purchase orders (with the supplier company). Max records is split fairly between them.

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

Procurement modalities (Lei 14.133/2021) to query for tenders.

## `lookbackDays` (type: `integer`):

Publication-date window in Brasília time (today and the previous days). Also the first-run window in sinceLastRun mode.

## `ufs` (type: `array`):

Buyer's state, 2-letter codes, e.g. SP, RJ, MG, PR, DF. Empty = all of Brazil.

## `municipalityIbgeCodes` (type: `array`):

7-digit IBGE municipality codes of the buying unit, e.g. 3550308 (São Paulo), 3304557 (Rio de Janeiro).

## `buyerCnpjs` (type: `array`):

14-digit CNPJs of public bodies to follow (digits only or formatted).

## `spheres` (type: `array`):

Empty = all.

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

Keep records whose object (objeto) contains any of these words; accent- and case-insensitive, e.g. 'merenda', 'software', 'evento', 'pavimentação'.

## `excludeKeywords` (type: `array`):

Drop records whose object contains any of these words.

## `minValue` (type: `integer`):

Tenders: estimated total value; contracts: global value. Records without a value are dropped when set.

## `onlyOpen` (type: `boolean`):

Keep only tenders whose proposal deadline is in the future (drops contracts).

## `priceRegistrationOnly` (type: `boolean`):

Keep only tenders under the Sistema de Registro de Preços (framework / ata de registro de preços).

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

Maximum records delivered (and charged) per run, newest first.

## `objectChars` (type: `integer`):

Characters of the object description kept (emails, phones and CPFs masked).

## `maxPagesPerQuery` (type: `integer`):

Safety cap: pages of 50 records read per modality / contract query (newest pages first). Raise for big backfills with client-side filters.

## `autoWiden` (type: `boolean`):

Window mode only: if the window has fewer than Max records (weekends, early morning), look back up to 7 days.

## `stateKey` (type: `string`):

Only for sinceLastRun: separate saved state per saved search, e.g. 'sp-software'.

## Actor input object example

```json
{
  "mode": "window",
  "recordTypes": [
    "tenders",
    "contracts"
  ],
  "modalities": [
    "pregaoEletronico",
    "concorrenciaEletronica",
    "dispensa"
  ],
  "lookbackDays": 2,
  "ufs": [],
  "municipalityIbgeCodes": [],
  "buyerCnpjs": [],
  "spheres": [],
  "keywords": [],
  "excludeKeywords": [],
  "onlyOpen": false,
  "priceRegistrationOnly": false,
  "maxItems": 30,
  "objectChars": 1000,
  "maxPagesPerQuery": 10,
  "autoWiden": true,
  "stateKey": "default"
}
```

# Actor output Schema

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

One record per PNCP tender or contract.

## `summary` (type: `string`):

Windows, queries, filters dropped, suppliers withheld.

# 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 = {
    "ufs": [],
    "keywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("moment-data/brazil-pncp-tenders-feed").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 = {
    "ufs": [],
    "keywords": [],
}

# Run the Actor and wait for it to finish
run = client.actor("moment-data/brazil-pncp-tenders-feed").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 '{
  "ufs": [],
  "keywords": []
}' |
apify call moment-data/brazil-pncp-tenders-feed --silent --output-dataset

```

## MCP server setup

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

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/RDJ6dm7UkWbM7bzln/builds/RaaPrYiJOP8uy8DgO/openapi.json
