# Brazilian Public Tenders API — PNCP (structured JSON) (`gemlike_island/radar-editais-pncp`) Actor

Brazilian public tenders API (PNCP / licitações). Query open government procurement tenders as clean, structured JSON — filter by keyword, state (UF) and modality, with built-in dedup returning only new tenders each run. For developers and AI agents building on Brazilian public data. No login.

- **URL**: https://apify.com/gemlike\_island/radar-editais-pncp.md
- **Developed by:** [Matheus Martins](https://apify.com/gemlike_island) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Stats:** 1 total users, 1 monthly users, 0.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

## Brazilian Public Tenders API — PNCP (structured JSON)

**A clean diff feed of open Brazilian public tenders — built for AI agents and developers.**
Query tenders from PNCP (Brazil's official procurement portal, Law 14.133/2021) as structured
JSON. Filter by keyword, state (UF) and modality. Built-in deduplication means each run returns
**only tenders you haven't seen before** — a true diff feed, not a dump.

**Official government source. No login, no credentials, no scraping fragility** — it reads the
official public consultation API.

### Why this Actor
If you're building for the Brazilian public-sector market — a procurement tool, a monitoring
product, a fintech serving suppliers, a proposal-drafting AI agent — you need tender data as a
**reliable, deduplicated feed**, not a website to scrape or a raw API to babysit. This Actor
gives you that feed: paginated, normalized, filtered, deduplicated, schedulable.

**You only pay for new tenders.** Because deduplication is built in, a scheduled daily run
charges you only for tenders that actually entered the system since your last run (see the
Pricing tab for the per-tender event price).

### Use with AI agents (MCP)
This Actor works as a tool for AI agents via the **Apify MCP server** — Claude, Cursor, VS Code
or any MCP-compatible client can discover it, run it and read the results.

**Hosted (recommended):** add `https://mcp.apify.com` as a remote MCP connector in your client
and authorize via OAuth, or point directly at this Actor:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.apify.com/?tools=gemlike_island/radar-editais-pncp",
        "--header",
        "Authorization: Bearer <YOUR_APIFY_API_TOKEN>"
      ]
    }
  }
}
````

Example agent prompts once connected:

- *"Check for new Brazilian public tenders about 'software' in SP and summarize the top 5 by value."*
- *"Run the PNCP tenders tool daily and alert me when a tender over R$1M matches 'oxigênio'."*

This Actor is PPE-priced and runs with limited permissions — the requirements for **agentic
payments** on Apify, so autonomous agents can pay per use.

### What it does

- Fetches contracts with an **open proposal-submission window** from the PNCP consultation API.
- **Filters and ranks by relevance** (accent-insensitive keyword match on object, agency and
  municipality). Higher matches rank first; ties break by soonest deadline.
- **Deduplicates across runs** (state in the Key-Value Store) — each run returns only new tenders.
- Outputs a structured **Dataset** plus a `DIGEST` with the top prioritized items.

### Input

| Field | What it does |
| --- | --- |
| `keywords` | Terms to filter/rank (object, agency, municipality; accent-insensitive). Empty = all open tenders. |
| `modalidades` | PNCP modality codes. `6` = Electronic Auction (Pregão Eletrônico), `8` = Waiver (Dispensa). |
| `ufs` | State codes to monitor (e.g., `SP`, `RJ`). Empty = all states. |
| `minScore` | Minimum fraction of keywords a tender must match (0 = at least one). |
| `onlyNew` | Return only tenders not seen in previous runs (dedup). Keep it on for a clean diff feed. |
| `maxResults`, `pageSize`, `maxPagesPerQuery` | Volume and cost controls. |

#### Example input

```json
{
  "keywords": ["software", "tecnologia da informacao"],
  "modalidades": ["6", "8"],
  "ufs": ["SP", "RJ"],
  "onlyNew": true,
  "maxResults": 200
}
```

#### Example output (one Dataset item per tender)

```json
{
  "id": "00394494000136-1-000090/2024",
  "objeto": "Contratação de serviços de tecnologia da informação",
  "orgao": "MINISTERIO DA JUSTICA E SEGURANCA PUBLICA",
  "orgao_cnpj": "00394494000136",
  "uf": "AL",
  "municipio": "Maceió",
  "modalidade": "Pregão - Eletrônico",
  "valor_estimado": 133931.0,
  "abertura_proposta": "2024-06-25T08:00:00",
  "encerramento_proposta": "2024-07-16T09:00:00",
  "situacao": "Divulgada no PNCP",
  "link": "https://www.gov.br/compras",
  "score": 1.0
}
```

### How to use

1. Set your keywords, states and modalities (or leave empty for everything).
2. Run once — then **schedule it** (Apify Schedule) for a daily diff feed.
3. Consume via API, MCP, webhooks, or export as JSON, CSV, Excel or HTML.

### Pricing model

Pay per event: you are charged **per new tender delivered** to your dataset (see the Pricing
tab for the current price). Repeated tenders are never re-delivered — the built-in dedup keeps
your feed and your bill clean. Platform compute for a typical daily run is a fraction of a cent.

### Limitations

- Ranking is keyword-relevance based, not semantic — LLM summarization per tender is on the
  roadmap (V2).
- Covers the **PNCP**. State portals that don't publish to PNCP are out of scope for now.
- The underlying data is public; the value here is the clean, deduplicated, agent-ready feed —
  not exclusive access.

### Responsible use & compliance

Reads only public, official PNCP data (companies/agencies and administrative acts — no personal
data). It does **not** replace the official consultation and performs **no** bidding or
participation actions — data retrieval and monitoring only.

### FAQ

- **Do I need a token or login for PNCP?** No. The PNCP consultation API is public.
- **How do I get only today's new tenders?** Keep `onlyNew` on — that's the default.
- **Can my AI agent pay for this by itself?** This Actor meets Apify's agentic-payment
  requirements (PPE + limited permissions); see Apify's agentic payments docs for client setup.
- **Can I get tenders opening in the future?** It returns tenders whose proposal window is
  currently open; future-window filtering is a possible extension.

# Actor input Schema

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

Termos para filtrar/ranquear editais (busca no objeto, orgao e municipio; ignora acento/caixa). Vazio = traz todos os editais em aberto.

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

Codigos de modalidade do PNCP. 6 = Pregao Eletronico, 8 = Dispensa. Consulte o Manual de Integracao do PNCP para outros codigos.

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

Siglas dos estados a monitorar (ex.: SP, RJ, BA). Vazio = todas as UFs.

## `minScore` (type: `integer`):

Fracao minima de palavras-chave que o edital precisa casar. 0 = basta casar 1 palavra.

## `onlyNew` (type: `boolean`):

Se ligado, ignora editais ja entregues em execucoes anteriores (estado no Key-Value Store).

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

Numero maximo de editais retornados por execucao.

## `pageSize` (type: `integer`):

Registros por pagina na API do PNCP (max. 500).

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

Limite de paginas por modalidade/UF, para controlar custo de execucao.

## Actor input object example

```json
{
  "keywords": [
    "tecnologia da informacao",
    "software"
  ],
  "modalidades": [
    "6",
    "8"
  ],
  "ufs": [],
  "minScore": 0,
  "onlyNew": true,
  "maxResults": 200,
  "pageSize": 50,
  "maxPagesPerQuery": 10
}
```

# 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": [
        "tecnologia da informacao",
        "software"
    ],
    "modalidades": [
        "6",
        "8"
    ],
    "ufs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("gemlike_island/radar-editais-pncp").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": [
        "tecnologia da informacao",
        "software",
    ],
    "modalidades": [
        "6",
        "8",
    ],
    "ufs": [],
}

# Run the Actor and wait for it to finish
run = client.actor("gemlike_island/radar-editais-pncp").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 '{
  "keywords": [
    "tecnologia da informacao",
    "software"
  ],
  "modalidades": [
    "6",
    "8"
  ],
  "ufs": []
}' |
apify call gemlike_island/radar-editais-pncp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=gemlike_island/radar-editais-pncp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Brazilian Public Tenders API — PNCP (structured JSON)",
        "description": "Brazilian public tenders API (PNCP / licitações). Query open government procurement tenders as clean, structured JSON — filter by keyword, state (UF) and modality, with built-in dedup returning only new tenders each run. For developers and AI agents building on Brazilian public data. No login.",
        "version": "0.0",
        "x-build-id": "hZtHfIfFZ3C7aP0Tv"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/gemlike_island~radar-editais-pncp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-gemlike_island-radar-editais-pncp",
                "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/gemlike_island~radar-editais-pncp/runs": {
            "post": {
                "operationId": "runs-sync-gemlike_island-radar-editais-pncp",
                "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/gemlike_island~radar-editais-pncp/run-sync": {
            "post": {
                "operationId": "run-sync-gemlike_island-radar-editais-pncp",
                "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": {
                    "keywords": {
                        "title": "Palavras-chave",
                        "type": "array",
                        "description": "Termos para filtrar/ranquear editais (busca no objeto, orgao e municipio; ignora acento/caixa). Vazio = traz todos os editais em aberto.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "modalidades": {
                        "title": "Modalidades (codigos PNCP)",
                        "type": "array",
                        "description": "Codigos de modalidade do PNCP. 6 = Pregao Eletronico, 8 = Dispensa. Consulte o Manual de Integracao do PNCP para outros codigos.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "ufs": {
                        "title": "UFs (siglas)",
                        "type": "array",
                        "description": "Siglas dos estados a monitorar (ex.: SP, RJ, BA). Vazio = todas as UFs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "minScore": {
                        "title": "Score minimo de relevancia (0 a 1)",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "integer",
                        "description": "Fracao minima de palavras-chave que o edital precisa casar. 0 = basta casar 1 palavra.",
                        "default": 0
                    },
                    "onlyNew": {
                        "title": "Somente novos (dedup entre execucoes)",
                        "type": "boolean",
                        "description": "Se ligado, ignora editais ja entregues em execucoes anteriores (estado no Key-Value Store).",
                        "default": true
                    },
                    "maxResults": {
                        "title": "Maximo de resultados",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Numero maximo de editais retornados por execucao.",
                        "default": 200
                    },
                    "pageSize": {
                        "title": "Tamanho da pagina (API PNCP)",
                        "minimum": 10,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Registros por pagina na API do PNCP (max. 500).",
                        "default": 50
                    },
                    "maxPagesPerQuery": {
                        "title": "Max. de paginas por consulta",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Limite de paginas por modalidade/UF, para controlar custo de execucao.",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
