Queries

24 curated queries over the lake. Each one is a reviewed, parameterized query with typed params, documented columns (with units), lineage back to the original source, and a fixed credit cost. You don't call them yourself: your agent finds and runs them through the MCP server.

How an agent uses a query

  1. consultas_buscar finds the queries that cover the topic of the question — free.
  2. consultas_descrever returns the contract: params schema, columns, limits and cost — free.
  3. consultas_executar runs it with id and params (a municipality is an ibge_code or "Name/UF"). The result carries colunas, linhas, fonte (lineage) and proxima_pagina, which the agent passes back as cursor for the next page; each page is charged.
  4. The shortcuts municipio_perfil, indicador_serie and ranking run the most common queries in a single call.

Limits per key: 10,000 rows per day and 60 calls per minute. The tool returns a clear error for an invalid key, insufficient credits, invalid params or too many calls.

All queries

QueryWhat it answersCost
municipio_resolverResolve municipalityfree
municipio_perfilMunicipality profile1
indicadores_buscarSearch municipal indicatorsfree
indicador_serieIndicator time series2
rankingMunicipality ranking by indicator3
compararCompare municipalities across several indicators3
comex_municipioMunicipality foreign trade2
empresas_municipioMunicipality businesses by CNAE and size2
orcamento_municipioFederal spending located in the municipality2
emendasParliamentary amendments2
camara_proposicoes_resumoChamber of Deputies bills — summary2
camara_votacoes_resumoChamber of Deputies votes — summary2
frota_municipioMunicipality vehicle fleet1
postos_anpMunicipality fuel stations1
macro_serieMacroeconomic series1
cepLook up CEP1
transferencias_municipioConstitutional transfers to the municipality2
municipio_vs_paresMunicipality vs. peers of the same size5
filtrar_municipiosFilter municipalities by criteria (screener)5
variacao_indicadorRanking of an indicator's change between two periods3
agro_municipioMunicipality agriculture and livestock (crops and herds)2
educacao_municipioMunicipality education (basic and higher)2
saude_municipioMunicipality health (facilities and health plans)2
programas_sociais_municipioSocial programs in the municipality (Bolsa Família, BPC, Pé-de-Meia)2

Resolve municipality

Name (accent- and case-insensitive, partial) → ibge_code, state (UF), region and population. Use it to disambiguate municipalities with the same name.

Page
20 rows × up to 1 page

Params

NameTypeDescription
nomeREQUIREDstringName or part of the name (min. 3 letters).
ufstringState (UF) abbreviation, e.g. SP.

Documented columns

  • ibge_code — IBGE code (7 digits) — join key
  • nome — Municipality name
  • uf — State (UF) abbreviation
  • regiao — Macro-region
  • populacao_2022 — Population in the 2022 Census(inhabitants)

Example

municipio_resolver

What is the IBGE code of Santos, in São Paulo state?

Municipality profile

Snapshot of a municipality: population, area, GDP, MHDI, Gini, health, education (IDEB, enrollments), municipal finances, sanitation and mayor elected in 2024.

Page
1 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name ("Santos/SP"). · 1000000–9999999

Documented columns

  • populacao_2022 — Population (2022 Census)(inhabitants)
  • pib — Municipal GDP (IBGE)(R$ thousand)
  • idhm — Municipal HDI (Atlas Brasil, 2010)
  • receita_total_2023 — Municipality's total revenue in 2023 (SICONFI)(R$)
  • prefeito_eleito_2024 — Mayor elected in 2024 (TSE)

Example

municipio_perfil

Give me a profile of São Paulo/SP: population, GDP, HDI, health,
education and elected mayor.

Search municipal indicators

Searches the dictionary of municipal-level indicators (~700 from ~20 sources: IBGE/PAM/PPM, SINISA/SNIS, CNES, INEP, RAIS, SINESP, National Treasury, Bolsa Família/BPC, INPE…). Returns indicador_id, unit, frequency and coverage — use the indicador_id in indicador_serie, ranking and comparar.

Page
50 rows × up to 3 pages

Params

NameTypeDescription
termoREQUIREDstringWords (all must appear), e.g. "mortalidade infantil".
fontestringFilters by source, e.g. inep, datasus, inpe.

Documented columns

  • indicador_id — Identifier for indicador_serie/ranking/comparar
  • periodicidade — annual, monthly…
  • n_municipios — Municipalities with data

Example

indicadores_buscar

Which municipal indicators about schools are available?

Indicator time series

Values of an indicator (indicador_id from indicadores_buscar) for 1 to 10 municipalities over time, with unit and source.

Page
200 rows × up to 5 pages

Params

NameTypeDescription
municipiosREQUIREDinteger | string[]1 to 10 municipalities (ibge_code or name). · 1–10 items
indicador_idREQUIREDstringE.g. bf.beneficiarios (see indicadores_buscar).
periodo_iniciostringYYYY, YYYY-MM or YYYYQn (inclusive).
periodo_fimstringYYYY, YYYY-MM or YYYYQn (inclusive).

Documented columns

  • periodo — YYYY, YYYY-MM or YYYYQn depending on the frequency
  • valor — Indicator value (see unit)

Example

indicador_serie

How has the number of Bolsa Família beneficiaries in Santos and São
Paulo changed since January 2025?

ranking

3 credits

Municipality ranking by indicator

Top N (<= 100) municipalities by an indicator in a period (default: the most recent), nationwide, in a state (UF) or region.

Page
100 rows × up to 1 page

Params

NameTypeDescription
indicador_idREQUIREDstringindicador_id (see indicadores_buscar).
periodostringPeriod; default: the most recent.
ufstringRestricts to one state (UF).
regiao"Norte" | "Nordeste" | "Centro-Oeste" | "Sudeste" | "Sul"Restricts to one macro-region.
topintegerHow many municipalities (1-100). · 1–100 · default 10
ordem"desc" | "asc"desc = largest first. · default "desc"

Documented columns

  • posicao — Ranking position

Example

ranking

Which 10 municipalities in São Paulo state have the most formal jobs?

comparar

3 credits

Compare municipalities across several indicators

Up to 10 municipalities × up to 10 indicators; by default the most recent value of each pair (or of a fixed period).

Page
100 rows × up to 1 page

Params

NameTypeDescription
municipiosREQUIREDinteger | string[]Up to 10 municipalities. · 1–10 items
indicadoresREQUIREDstring[]Up to 10 indicador_id. · 1–10 items
periodostringFixed period; default: the most recent of each indicator.

Example

comparar

Compare Santos and Campinas on formal jobs and number of schools.

Municipality foreign trade

A municipality's exports or imports (Comex Stat), aggregated by year, product (SH4) or destination/origin country, in US$ FOB and kg.

Page
100 rows × up to 3 pages

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
fluxo"EXP" | "IMP"EXP = exports, IMP = imports. · default "EXP"
agrupar_por"ano" | "sh4" | "pais"ano (year), sh4 (product; sorted by largest) or pais (Comex country code). · default "ano"
ano_iniciointegerStart year. · 1997–2100
ano_fimintegerEnd year. · 1997–2100
sh4stringFilters one SH4 product, e.g. 1201 (soybeans).

Documented columns

  • valor_fob_usd — FOB value(US$)
  • kg_liquido — Net weight(kg)

Example

comex_municipio

How much did Santos export per year?

Municipality businesses by CNAE and size

Active establishments (Federal Revenue Service, CNPJ) in a municipality aggregated by CNAE (division, group, class or subclass), broken down by size (ME, EPP, others). Never lists individual companies.

Page
200 rows × up to 3 pages

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
nivel"divisao" | "grupo" | "classe" | "subclasse"CNAE granularity (2, 3, 5 or 7 digits). · default "divisao"
cnae_prefixostringFilters CNAEs starting with these digits, e.g. 47 (retail).

Documented columns

  • qtd_me — Micro-enterprises(establishments)
  • qtd_epp — Small businesses(establishments)

Example

empresas_municipio

Which sectors (CNAE divisions) have the most companies in Santos?

Federal spending located in the municipality

Execution of FEDERAL spending located in the municipality (Transparency Portal) by function — or by subfunction when a function is given — in a year (default: the most recent). This is not the city government's budget.

Page
100 rows × up to 2 pages

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
anointegerYear; default: the most recent. · 2000–2100
funcaostringFunction name (e.g. Saúde) to break down by subfunction.

Documented columns

  • pago — Amount paid(R$)

Example

orcamento_municipio

How much federal spending was executed in Santos in 2025, by function?

emendas

2 credits

Parliamentary amendments

Parliamentary amendments (Transparency Portal) by municipality where applied and/or author, aggregated by year, author, municipality and function, with committed and paid amounts.

Page
200 rows × up to 3 pages

Params

NameTypeDescription
municipiointeger | stringMunicipality where applied (ibge_code or name). · 1000000–9999999
autorstringAuthor name (or part of it).
ano_iniciointegerStart year. · 2000–2100
ano_fimintegerEnd year. · 2000–2100

Documented columns

  • pago — Amount paid(R$)

Example

emendas

Which parliamentary budget amendments went to Santos since 2023?

Chamber of Deputies bills — summary

How many bills and propositions were introduced in the Chamber of Deputies per year and type (PL, PEC, MPV…), optionally filtered by words in the summary. Aggregated summary, without listing propositions.

Page
200 rows × up to 2 pages

Params

NameTypeDescription
ano_iniciointegerStart year. · 1990–2100
ano_fimintegerEnd year. · 1990–2100
tipostringType abbreviation, e.g. PL, PEC, MPV.
termostringWords in the summary/keywords.

Example

camara_proposicoes_resumo

How many bills did the Chamber of Deputies receive per year since 2023?

Chamber of Deputies votes — summary

Chamber of Deputies votes by year and body (Plenary, committees), with how many were approved. Aggregated summary.

Page
200 rows × up to 2 pages

Params

NameTypeDescription
ano_iniciointegerStart year. · 1990–2100
ano_fimintegerEnd year. · 1990–2100
orgaostringBody abbreviation, e.g. PLEN.

Example

camara_votacoes_resumo

Summarize the Chamber of Deputies' floor votes since 2024.

Municipality vehicle fleet

Registered fleet (SENATRAN) by vehicle type in the most recent period.

Page
40 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999

Documented columns

  • qtd — Registered vehicles(vehicles)

Example

frota_municipio

What is Santos's vehicle fleet, by type?

postos_anp

1 credit

Municipality fuel stations

Retail fuel resellers authorized by ANP in the municipality (most recent registry), optionally by brand.

Page
100 rows × up to 3 pages

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
bandeirastringE.g. "ipiranga", "branca".

Example

postos_anp

Which fuel stations are there in Santos, and under which brands?

macro_serie

1 credit

Macroeconomic series

Daily Selic, monthly IPCA or US dollar exchange rate (BACEN/SGS) over a date range; without a range, the 30 most recent observations.

Page
200 rows × up to 5 pages

Params

NameTypeDescription
serieREQUIRED"selic_diaria" | "ipca_mensal" | "cambio_dolar"Series.
data_iniciostringYYYY-MM-DD.
data_fimstringYYYY-MM-DD.

Documented columns

  • valor — Selic: % per day; IPCA: % in the month; exchange rate: R$/US$

Example

macro_serie

Show me the daily Selic rate series.

cep

1 credit

Look up CEP

Address and municipality (ibge_code) of ONE CEP (postal code). Does not list CEPs.

Reads
ceps
Page
1 rows × up to 1 page

Params

NameTypeDescription
cepREQUIREDstring8 digits, with or without a hyphen.

Example

cep

Where is postal code (CEP) 11010-000?

Constitutional transfers to the municipality

Federal transfers to the municipality (National Treasury): FPM, Fundeb, ITR, CIDE-Combustíveis, IOF-Ouro, LC 176/2020, Lei Kandir and FEX, by year or month, with the period total and each transfer's share. Default: last 5 years. Gap: SUS fund-to-fund transfers (FNS), ICMS/IPVA revenue shares and voluntary transfers are NOT in the lake.

Page
200 rows × up to 3 pages

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name ("Campinas/SP"). · 1000000–9999999
ano_iniciointegerStart year; default: 4 years before the last year with data. · 1996–2100
ano_fimintegerEnd year (inclusive). · 1996–2100
agrupar_por"ano" | "mes"ano (YYYY) or mes (YYYY-MM). · default "ano"

Documented columns

  • periodo — Year (YYYY) or month (YYYY-MM) of the credit
  • transferencia — Transfer id (stn.fpm, stn.fundeb, stn.itr, stn.cide, stn.iof_gold, stn.lc_176, stn.lc_8796, stn.fex)
  • valor_brl — Amount transferred in the period (nominal; source: National Treasury)(R$)
  • participacao_pct — Transfer's share of the period total(%)
  • total_periodo_brl — Sum of all transfers in the period(R$)
  • meses_com_repasse — Months in the period with a credit for this transfer(months)

Example

transferencias_municipio

How much does Campinas receive in constitutional transfers (FPM,
Fundeb…)?

Municipality vs. peers of the same size

Compares a municipality with an automatic group of up to 30 peers: same state (UF) (or same region, if the state has fewer than 10) with population between -30% and +30% (if there are not 10, the 30 closest in population in the region). For each indicator (up to 5) it returns the municipality's value, median, p25, p75, the municipality's percentile among its peers and only the top 5/bottom 5 peers — never the full list.

Page
5 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
indicadoresREQUIREDstring[]Up to 5 indicador_id (see indicadores_buscar). · 1–5 items
periodostringFixed period; default: the most recent with data for the municipality, per indicator.

Documented columns

  • valor_municipio — Municipality's value in the period (see unit)
  • n_pares — Peers with data for this indicator/period(municipalities)
  • mediana_pares — Peer median (same unit as the indicator)
  • p25_pares — Peer 25th percentile
  • p75_pares — Peer 75th percentile
  • percentil_entre_pares — Municipality's position among peers (0 = lowest value, 100 = highest; ties count as half)(percentile (0-100))
  • grupo_escopo — uf = peers in the same state; regiao = peers in the same macro-region
  • grupo_criterio — populacao_30pct = population between -30% and +30%; populacao_mais_proxima = the closest in population
  • grupo_tamanho — Peer group size (up to 30)(municipalities)
  • grupo_pop_min — Smallest population in the group (2025 estimate or 2022 Census)(inhabitants)
  • grupo_pop_max — Largest population in the group(inhabitants)
  • maiores_5 — The 5 peers with the highest value (ibge_code, municipio, uf, valor)
  • menores_5 — The 5 peers with the lowest value (ibge_code, municipio, uf, valor)

Example

municipio_vs_pares

How does Campinas compare with municipalities of the same size on jobs,
schools and Bolsa Família?

Filter municipalities by criteria (screener)

Finds municipalities that meet up to 5 criteria {indicador_id, operador, valor} at once (e.g. population >= 100000 and bf.beneficiarios < 5000), optionally in a state (UF) or region, sorted by an indicator. "populacao" = 2025 estimate (2022 Census if missing). Default period: the most recent of each indicator; a municipality without data for an indicator fails that criterion. At most 50 rows and 1 page (total_encontrados says how many match); each row counts double toward the daily row limit.

Page
50 rows × up to 1 page

Params

NameTypeDescription
criteriosREQUIREDobject[]1 to 5 criteria {indicador_id, operador (> >= < <= = !=), valor}; all must be met. indicador_id "populacao" = inhabitants. In GET: "populacao>=100000;bf.beneficiarios<5000". · 1–5 items
ufstringRestricts to one state (UF).
regiao"Norte" | "Nordeste" | "Centro-Oeste" | "Sudeste" | "Sul"Restricts to one macro-region.
periodostringFixed period for all indicators; default: the most recent of each.
ordenar_porstringindicador_id (or "populacao") to sort by; default: that of the 1st criterion.
ordem"desc" | "asc"desc = largest first. · default "desc"
limiteintegerMaximum number of municipalities (1-50). · 1–50 · default 20

Documented columns

  • populacao — Population (2025 estimate; 2022 Census if missing)(inhabitants)
  • valor_ordenacao — Value of the indicator used for sorting (indicator's unit)
  • valores_criterios — Municipality's value for each criterion, in the order given (indicador_id, periodo, valor, unidade)
  • total_encontrados — How many municipalities meet all criteria (the list returns at most 50)(municipalities)

Example

filtrar_municipios

List 10 municipalities in São Paulo state with over 100,000 residents
and over 50,000 formal jobs.

Ranking of an indicator's change between two periods

Municipalities with the largest increase or largest decrease in an indicator between periodo_inicio and periodo_fim, with absolute and percentage change; sorts by the chosen measure (percentage ignores zero/negative bases). Top N <= 50, nationwide, in a state (UF) or region; populacao_min excludes very small municipalities.

Page
50 rows × up to 1 page

Params

NameTypeDescription
indicador_idREQUIREDstringindicador_id (see indicadores_buscar).
periodo_inicioREQUIREDstringBase period (same format as the indicator: YYYY, YYYY-MM or YYYYQn).
periodo_fimREQUIREDstringEnd period.
ufstringRestricts to one state (UF).
regiao"Norte" | "Nordeste" | "Centro-Oeste" | "Sudeste" | "Sul"Restricts to one macro-region.
populacao_minintegerOnly municipalities with at least this population. · 0–20000000
topintegerHow many municipalities (1-50). · 1–50 · default 20
ordem"maior_alta" | "maior_queda"maior_alta or maior_queda. · default "maior_alta"
medida"percentual" | "absoluta"Sorts by percentage or absolute change. · default "percentual"

Documented columns

  • valor_inicio — Value in the base period (see unit)
  • valor_fim — Value in the end period (see unit)
  • variacao_absoluta — valor_fim - valor_inicio (indicator's unit)
  • variacao_pct — Percentage change (null when valor_inicio <= 0)(%)

Example

variacao_indicador

In which 10 municipalities in São Paulo state did Bolsa Família fall the
most between January 2025 and June 2026?

Municipality agriculture and livestock (crops and herds)

Agricultural production (IBGE PAM: temporary and permanent crops — harvested area, quantity, production value, yield and share of total value) and livestock (IBGE PPM: herd sizes, milked cows and production of milk, eggs, honey, wool) of a municipality in a year (default: the most recent). Gap: the value of animal production (R$) and forestry/plant extraction are not in the lake.

Page
100 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name ("Sorriso/MT"). · 1000000–9999999
anointegerYear; default: the most recent with PAM data. · 1974–2100

Documented columns

  • tipo — temporary crop, permanent crop (PAM); herd (headcount) or animal-origin production (PPM)
  • ano — Reference year
  • area_colhida_ha — Harvested area (PAM)(hectares)
  • quantidade — Quantity produced (PAM) or headcount/production (PPM) — see unidade_quantidade
  • unidade_quantidade — tonnes or thousand fruits (PAM); head, thousand liters, thousand dozen or kilograms (PPM)
  • valor_producao_mil_brl — Agricultural production value (PAM; nominal)(R$ thousand)
  • participacao_valor_pct — Crop's share of the total value of the municipality's crops(%)
  • rendimento_kg_ha — Average yield (PAM; null for products measured in thousand fruits)(kg/ha)

Example

agro_municipio

What does Sorriso (Mato Grosso) produce in farming and livestock?

Municipality education (basic and higher)

Education in a municipality: INEP School Census (schools by network and location, enrollments by stage, teachers, student/teacher ratio, % of schools with internet, library, labs etc.), Higher Education Census (HEIs, programs, enrollments, new entrants, graduates) and IDEB 2023 (early/final years). Default year: the most recent of each source; includes the previous year's value for comparison. Gap: the lake only has the 2023 IDEB (no series, no SAEB, no pass/dropout rates).

Page
60 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
anointegerYear; default: the most recent of each source (uses the last year <= ano). · 2000–2100

Documented columns

  • grupo — basic education (INEP), higher education (INEP/MEC) or IDEB
  • periodo — Census reference year
  • valor — Value (see unit: schools, enrollments, teachers, percentage, index…)
  • valor_anterior — Value in the previous available year
  • variacao_pct — Change from the previous year(%)

Example

educacao_municipio

What does education look like in Campinas, from basic to higher
education?

Municipality health (facilities and health plans)

A municipality's health network: CNES facilities (total and by type — UBS, hospitals, emergency care, CAPS, clinics…) per 10,000 inhabitants, and health plan beneficiaries (ANS) with coverage relative to the population. Default period: the most recent of each source (uses the last <= periodo). Gap: beds (CNES-LT), professionals, SUS production and the public/private split of facilities are NOT in the lake.

Page
60 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
periodostringYYYY-MM; uses, per source, the most recent reference month <= periodo. Default: the most recent.

Documented columns

  • periodo — Reference month (YYYY-MM)
  • valor — Facilities (CNES) or beneficiaries (ANS)
  • por_10mil_hab — Facilities per 10,000 inhabitants(facilities/10,000 inhab.)
  • cobertura_pct — Health plan beneficiaries / population(%)
  • populacao_referencia — Population used in the relative indicators (2025 estimate; 2022 Census if missing)(inhabitants)

Example

saude_municipio

What does health care look like in Campinas: facilities and health
plans?

Social programs in the municipality (Bolsa Família, BPC, Pé-de-Meia)

Bolsa Família, BPC/LOAS and Pé-de-Meia in a municipality: beneficiaries (last month and monthly average), total amount paid, monthly average, per capita amount and beneficiaries per 1,000 inhabitants, plus a total row. Default: the last 12 available months of each program. Pé-de-Meia counts payments (a student may receive more than one in a month).

Page
10 rows × up to 1 page

Params

NameTypeDescription
municipioREQUIREDinteger | stringibge_code or name. · 1000000–9999999
periodo_iniciostringYYYY-MM (inclusive); default: 11 months before periodo_fim.
periodo_fimstringYYYY-MM (inclusive); default: the last month with data for each program.

Documented columns

  • unidade_beneficiarios — Bolsa Família counts families; BPC, people; Pé-de-Meia, payments
  • meses — Months with data in the window(months)
  • beneficiarios_ultimo_mes — Beneficiaries in the last month of the window (see unidade_beneficiarios)
  • beneficiarios_media_mensal — Monthly average of beneficiaries in the window
  • valor_total_brl — Total amount paid in the window (nominal)(R$)
  • valor_medio_mensal_brl — Average amount paid per month(R$)
  • valor_per_capita_brl — Total amount paid in the window / municipality population(R$ per inhabitant)
  • beneficiarios_por_mil_hab — Last-month beneficiaries per 1,000 inhabitants(per 1,000 inhabitants)
  • populacao_referencia — Population used for per capita (2025 estimate; 2022 Census if missing)(inhabitants)

Example

programas_sociais_municipio

How many people in Campinas receive Bolsa Família, BPC and Pé-de-Meia?