# PNCP Brazil — Tender Results & Winners (per item) (`licita-dados-brasil/pncp-resultados-licitacoes`) Actor

Extracts winners, homologated values, discounts and rankings per item from Brazil's public procurement portal (PNCP) — data the official consultation API does not expose.

- **URL**: https://apify.com/licita-dados-brasil/pncp-resultados-licitacoes.md
- **Developed by:** [Licita Dados Brasil](https://apify.com/licita-dados-brasil) (community)
- **Categories:** AI, Automation, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## PNCP Brazil — Tender Results & Winners (per item)

Extracts **who won each item of Brazilian public tenders** — winning supplier (with CNPJ), homologated values, discount over the estimate and ranking — from **PNCP** (Portal Nacional de Contratações Públicas), the mandatory procurement portal under Brazil's procurement law (Lei 14.133/2021).

**Why this Actor exists:** PNCP's official consultation API exposes tender notices, minutes and contracts — but **not per-item results**. The most valuable layer of the data (who actually won, at which price, with how much discount) is only reachable through the portal's internal endpoints. This Actor extracts exactly that layer, normalized into one flat row per **tender × item × supplier**, ready for analysis or ingestion.

### Sample output (real data)

```json
{
  "numeroControlePNCP": "46374500000194-1-004195/2026",
  "dataPublicacaoPncp": "2026-06-01T07:00:18",
  "modalidade": "Pregão - Eletrônico",
  "orgaoCnpj": "46374500000194",
  "orgaoRazaoSocial": "SECRETARIA DE ESTADO DA SAUDE",
  "esfera": "E",
  "municipio": "São Paulo",
  "uf": "SP",
  "objetoCompra": "Aquisição de Medicamentos de Óleo de Papoula a Vimblastina",
  "numeroItem": 2,
  "itemDescricao": "Bupivacaína Cloridrato",
  "itemQuantidade": 200,
  "itemValorUnitarioEstimado": 23.99,
  "situacaoItem": "Homologado",
  "fornecedorNi": "44734671002286",
  "fornecedorNome": "CRISTALIA PRODUTOS QUIMICOS FARMACEUTICOS LTDA",
  "quantidadeHomologada": 200,
  "valorUnitarioHomologado": 21,
  "valorTotalHomologado": 4200,
  "percentualDesconto": 0,
  "dataResultado": "2026-06-30"
}
````

### Output fields

| Group | Fields |
|---|---|
| **Tender** | `numeroControlePNCP`, `dataPublicacaoPncp`, `modalidade`, `situacaoCompra`, buyer (`orgaoCnpj`, `orgaoRazaoSocial`, `esfera`, `unidade`), `municipio`, `uf`, `codigoIbge`, `objetoCompra`, `valorTotalEstimadoCompra` |
| **Item** | `numeroItem`, `itemDescricao`, `itemQuantidade`, `itemValorUnitarioEstimado`, `itemValorTotalEstimado`, `criterioJulgamento`, `situacaoItem` |
| **Result** | `fornecedorNi` (CNPJ/CPF), `fornecedorNome`, `fornecedorTipoPessoa`, `fornecedorPorteId`, `quantidadeHomologada`, `valorUnitarioHomologado`, `valorTotalHomologado`, **`percentualDesconto`**, `ordemClassificacaoSrp`, `dataResultado`, `situacaoResultadoNome` |

One row per tender × item × winning/ranked supplier. Export as JSON, CSV or Excel straight from the dataset, or pull via the Apify API.

### Input

| Field | Default | Notes |
|---|---|---|
| `dataInicial` / `dataFinal` | **35 days ago** (single day) | Publication window, `AAAAMMDD`. Results (homologation) lag publication by **weeks** — recent windows return few or no rows. |
| `modalidades` | `[6]` | PNCP modality codes: `6` = pregão eletrônico (electronic reverse auction), `8` = dispensa, `4` = concorrência eletrônica… |
| `uf` | — | Optional state filter (e.g. `SP`). |
| `somenteComResultado` | `true` | Skip items still in dispute. |
| `maxCompras` | `100` (UI prefill) | Keeps example runs fast. Set `0` — or omit the field via API/schedule — for unlimited full-day runs. |
| `concurrency` | `6` | Parallel fetches; keep polite (≤ 10). |

### Daily results feed (recommended setup)

Because homologation lags publication, the Actor's default window is **the publication day 35 days ago**. Schedule a **daily run with the default input** and you get a rolling feed: each day delivers the results of tenders published exactly 35 days earlier — no gaps, no duplicates.

Backfill: run once per past day (e.g. loop `dataInicial = dataFinal` over the last 6 months) to build a historical base of homologated prices.

### Use cases

- **Bid-intelligence SaaS** — enrich tender alerts with "who wins what, at which price": competitor analysis your users can't get from the official API.
- **Suppliers to government** — monitor rivals' wins, prices and discounts in your category and region.
- **Consultancies & market research** — homologated price series per product, buyer or region.
- **Journalism & accountability** — concentration of wins per supplier per municipality, discount anomalies.

### Volume expectations

A single publication day of pregão eletrônico typically yields **hundreds to a few thousand** result rows nationwide (e.g. a test run capped at 50 tenders returned 408 rows in ~75 s). Use `uf` and `modalidades` to narrow scope.

### Legal & fair use

- Data is **public by law** (transparency mandate of Lei 14.133/2021, arts. 54 and 174) and served by a government portal.
- The Actor collects **no personal data** — only companies (CNPJ) and public bodies.
- Polite rate limits are applied by default; keep `concurrency` ≤ 10.

### FAQ

**Why do I get 0 results for yesterday's date?**
Results are published weeks after the tender notice. Query publication dates ≥ ~30 days old (the default does this for you).

**Does it cover all of Brazil?**
Yes — PNCP is mandatory for federal, state and municipal bodies under Lei 14.133/2021. Filter by `uf` if you only need one state.

**What about tenders without a winner yet?**
With `somenteComResultado: true` (default) they are skipped; set it to `false` to also list items still in dispute.

**Can I get the data delivered automatically?**
Yes — schedule the Actor and consume the dataset via the Apify API, webhooks or scheduled exports (CSV/JSON/Excel).

***

### 🇧🇷 PT-BR — Resultados de licitações do PNCP, por item

Este Actor extrai **quem venceu cada item de cada licitação** publicada no PNCP (Portal Nacional de Contratações Públicas): fornecedor vencedor (CNPJ e razão social), quantidade e valores **homologados**, **desconto sobre o valor estimado** e classificação (SRP) — a camada que a API oficial de consulta do PNCP **não expõe**.

Saída: uma linha por **compra × item × fornecedor**, exportável em CSV, JSON ou Excel direto do dataset, ou via API da Apify.

#### Para que serve

- **Plataformas de licitação**: enriquecer alertas com "quem ganha o quê, a que preço" — análise de concorrentes que seus usuários não encontram na API oficial;
- **Fornecedores do governo**: monitorar vitórias, preços e descontos dos concorrentes na sua categoria/região;
- **Consultorias e pesquisa**: série histórica de preços homologados por produto, órgão ou região;
- **Jornalismo e controle social**: concentração de vitórias por fornecedor e município, anomalias de desconto.

#### Como usar (feed diário)

A homologação sai **semanas depois** da publicação do edital — por isso consultar datas recentes retorna pouco ou nada. O padrão do Actor busca as publicações de **35 dias atrás** (1 dia por execução):

- **Agende uma execução diária com o input padrão** → feed rolante de resultados já homologados, sem buracos e sem duplicatas;
- **Histórico (backfill)**: rode uma vez por dia passado (`dataInicial = dataFinal`) para montar a base retroativa;
- Filtre por estado (`uf`) ou modalidade (`modalidades`: `6` = pregão eletrônico, `8` = dispensa…).

#### Perguntas frequentes

**Por que a data de ontem retorna 0 resultados?** Porque o resultado sai semanas após a publicação. Consulte datas com ≥ 30 dias (o padrão já faz isso).

**Cobre o Brasil todo?** Sim — o PNCP é obrigatório para União, estados e municípios (Lei 14.133/2021).

**É legal?** Os dados são públicos por força de lei (arts. 54 e 174 da Lei 14.133/2021), servidos por portal do governo. Nenhum dado pessoal é coletado (apenas CNPJs e órgãos públicos) e o Actor aplica limites educados de requisição.

# Actor input Schema

## `dataInicial` (type: `string`):

Publication window start, format 20260601. Default: 35 days ago — results (homologation) lag publication by weeks, so recent windows return few or no rows.

## `dataFinal` (type: `string`):

Publication window end. Default: 35 days ago (same day as start — daily scheduled runs then form a rolling results feed).

## `modalidades` (type: `array`):

6 = Pregão Eletrônico (default), 8 = Dispensa, 4 = Concorrência Eletrônica…

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

Optional two-letter state filter, e.g. SP

## `maxCompras` (type: `integer`):

Prefilled to 100 so example runs finish in a couple of minutes. Set 0 (or omit the field when calling via API/schedule) for unlimited full-day production runs.

## `somenteComResultado` (type: `boolean`):

Skip items still in dispute (default true).

## `concurrency` (type: `integer`):

Parallel tender fetches. Keep polite (≤ 10).

## Actor input object example

```json
{
  "modalidades": [
    6
  ],
  "maxCompras": 100,
  "somenteComResultado": true,
  "concurrency": 6
}
```

# Actor output Schema

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

All extracted results as JSON; append ?format=csv or ?format=xlsx for other formats.

# 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("licita-dados-brasil/pncp-resultados-licitacoes").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("licita-dados-brasil/pncp-resultados-licitacoes").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 licita-dados-brasil/pncp-resultados-licitacoes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=licita-dados-brasil/pncp-resultados-licitacoes",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PNCP Brazil — Tender Results & Winners (per item)",
        "description": "Extracts winners, homologated values, discounts and rankings per item from Brazil's public procurement portal (PNCP) — data the official consultation API does not expose.",
        "version": "0.1",
        "x-build-id": "NEXjqbIuDv1YDI3Ay"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/licita-dados-brasil~pncp-resultados-licitacoes/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-licita-dados-brasil-pncp-resultados-licitacoes",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/licita-dados-brasil~pncp-resultados-licitacoes/runs": {
            "post": {
                "operationId": "runs-sync-licita-dados-brasil-pncp-resultados-licitacoes",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/licita-dados-brasil~pncp-resultados-licitacoes/run-sync": {
            "post": {
                "operationId": "run-sync-licita-dados-brasil-pncp-resultados-licitacoes",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "dataInicial": {
                        "title": "Start date (AAAAMMDD)",
                        "pattern": "^[0-9]{8}$",
                        "type": "string",
                        "description": "Publication window start, format 20260601. Default: 35 days ago — results (homologation) lag publication by weeks, so recent windows return few or no rows."
                    },
                    "dataFinal": {
                        "title": "End date (AAAAMMDD)",
                        "pattern": "^[0-9]{8}$",
                        "type": "string",
                        "description": "Publication window end. Default: 35 days ago (same day as start — daily scheduled runs then form a rolling results feed)."
                    },
                    "modalidades": {
                        "title": "Modalidades (PNCP codes)",
                        "type": "array",
                        "description": "6 = Pregão Eletrônico (default), 8 = Dispensa, 4 = Concorrência Eletrônica…",
                        "default": [
                            6
                        ]
                    },
                    "uf": {
                        "title": "UF filter",
                        "type": "string",
                        "description": "Optional two-letter state filter, e.g. SP"
                    },
                    "maxCompras": {
                        "title": "Max tenders to scan",
                        "type": "integer",
                        "description": "Prefilled to 100 so example runs finish in a couple of minutes. Set 0 (or omit the field when calling via API/schedule) for unlimited full-day production runs.",
                        "default": 100
                    },
                    "somenteComResultado": {
                        "title": "Only items with results",
                        "type": "boolean",
                        "description": "Skip items still in dispute (default true).",
                        "default": true
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "type": "integer",
                        "description": "Parallel tender fetches. Keep polite (≤ 10).",
                        "default": 6
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
