aggregate_licitacoes_por_periodo
Aggregate Brazilian public procurement bid counts and values over time, revealing monthly trends without paginating large result sets.
Instructions
Aggregate Brazilian public procurement bid counts (and optional value sums) over a time series — answers "how did volumes evolve month by month" without paginating tens of thousands of records.
Each bucket is computed by issuing a single PNCP list call per (bucket × modality) and reading totalRegistros from the response. With default modalities (Pregão Eletrônico + Dispensa + Inexigibilidade) and granularidade=mes, a 12-month range = 36 calls.
When esfera filter or value metrics are requested, the tool paginates the bucket internally (up to 50 pages = 2500 records per bucket) and aggregates client-side. Be conservative with date range × granularity in that mode.
Maximum total date range: 1830 days (~5 years). Each bucket call respects the PNCP 365-day-per-call limit.
Modality codes: 1 = Leilão - Eletrônico 2 = Diálogo Competitivo 3 = Concurso 4 = Concorrência - Eletrônica 5 = Concorrência - Presencial 6 = Pregão - Eletrônico 7 = Pregão - Presencial 8 = Dispensa de Licitação 9 = Inexigibilidade 10 = Manifestação de Interesse 11 = Pré-qualificação 12 = Credenciamento 13 = Leilão - Presencial
Default modalities: [6, 8, 9] (Pregão Eletrônico, Dispensa, Inexigibilidade).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataInicial | Yes | Start date YYYYMMDD. | |
| dataFinal | Yes | End date YYYYMMDD. | |
| granularidade | No | Time bucket size for the series. | mes |
| modalidades | No | List of modality codes. Default: [6, 8, 9]. | |
| uf | No | Two-letter state code. | |
| codigoMunicipioIbge | No | IBGE municipality code. | |
| cnpjOrgao | No | Procuring agency CNPJ. | |
| esfera | No | Filter by sphere ('federal', 'estadual', 'municipal', 'distrital'). Forces paginated aggregation — be conservative with range × granularity. | |
| metricas | No | Metrics to include in each bucket. 'count' is free (single page hit). 'valorEstimadoTotal' and 'valorHomologadoTotal' force paginated aggregation. |