Gov APIpncp.gov.br ↗
Access Brazilian government procurement data via the PNCP API. Search contracts, procurement processes, price registration records, and annual contracting plans.
What is the Gov API?
The PNCP API provides access to Brazil's National Public Procurement Portal across 6 endpoints, returning contracts, procurement processes (contratações), price registration records (atas), and annual contracting plans. The search_contratacoes endpoint lets you filter procurement processes by date range and modality code, while get_contratacao_detail returns full details on a single process including estimated and approved values.
curl -X GET 'https://api.parse.bot/scraper/50f76ddd-10ad-418f-92f3-d9de4c403747/search_contratos?pagina=1&data_final=20260704&data_inicial=20260630&tamanho_pagina=10' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace pncp-gov-br-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.pncp_portal_nacional_de_contratacoes_publicas_api import (
PNCP,
TipoDocumento,
Modalidade,
Status,
)
pncp = PNCP()
# Search for Dispensa procurement processes using the Modalidade enum
for proc in pncp.procurements.search(data_inicial="20260601", data_final="20260605", modalidade=Modalidade.DISPENSA, limit=5):
print(proc.objeto_compra, proc.valor_total_estimado, proc.modalidade_nome)
print(proc.orgao_entidade.razao_social, proc.orgao_entidade.cnpj)
# Get full detail for a specific procurement
detail = pncp.procurements.detail(cnpj="01065846000172", ano="2025", sequencial="369")
print(detail.objeto_compra, detail.situacao_compra_nome, detail.valor_total_estimado)
# Search for signed contracts in a date range
for contrato in pncp.contratos.search(data_inicial="20260601", data_final="20260605", limit=3):
print(contrato.objeto_contrato, contrato.valor_global, contrato.nome_fornecedor)
# Search all documents of type 'contrato' filtered by status using Status enum
for doc in pncp.documentos.search(status=Status.VIGENTE, tipo_documento=TipoDocumento.CONTRATO, limit=3):
print(doc.title, doc.orgao_nome, doc.valor_global)
Search for signed contracts (contratos/empenhos) by publication date range. Returns paginated results with contractor, values, and organization details. Page size is restricted by the upstream API to 10, 20, or 50.
| Param | Type | Description |
|---|---|---|
| pagina | integer | Page number. |
| data_finalrequired | string | End date in YYYYMMDD format (e.g. 20250605). |
| data_inicialrequired | string | Start date in YYYYMMDD format (e.g. 20250601). |
| tamanho_pagina | integer | Results per page. Accepted values: 10, 20, 50. |
{
"type": "object",
"fields": {
"data": "array of contract records with contractor name, values, dates, organization, and category details",
"totalPaginas": "total number of pages",
"totalRegistros": "total number of matching records"
},
"sample": {
"data": {
"data": [
{
"anoContrato": 2025,
"valorGlobal": 94390.8,
"niFornecedor": "57423612000104",
"valorInicial": 94390.8,
"orgaoEntidade": {
"cnpj": "46377800000127",
"poderId": "E",
"esferaId": "E",
"razaoSocial": "SAO PAULO SECRETARIA DA SEGURANCA PUBLICA"
},
"dataAssinatura": "2025-05-09",
"objetoContrato": "SERVIÇOS CONTÍNUOS DE LIMPEZA",
"dataVigenciaFim": "2027-12-01",
"dataVigenciaInicio": "2025-06-01",
"numeroControlePNCP": "46377800000127-2-002750/2025",
"numeroContratoEmpenho": "00015",
"nomeRazaoSocialFornecedor": "RLIMP SERVICOS LTDA"
}
],
"totalPaginas": 3046,
"totalRegistros": 30452
},
"status": "success"
}
}About the Gov API
Contracts and Procurement Processes
The search_contratos endpoint returns signed contracts and empenhos published within a given date range. Each record includes contractor identity, monetary values, publication dates, and the contracting organization. Pagination is controlled via pagina and tamanho_pagina, with accepted page sizes of 10, 20, or 50. The response includes totalPaginas and totalRegistros to help iterate over large result sets.
The search_contratacoes endpoint searches active procurement processes by date range and requires a modalidade code (for example, 8 for Dispensa de Licitação). Results include the procurement object, organization CNPJ, legal basis, and estimated values. Once you have a result, you can feed its sequencialCompra, organization cnpj, and ano fields directly into get_contratacao_detail to retrieve the full record — including objetoCompra, modalidadeNome, situacaoCompraNome, valorTotalEstimado, and valorTotalHomologado.
Price Registration Records and Annual Plans
The search_atas endpoint queries Atas de Registro de Preços — standing price agreements — by validity date range. Each record contains the managing organization, validity window, and procurement object description. These are commonly used to track framework agreements across Brazilian federal and state entities.
The search_pca endpoint covers Annual Contracting Plans (Plano de Contratações Anual) at the organization level. Note that date parameters influence result ordering rather than applying strict date-range filtering — results are returned ordered by most recent update. For a broader cross-document search, search_all accepts a free-text query and optional tipo_documento filter (edital, ata, contrato, or pcaorgao), returning matched items with title, description, organization, and value fields.
The Gov API is a managed, monitored endpoint for pncp.gov.br — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when pncp.gov.br changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official pncp.gov.br API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Monitor newly signed government contracts by querying
search_contratosfor a specific date range and filtering by organization CNPJ. - Track procurement processes of a specific modality (e.g., Dispensa) using
search_contratacoeswith a modalidade code. - Retrieve full procurement details including approved values and status from
get_contratacao_detailusing sequencialCompra from search results. - Audit price registration agreements across agencies by pulling
search_atasrecords within a validity period. - Build a procurement intelligence feed by combining
search_allkeyword queries withtipo_documentofilters for contracts or editals. - Compile organization-level annual spending plans via
search_pcafor budget transparency reporting. - Cross-reference contractor CNPJs across contracts and procurement processes to analyze supplier patterns.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does PNCP have an official developer API?+
What does `get_contratacao_detail` return that the search endpoints don't?+
get_contratacao_detail returns the full procurement record for a single process, including objetoCompra (detailed description), modalidadeNome, situacaoCompraNome (current status), valorTotalEstimado, and valorTotalHomologado (the formally approved value). The search endpoints return summary-level fields and are intended for discovery, not full record retrieval.How does date filtering work in `search_pca`?+
search_pca, the data_inicial and data_final parameters influence the ordering of results rather than applying strict date-range filtering. Results are returned ordered by most recent update. If you need strictly date-bounded PCA results, you should filter the returned records on your side after fetching.Does the API return procurement item-level line data (e.g., individual items within a contract)?+
Are procurement documents or attached files accessible through this API?+
objetoCompra, dates, and values, but does not return binary attachments or document URLs from the procurement dossier. You can fork this API on Parse and revise it to add an endpoint targeting document or attachment references for a given procurement process.