# Licitações PNCP — Alertas de Novas Licitações (Brasil) (`juanga/pncp-licitacoes-alertas`) Actor

Receba as licitações novas do PNCP (Portal Nacional de Contratações Públicas) que interessam à sua empresa: filtre por palavra-chave, estado, cidade, modalidade e valor. Agende e receba alertas no Telegram, Slack, e-mail via webhook ou planilha.

- **URL**: https://apify.com/juanga/pncp-licitacoes-alertas.md
- **Developed by:** [Juan Gari](https://apify.com/juanga) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 new 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

## Licitações PNCP — Alertas de novas licitações no Brasil

**Receba todo dia as licitações novas que interessam à sua empresa.** O Actor consulta o **PNCP (Portal Nacional de Contratações Públicas)**, a base oficial de todas as contratações públicas do Brasil (federal, estadual e municipal), filtra por **palavra-chave, estado, cidade, modalidade e valor**, e retorna só as licitações que você ainda não viu — no dataset, por API, planilha ou alerta no Telegram, Slack, Discord ou webhook.

*Daily alerts of new Brazilian public tenders from the official PNCP API, filtered by keyword, state, city, modality and value.*

### Para quem é

- **Fornecedores do governo** (limpeza, TI, obras, saúde, alimentação, veículos...) que não podem perder um pregão.
- **Consultorias e assessorias de licitação** que acompanham vários clientes.
- **Analistas de mercado** que medem demanda pública por setor e região.

### Por que este Actor

- **Fonte oficial e completa:** API pública do PNCP, sem scraping de portais. Mais de 2.000 pregões eletrônicos por dia, no Brasil inteiro.
- **Só o que é novo:** cada licitação é retornada uma única vez (memória de 30 dias).
- **Filtros que o PNCP não tem:** palavras-chave no objeto (sem acento/maiúscula), exclusões, faixa de valor estimado e cidades.
- **Link direto para o edital** no PNCP, com datas de abertura e encerramento de propostas.

### Começo rápido

1. Escreva suas **palavras-chave** (ex.: `material de limpeza`, `notebook`, `pavimentação`).
2. Escolha **modalidades** (padrão: Pregão Eletrônico e Concorrência Eletrônica) e, se quiser, **estados**, **cidades** e **valor**.
3. Execute: a primeira execução retorna as licitações de hoje e ontem.
4. Clique em **Schedule** e rode **a cada hora** (ou 2× por dia).

```json
{
  "keywords": ["material de limpeza", "produtos de higiene"],
  "excludeKeywords": ["locação"],
  "modalities": ["6", "4"],
  "states": ["SP", "MG", "RJ"],
  "minValue": 20000
}
```

### Saída

```json
{
  "id": "46634440000100-1-000311/2026",
  "object": "Contratação de empresa especializada para prestação de serviços de limpeza...",
  "agency": "MUNICIPIO DE ITU",
  "agencyCnpj": "46634440000100",
  "state": "SP",
  "city": "Itu",
  "modality": "Pregão - Eletrônico",
  "estimatedValue": 794373.34,
  "status": "Divulgada no PNCP",
  "publishedAt": "2026-11-19T08:27:11",
  "proposalsOpenAt": "2026-11-19T08:30:00",
  "proposalsCloseAt": "2026-12-04T08:50:00",
  "url": "https://pncp.gov.br/app/editais/46634440000100/2026/311",
  "sphere": "Municipal",
  "firstSeenAt": "2026-11-19T14:08:38.000Z"
}
```

Alertas por **Telegram**, **WhatsApp** (grátis via CallMeBot), **e-mail** (o da sua conta Apify), Slack, Discord, webhook ou planilha (integração Google Sheets da Apify).

Cada execução grava também `RUN_SUMMARY`: quantas licitações foram publicadas na janela, quantas passaram nos filtros e quantas eram novas.

### Preço

Pagamento por evento: uma taxa por **licitação nova retornada** e uma taxa mínima de início. Execuções sem licitações novas custam só o início.

### Observações

- A janela padrão é hoje + ontem (horário de Brasília), para não perder publicações da virada do dia.
- A API do PNCP limita consultas muito rápidas; o Actor espera e tenta de novo automaticamente. Uma varredura do Brasil inteiro leva cerca de 4 minutos.
- "Dispensa de Licitação" tem muito volume; use palavras-chave específicas se ativá-la.

Também disponível: [OLX Brasil New Listings Monitor](https://apify.com/juanga/olx-br-new-listings) e [Mercado Libre New Listings Monitor](https://apify.com/juanga/meli-new-listings).

# Actor input Schema

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

A licitação entra se o objeto contém QUALQUER uma destas palavras ou frases (sem diferenciar acentos/maiúsculas; numa frase, todas as palavras precisam aparecer). Vazio = todas.

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

Descarta licitações cujo objeto contém qualquer uma destas palavras.

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

Modalidades a monitorar. Dispensa de Licitação tem muito volume.

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

Vazio = Brasil inteiro.

## `cities` (type: `array`):

Opcional. Nomes de municípios (ex.: Campinas). Vazio = todas.

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

Opcional. Licitações sem valor informado são descartadas quando há mínimo.

## `maxValue` (type: `integer`):

Opcional.

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

Janela de publicação consultada em cada execução: hoje e os N dias anteriores (horário de Brasília). 1 cobre a virada do dia.

## `firstRun` (type: `string`):

O que a primeira execução retorna.

## `stateStoreName` (type: `string`):

Key-value store nomeado que guarda as licitações já retornadas.

## `seenRetentionDays` (type: `integer`):

Por quanto tempo uma licitação retornada é lembrada.

## `failOnAnyError` (type: `boolean`):

Marca a execução como falha se qualquer consulta à API do PNCP falhar.

## `telegramBotToken` (type: `string`):

Crie um bot com o @BotFather.

## `telegramChatId` (type: `string`):

Chat, grupo ou canal onde o bot publica.

## `whatsappPhone` (type: `string`):

Opcional. Recebe os alertas no WhatsApp via CallMeBot (grátis). Número com código do país, ex.: +5511999998888. Ative uma vez enviando "I allow callmebot to send me messages" para +34 644 51 95 23 pelo WhatsApp e cole a API key abaixo.

## `whatsappApiKey` (type: `string`):

A chave que o CallMeBot responde no WhatsApp.

## `emailTo` (type: `string`):

Opcional. Use o e-mail da sua conta Apify: o serviço de e-mail da Apify só envia para o dono da conta. Custo de frações de centavo por envio.

## `slackWebhookUrl` (type: `string`):

Opcional.

## `discordWebhookUrl` (type: `string`):

Opcional.

## `webhookUrl` (type: `string`):

Recebe um POST JSON { count, tenders } com as licitações novas (use com Zapier/Make para e-mail ou planilha).

## Actor input object example

```json
{
  "keywords": [
    "material de limpeza",
    "notebook",
    "software"
  ],
  "modalities": [
    "6",
    "4"
  ],
  "states": [
    "SP",
    "RJ",
    "MG"
  ],
  "lookbackDays": 1,
  "firstRun": "emit",
  "stateStoreName": "pncp-licitacoes-state",
  "seenRetentionDays": 30,
  "failOnAnyError": false
}
```

# Actor output Schema

## `newTenders` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "material de limpeza",
        "notebook",
        "software"
    ],
    "modalities": [
        "6",
        "4"
    ],
    "states": [
        "SP",
        "RJ",
        "MG"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("juanga/pncp-licitacoes-alertas").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": [
        "material de limpeza",
        "notebook",
        "software",
    ],
    "modalities": [
        "6",
        "4",
    ],
    "states": [
        "SP",
        "RJ",
        "MG",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("juanga/pncp-licitacoes-alertas").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": [
    "material de limpeza",
    "notebook",
    "software"
  ],
  "modalities": [
    "6",
    "4"
  ],
  "states": [
    "SP",
    "RJ",
    "MG"
  ]
}' |
apify call juanga/pncp-licitacoes-alertas --silent --output-dataset

```

## MCP server setup

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

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/CAiwYuj5zapDz1Awx/builds/qgeGrMcpi0ItiqEGy/openapi.json
