# RFP, Tender & Auction PDF Analyzer (SAM.gov, PNCP, Caixa) MCP (`cleanpipe/edital-intel`) Actor

Audit full RFP, tender & auction document packs (SAM.gov, PNCP, Caixa, or any PDF/DOCX/ZIP URLs) via Remote MCP & REST API. Extracts requirements, deadlines & red flags with verified page-level citations. Link-only notices or failed runs charge $0.

- **URL**: https://apify.com/cleanpipe/edital-intel.md
- **Developed by:** [CleanPipe Labs](https://apify.com/cleanpipe) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## RFP, Tender & Auction Deep Document Analyzer (SAM.gov, PNCP, Caixa) — MCP & API

[Versão em Português abaixo](#portugues)

Most government procurement and auction scrapers stop at shallow metadata — leaving you or your AI agents to manually download and read 100+ page PDFs, ZIP bundles, and scanned legal deeds.

**Edital Intel** solves the **document intelligence last mile**: it downloads the full document pack (RFPs, terms of reference, addenda, real estate deeds), extracts structured requirements, deadlines, line items, and **red flags** as clean JSON — with **deterministically verified, page-level citations** (`arquivo_origem`, `pagina`, and verbatim `trecho_literal` checked against the source corpus to prevent LLM hallucinations).

Built as a **Multi-Tenant Standby Actor** exposing both a **Remote MCP Server** (`/mcp`, Streamable HTTP) and **REST API** (`/v1/*`) with transparent **Pay-Per-Event (PPE)** billing — no browser bloat, no hidden compute fees.

***

### Why Use This Actor Instead of Basic Scrapers?

- **Reads the Full Pack, Not Just Metadata:** Automatically unpacks `.zip` archives, parses digital `.pdf` and `.docx` files, and runs selective parallel multimodal OCR on scanned pages (up to 20 scanned pages per pack).
- **Anti-Hallucination Citation Audit:** Every extracted requirement, deadline, debt, or red flag includes its exact source filename, page number, and literal quote — deterministically audited in Python before the response is returned (measured **92.6%–100% verified citations** across live government tenders and auction packs).
- **Universal URL Mode (`analyze_url_pack`):** Already scraping SAM.gov, TED, or private auction portals? Pass any list of direct PDF/DOCX/ZIP URLs with `vertical="federal"`, `"licitacao"`, or `"leilao"` to audit them on demand.
- **Addenda & Revision Tracking (`get_document_diff`):** Hashes every file (`sha256`) and computes real diffs across document versions (added, removed, or modified files + changed deadlines) at **$0 cost**.
- **Two-Stage Semantic Caching:** Shared hash-based caching returns repeat analyses in milliseconds and cuts token overhead by over 90% when auditing multiple lots from the same master auction notice.
- **Zero-Waste Billing Policy:** If a listing has no downloadable documents (e.g., SAM.gov external link-only notices such as DIBBS) or an upstream LLM error causes a degraded response, **you are charged $0.00**.

***

### Supported Verticals & Sources

| Vertical (`vertical`) | Built-in Sources (`fonte`) | What Gets Extracted |
| :--- | :--- | :--- |
| **`federal`** | `samgov`, `url_list` | US federal RFPs/solicitations: set-asides (`8(a)`, `HUBZone`, `SDVOSB`), NAICS/PSC codes, bonding requirements, FAR/DFARS compliance clauses, deadlines, and restrictive red flags. |
| **`leilao`** | `caixa`, `url_list` | Brazilian real estate & vehicle auctions (Caixa Econômica Federal master notice + property deed/*matrícula*): appraisal vs. minimum bid, occupancy status (`imovel_ocupado`), usufruct/liens (`usufruto_ou_direitos`), *propter rem* debts (HOA/IPTU), pending lawsuits, and bidder conditions. |
| **`licitacao`** | `pncp`, `url_list` | Brazilian public tenders (PNCP / Lei 14.133/2021): executive summary, critical deadlines, technical qualification requirements, warranty/bid bond rules, mandatory site visits, and restrictive clauses. |

***

### Transparent Pay-Per-Event (PPE) Pricing

Runs in **Multi-Tenant Standby mode** — you pay **only** for successful PPE events below. No separate platform compute surprises.

| PPE Event | Price (USD) | Triggered By |
| :--- | :---: | :--- |
| **`opportunity-search`** | **$0.10** / request (up to 500 open opportunities) | `search_opportunities` / `POST /v1/search` (open opportunities search) |
| **`eligibility-match`** | **$0.15** / call | `check_company_eligibility` / `POST /v1/eligibility` (company profile vs. tender rules) |
| **`edital-deep-analysis`** | **$0.25** / pack | `analyze_document_pack` or `analyze_url_pack` (up to 120 pages) |
| **`large-pack-analysis`** | **$0.60** / pack | `analyze_document_pack` or `analyze_url_pack` (121 to 300 pages) |
| **`auction-lot-analysis`** | **$0.75** / lot | Deep auction lot audit (`vertical="leilao"` — master notice + property deed/*matrícula*) |
| **`get_document_diff`** | **Free ($0.00)** | Revision diff against previously analyzed document pack hashes |

*Typical workflow cost: searching 100 opportunities ($0.10) + auditing 1 full tender PDF pack ($0.25) = **$0.35 total**.*

***

### Connect as a Remote MCP Server (Claude, Cursor, AI Agents)

This Actor exposes a Streamable HTTP MCP server ready for autonomous agents and IDEs:

**Endpoint URL:**

```text
https://cleanpipe--edital-intel.apify.actor/mcp
```

#### MCP Client Configuration (Claude Desktop / Cursor)

```json
{
  "mcpServers": {
    "edital-intel": {
      "url": "https://cleanpipe--edital-intel.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_API_TOKEN>"
      }
    }
  }
}
```

#### Available MCP Tools

1. **`search_opportunities`** — Find open public tenders by state (`uf`), modality, and time window.
2. **`analyze_document_pack`** — Download and audit full tender or auction document packs with verified page-level citations.
3. **`analyze_url_pack`** — Run the same structured audit + citation verification on any list of arbitrary PDF/DOCX/ZIP URLs (ideal for SAM.gov attachments, EU TED notices, or private auction portals).
4. **`check_company_eligibility`** — Cross-check a company profile (NAICS/CNAE, size, past performance/certificates) against extracted solicitation requirements.
5. **`get_document_diff`** — Free diff comparing document additions, removals, file changes, and updated deadlines across revisions.

***

### REST API Usage Examples (`/v1/*`)

Base URL: `https://cleanpipe--edital-intel.apify.actor`
Include header: `Authorization: Bearer <YOUR_APIFY_API_TOKEN>`

#### 1. Audit US Federal RFP / Arbitrary URLs (`vertical: "federal"`)

Chain any SAM.gov scraper's `resourceLinks` or direct RFP PDFs into `POST /v1/analyze_urls`:

```bash
curl -X POST "https://cleanpipe--edital-intel.apify.actor/v1/analyze_urls" \
  -H "Authorization: Bearer <YOUR_APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.gov/solicitations/RFP-2026-0042.pdf",
      "https://example.gov/solicitations/Attachment-A-SOW.pdf"
    ],
    "vertical": "federal",
    "pack_id": "rfp-2026-0042"
  }'
```

Or resolve directly by SAM.gov `notice_id`:

```bash
curl -X POST "https://cleanpipe--edital-intel.apify.actor/v1/analyze_urls" \
  -H "Authorization: Bearer <YOUR_APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "fonte": "samgov",
    "ref": { "notice_id": "YOUR_SAM_NOTICE_ID" },
    "vertical": "federal"
  }'
```

#### 2. Audit a Caixa Real Estate Auction Lot (`vertical: "leilao"`)

Downloads both the master auction notice (*edital*) and the property deed (*matrícula*) via lightweight HTTP:

```bash
curl -X POST "https://cleanpipe--edital-intel.apify.actor/v1/analyze_urls" \
  -H "Authorization: Bearer <YOUR_APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "fonte": "caixa",
    "ref": {
      "numimovel": "8444409627110",
      "uf": "SP"
    },
    "vertical": "leilao"
  }'
```

*(You can also pass `{"numlicit": "...", "sgcomissao": "...", "uf": "SP", "max_imoveis": 3}` to inspect a master auction notice plus sample deeds.)*

#### 3. Audit a Brazilian PNCP Tender (`vertical: "licitacao"`)

```bash
curl -X POST "https://cleanpipe--edital-intel.apify.actor/v1/analyze" \
  -H "Authorization: Bearer <YOUR_APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "numero_controle_pncp": "45509650000103-1-000134/2024"
  }'
```

***

### Sample Structured Output (JSON)

```json
{
  "processo_id": "45509650000103-1-000134/2024",
  "hash_pacote": "sha256:9f84c2...",
  "cache_hit": false,
  "resumo_executivo": "Procurement of cloud infrastructure licensing and technical support for 12 months.",
  "prazos_criticos": {
    "abertura_propostas": "2026-12-04T09:00:00-03:00",
    "visita_tecnica_obrigatoria": false
  },
  "red_flags": [
    {
      "severidade": "alta",
      "categoria": "visita_tecnica",
      "descricao": "Requires mandatory on-site technical inspection prior to bid submission.",
      "arquivo_origem": "Termo_de_Referencia.pdf",
      "pagina": 10,
      "trecho_literal": "visita técnica presencial obrigatória...",
      "verificada": true
    }
  ],
  "retificacoes_diff": {
    "houve_alteracao": false,
    "documentos_adicionados": [],
    "documentos_removidos": [],
    "documentos_alterados": []
  },
  "qualidade_extracao": {
    "paginas_totais": 43,
    "paginas_ocr": 0,
    "citacoes_verificadas_pct": 97.5,
    "truncado_por_teto": false
  },
  "meta": {
    "modelo": "gemini-3.5-flash-lite",
    "custo_estimado_usd": 0.011
  }
}
```

***

### Limits, Guardrails & Honest Notes

- **Supported Formats:** `.pdf` (digital and scanned), `.docx`, and `.zip` archives containing supported documents.
- **Page Caps:** Standard analysis (`edital-deep-analysis`) processes up to **120 pages**; large packs (`large-pack-analysis`) process up to **300 pages**. Larger packs are prioritized by document importance and flagged with `"truncado_por_teto": true`.
- **Selective OCR Cap:** Up to **20 scanned pages** per pack are processed in parallel via multimodal OCR.
- **SAM.gov External Links (e.g., DIBBS):** Some federal notices only link to external agency portals without direct downloadable files. In those cases, the API returns a structured notice with **no PPE charge ($0.00)** — if you obtain direct file URLs externally, pass them to `analyze_url_pack`.
- **Disclaimer:** Automated triage with deterministically verified citations. It does not replace formal legal review before submitting bids or auction offers.

***

<a id="portugues"></a>

### Português — Motor de Inteligência Documental (PNCP, Leilões Caixa e URLs)

O **Edital Intel** vai além dos metadados: baixa o **pacote completo de documentos** de licitações públicas brasileiras (PNCP / Lei nº 14.133/2021), leilões de imóveis da Caixa (edital da praça + matrícula do imóvel) ou listas arbitrárias de URLs (`.pdf`, `.docx`, `.zip`), aplicando OCR seletivo em páginas escaneadas e devolvendo JSON estruturado com **citações auditáveis** (`arquivo_origem` + `pagina` + `trecho_literal` conferidos deterministicamente contra o texto original).

#### Principais Diferenciais

- **Auditoria Anti-Alucinação:** Taxa real medida acima de **92% de citações verificadas** em editais do PNCP e **94%** em lotes da Caixa.
- **Leilões Caixa (Edital + Matrícula):** Extrai valor de avaliação vs. lance mínimo, status de ocupação (`imovel_ocupado`), usufruto/ônus, débitos *propter rem* (condomínio/IPTU), recursos judiciais pendentes e exigências ao arrematante — com cache em 2 estágios para reduzir latência em lotes do mesmo edital.
- **Diff de Retificações Gratuito:** Detecta automaticamente arquivos adicionados, removidos ou modificados (por hash `sha256`) e alterações de prazos críticos via `get_document_diff`.
- **Proteção de Cobrança:** Se o processo não tiver documentos baixáveis ou ocorrer indisponibilidade momentânea do LLM, o retorno degradado **não cobra evento PPE ($0,00)**.
- **Pronto para n8n, Make e Agentes MCP:** Integre via REST (`/v1/*`) ou conecte diretamente o servidor MCP (`https://cleanpipe--edital-intel.apify.actor/mcp`) no Claude Desktop, Cursor ou workflows de automação.

#### Eventos e Preços (Pay-Per-Event)

- **`opportunity-search`** — **US$ 0,10** por requisição (até 500 oportunidades abertas)
- **`eligibility-match`** — **US$ 0,15** por cruzamento de perfil da empresa com o edital
- **`edital-deep-analysis`** — **US$ 0,25** por pacote completo (até 120 páginas)
- **`large-pack-analysis`** — **US$ 0,60** por pacote extenso (121 a 300 páginas)
- **`auction-lot-analysis`** — **US$ 0,75** por auditoria completa de lote de leilão (edital + matrícula)
- **`get_document_diff`** — **Grátis**

> **Aviso Legal:** Ferramenta de triagem automatizada com citações auditáveis. Não substitui a revisão jurídica ou técnica formal antes do envio de propostas ou lances.

# Actor input Schema

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

'standby' keeps the web server up (MCP+REST). 'analyze' runs one deep analysis and exits (useful for quick tests).

## `fonte` (type: `string`):

'pncp' = Brazilian tenders by PNCP ID. 'caixa' = CAIXA auction (needs ref). 'samgov' = US federal opportunity (needs notice_id; link-only notices return $0-charge 'no documents' — use url_list with their external URLs instead). 'url_list' = any document pack by URLs.

## `numeroControlePNCP` (type: `string`):

Format 'CNPJ-1-NNNNNN/AAAA' — required when fonte=pncp in mode=analyze.

## `vertical` (type: `string`):

'licitacao' = Brazilian tenders. 'leilao' = auction lots (occupancy, usufruct, propter rem). 'federal' = US FAR/DFARS.

## `caixaNumLicit` (type: `string`):

Auction number — required when fonte=caixa.

## `caixaSgComissao` (type: `string`):

Commission code — required when fonte=caixa.

## `caixaUf` (type: `string`):

Two-letter Brazilian state code for the auction.

## `noticeId` (type: `string`):

Notice ID from sam.gov — required when fonte=samgov in mode=analyze.

## `samApiKey` (type: `string`):

Bring-your-own SAM.gov Public API key (sam.gov → Account Details) for high-volume SAM.gov calls — overrides the server's key for fonte=samgov search/analyze.

## `urls` (type: `array`):

Direct URLs to PDFs/DOCX/ZIP — required when fonte=url_list.

## Actor input object example

```json
{
  "mode": "standby",
  "fonte": "pncp",
  "numeroControlePNCP": "45509650000103-1-000134/2024",
  "vertical": "licitacao",
  "caixaNumLicit": "00500226",
  "caixaSgComissao": "CPA/RE",
  "caixaUf": "SP",
  "urls": [
    "https://venda-imoveis.caixa.gov.br/editais/EL00500226CPARE.PDF"
  ]
}
```

# Actor output Schema

## `analysis` (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 = {
    "numeroControlePNCP": "45509650000103-1-000134/2024",
    "caixaNumLicit": "00500226",
    "caixaSgComissao": "CPA/RE",
    "caixaUf": "SP",
    "urls": [
        "https://venda-imoveis.caixa.gov.br/editais/EL00500226CPARE.PDF"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cleanpipe/edital-intel").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 = {
    "numeroControlePNCP": "45509650000103-1-000134/2024",
    "caixaNumLicit": "00500226",
    "caixaSgComissao": "CPA/RE",
    "caixaUf": "SP",
    "urls": ["https://venda-imoveis.caixa.gov.br/editais/EL00500226CPARE.PDF"],
}

# Run the Actor and wait for it to finish
run = client.actor("cleanpipe/edital-intel").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 '{
  "numeroControlePNCP": "45509650000103-1-000134/2024",
  "caixaNumLicit": "00500226",
  "caixaSgComissao": "CPA/RE",
  "caixaUf": "SP",
  "urls": [
    "https://venda-imoveis.caixa.gov.br/editais/EL00500226CPARE.PDF"
  ]
}' |
apify call cleanpipe/edital-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cleanpipe/edital-intel"
        }
    }
}
```

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/vJdu6rfnqAaBdHZfS/builds/PecL8s0cgeOoPTXj5/openapi.json
