# PNCP Brazil Public Tenders Scraper (Licitações) (`cvillasanti/pncp-brazil-tenders`) Actor

Search Brazilian public tenders from PNCP by keyword, state, modality and date. Get value, deadlines, buyer, line items and documents as clean JSON.

- **URL**: https://apify.com/cvillasanti/pncp-brazil-tenders.md
- **Developed by:** [Ciro Villasanti](https://apify.com/cvillasanti) (community)
- **Categories:** Lead generation, Business
- **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 tenders

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 Tenders Scraper (Licitações, Pregões, Editais)

Search **Brazilian public tenders** published on **PNCP – Portal Nacional de Contratações Públicas**, the official national procurement portal created by Law 14.133/2021. Every federal, state and municipal agency in Brazil must publish its tenders there, so one search covers the whole country.

Filter by **keyword, state (UF), city, modality, government sphere and publication date**, and get clean JSON with the **estimated value, proposal deadline, buyer CNPJ, line items with quantities and unit prices, and links to the edital PDFs**.

- ✅ Uses PNCP's official public data: no login, no captcha, no browser.
- ✅ Lightweight and cheap: plain HTTP requests, 128 MB of memory, automatic retries and rate-limit handling.
- ✅ Built for AI agents and MCP: predictable flat fields with English names and the full JSON schema published.
- ✅ Daily monitoring out of the box with `publishedInLastDays` and Apify Schedules.

### What data does it extract?

| Field | Example |
|---|---|
| Tender ID (`pncpId`) and link | `00394502000144-1-017129/2026` |
| Object (what is being bought) | `Equipamentos de informática e audiovisuais` |
| Modality and dispute mode | `Pregão - Eletrônico`, `Aberto` |
| Buyer name, CNPJ, unit, sphere, city, UF | `COMANDO DA MARINHA`, `00394502000144`, `São Luís`, `MA` |
| Estimated and awarded value (BRL) | `64993.52` |
| Proposal opening and closing dates | `2026-11-26T08:00:00` |
| Legal basis, SRP flag, process number | `Lei 14.133/2021, Art. 75, II` |
| **Line items** (optional) | description, quantity, unit, estimated unit/total price, ME/EPP benefit, NCM code |
| **Documents** (optional) | edital, termo de referência, annexes with direct download URLs |

### Use cases

- **B2G sales leads:** get every open tender for your product ("notebook", "uniforme", "merenda escolar") in your states every morning.
- **Price intelligence:** compare the estimated unit prices that agencies pay for the same item across Brazil.
- **Market sizing:** measure how much each state or city plans to spend in a category.
- **Bid/no-bid automation:** feed items and edital PDFs to your own AI agent to decide which tenders to bid on.
- **Compliance and journalism:** track direct purchases (Dispensa, Inexigibilidade) by agency.

### Input examples

**Open IT tenders in São Paulo and Minas Gerais, with items and documents:**

```json
{
    "keywords": ["notebook", "computador"],
    "status": "open",
    "states": ["SP", "MG"],
    "includeItems": true,
    "includeDocuments": true,
    "maxItems": 200
}
```

**Daily monitor of every new Pregão Eletrônico from municipalities (run on a daily schedule):**

```json
{
    "status": "all",
    "modalityIds": ["6"],
    "spheres": ["M"],
    "publishedInLastDays": 1,
    "maxItems": 5000
}
```

**Everything a single city published in a date range:**

```json
{
    "status": "all",
    "cityIbgeCodes": ["3550308"],
    "publishedFrom": "2026-11-01",
    "publishedTo": "2026-11-20",
    "maxItems": 1000
}
```

#### Input fields

| Field | Description |
|---|---|
| `keywords` | Full-text search terms in Portuguese. Each one runs as its own search, and duplicate tenders are removed. |
| `status` | `open` (receiving proposals, the default), `closed` or `all`. |
| `states` | UF codes such as `SP`, `RJ` or `MG`. |
| `modalityIds` | `6` Pregão Eletrônico, `8` Dispensa, `9` Inexigibilidade, `4` Concorrência Eletrônica, and so on. The input form lists all 20. |
| `spheres` | `F` Federal, `E` Estadual, `M` Municipal, `D` Distrital. |
| `cityIbgeCodes` | 7-digit IBGE municipality codes. |
| `publishedInLastDays` | Relative date filter, the best choice for scheduled runs. |
| `publishedFrom` / `publishedTo` | Absolute date filter in `YYYY-MM-DD`. |
| `includeItems` / `includeDocuments` | Add line items and attached files. |
| `maxItems` | Maximum number of tenders to save. |
| `proxyConfiguration` | Optional Apify Proxy, for faster large runs. |

### Output example

```json
{
    "pncpId": "00394502000144-1-017129/2026",
    "url": "https://pncp.gov.br/app/editais/00394502000144/2026/17129",
    "title": "Aviso de Contratação Direta nº 35/2026",
    "object": "Equipamentos de informática e audiovisuais para CPMA e AgImperatriz.",
    "additionalInfo": null,
    "status": "Divulgada no PNCP",
    "isCancelled": false,
    "modalityId": 8,
    "modality": "Dispensa",
    "disputeMode": "Dispensa Com Disputa",
    "instrumentType": "Aviso de Contratação Direta",
    "legalBasis": "Lei 14.133/2021, Art. 75, II",
    "isPriceRegistration": false,
    "processNumber": "63036.002724/2026-48",
    "buyerCnpj": "00394502000144",
    "buyerName": "COMANDO DA MARINHA",
    "buyerUnitCode": "784320",
    "buyerUnitName": "CAPITANIA DOS PORTOS DO ESTADO DO MARANHAO",
    "sphere": "Federal",
    "branch": "Executivo",
    "city": "São Luís",
    "cityIbgeCode": "2111300",
    "state": "MA",
    "estimatedValue": 64993.52,
    "awardedValue": null,
    "hasResult": false,
    "publishedAt": "2026-11-22T12:14:46.056391",
    "updatedAt": "2026-11-22T12:14:46.056391",
    "proposalsOpenAt": "2026-11-23T08:00:00",
    "proposalsCloseAt": "2026-11-26T08:00:00",
    "sourceSystemUrl": "https://cnetmobile.estaleiro.serpro.gov.br/comprasnet-web/public/compras/acompanhamento-compra?compra=78432006000352026",
    "items": [
        {
            "itemNumber": 1,
            "description": "Microcomputador Tipo Desktop completo, acompanhado de monitor LED de 19 polegadas, teclado e mouse...",
            "type": "Material",
            "quantity": 8,
            "unit": "Unidade",
            "estimatedUnitPrice": 1868,
            "estimatedTotalPrice": 14944,
            "awardCriterion": "Menor preço",
            "smallBusinessBenefit": "Participação exclusiva para ME/EPP",
            "status": "Em andamento",
            "ncmNbsCode": "84714900",
            "hasResult": false
        }
    ],
    "documents": [
        {
            "title": "Termo_de_Referencia.pdf",
            "type": "Termo de Referência",
            "url": "https://pncp.gov.br/pncp-api/v1/orgaos/00394502000144/compras/2026/17129/arquivos/2",
            "publishedAt": "2026-11-22T12:14:47"
        }
    ]
}
```

Dates are in Brasília time, as published by PNCP. Values are in BRL. A value is `null` when the agency keeps the budget confidential (*orçamento sigiloso*).

### Pricing

Pay per event: you pay only for tenders saved to the dataset.

| Event | When it is charged |
|---|---|
| `tender` | Once for every tender saved. |
| `tender-details` | Once per tender, and only when `includeItems` or `includeDocuments` is on. |

Set a **maximum cost per run** in the run options and the Actor stops cleanly when it reaches it.

### Tips and limits

- PNCP returns at most **10,000 results per search**. For larger exports, split the run by state, modality or date range.
- PNCP limits how fast a single IP can read tender details, so the Actor paces itself (about 15–20 tenders per minute). For big exports, enable **Apify Proxy** in the Advanced section to spread the load across several IPs and speed it up.
- Use **Schedules** with `publishedInLastDays: 1` and an integration (webhook, Google Sheets, Slack, Zapier, Make) to get a daily feed of new tenders.

### Use it from the API

Run the Actor and get the results in one call. This endpoint waits up to 5 minutes, so use the Python client below for longer runs:

```bash
curl -X POST "https://api.apify.com/v2/acts/cvillasanti~pncp-brazil-tenders/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["notebook", "computador"], "status": "open", "states": ["SP", "MG"], "includeItems": true, "includeDocuments": true, "maxItems": 200}'
```

Or with the Python client (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("cvillasanti/pncp-brazil-tenders").call(run_input={
    "keywords": [
        "notebook",
        "computador"
    ],
    "status": "open",
    "states": [
        "SP",
        "MG"
    ],
    "includeItems": True,
    "includeDocuments": True,
    "maxItems": 200
})
for item in client.dataset(run["default_dataset_id"]).iterate_items():
    print(item)
```

It also works from Make, Zapier, n8n, Google Sheets and any AI agent through the [Apify MCP server](https://mcp.apify.com).

### FAQ

**Is this legal?** Yes. PNCP data is public by law (Lei 14.133/2021 and Lei de Acesso à Informação), and this Actor reads PNCP's public endpoints at a polite request rate.

**Does it include results and winners?** It includes the awarded value (`awardedValue`) and the `hasResult` flag at tender level.

**Can I use it from an AI agent?** Yes. Call it through the Apify MCP server or the API. The input and output schemas are fully described, so agents can build queries on their own.

### Em português

**Licitações do PNCP (Portal Nacional de Contratações Públicas)** em JSON, CSV ou Excel: pregões, dispensas, concorrências e inexigibilidades de órgãos federais, estaduais e municipais. Filtre por palavra-chave, UF, município, modalidade e situação, e receba órgão, CNPJ, objeto, valor estimado, datas de abertura e encerramento, itens e links para o edital e anexos. Ideal para empresas que vendem para o governo e para monitoramento diário de novas licitações.

# Actor input Schema

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

Full-text search terms, in Portuguese (e.g. "notebook", "ar condicionado", "merenda escolar"). Each keyword runs as a separate search and results are de-duplicated. Leave empty to list every tender that matches the other filters.

## `status` (type: `string`):

"open" = currently receiving proposals; "closed" = proposal period ended; "all" = both.

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

Filter by Brazilian state of the buying agency. Leave empty for all states.

## `modalityIds` (type: `array`):

Filter by procurement modality under Law 14.133/2021 (e.g. Pregão Eletrônico, Dispensa). Leave empty for all.

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

Filter by government level of the buyer. Leave empty for all.

## `cityIbgeCodes` (type: `array`):

Filter by buyer city using 7-digit IBGE municipality codes (e.g. 3550308 = São Paulo, 3304557 = Rio de Janeiro).

## `publishedInLastDays` (type: `integer`):

Only tenders published on PNCP within the last N days. Best option for scheduled daily monitoring. Overrides "Published from".

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

Only tenders published on or after this date (YYYY-MM-DD).

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

Only tenders published on or before this date (YYYY-MM-DD).

## `includeItems` (type: `boolean`):

Adds every item of the tender: description, quantity, unit, estimated unit and total price, award criterion, ME/EPP benefit and NCM code. Charged as an extra "tender-details" event.

## `includeDocuments` (type: `boolean`):

Adds the list of attached files (edital, termo de referência, etc.) with direct download URLs. Charged as an extra "tender-details" event (charged once even if items are also included).

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

Maximum number of tenders to save across all keywords. PNCP returns at most 10,000 results per individual search.

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

Optional. PNCP rate-limits requests per IP; the Actor already paces itself, but routing through Apify Proxy spreads the load across IPs and speeds up large runs with items and documents.

## Actor input object example

```json
{
  "keywords": [
    "notebook",
    "ar condicionado"
  ],
  "status": "open",
  "states": [
    "SP",
    "RJ"
  ],
  "modalityIds": [
    "6",
    "8"
  ],
  "cityIbgeCodes": [
    "3550308"
  ],
  "includeItems": false,
  "includeDocuments": false,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All tenders with buyer, values, deadlines and, if requested, line items and documents.

## `items` (type: `string`):

One row per tender line item. Empty unless includeItems is on.

# 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": [
        "notebook"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cvillasanti/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": ["notebook"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("cvillasanti/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": [
    "notebook"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call cvillasanti/pncp-brazil-tenders --silent --output-dataset

```

## MCP server setup

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