Brasil API icon

Brasil API

Consulta endpoints públicos da BrasilAPI

Overview

This node integrates with BrasilAPI, a public API providing various Brazilian data endpoints. Specifically for the "IBGE – Municípios" operation, it fetches municipality information based on a given Brazilian state abbreviation (UF). This is useful for workflows that require geographic or administrative data about municipalities within a specific state in Brazil.

Common scenarios include:

  • Enriching datasets with municipality details for a given state.
  • Automating address validation or location-based processing.
  • Integrating municipal data into business intelligence or reporting tools.

Example: Given the state abbreviation "SP" (São Paulo), the node retrieves all municipalities within São Paulo state.

Properties

Name Meaning
Sigla UF The two-letter abbreviation of the Brazilian state (e.g., "SP" for São Paulo).
Extra Query (JSON) Optional JSON object with key-value pairs to apply additional filters to the query.

Output

The output is a JSON array containing municipality data objects retrieved from the BrasilAPI endpoint for municipalities. Each object typically includes details such as municipality name, code, and other relevant attributes provided by the API.

No binary data is produced by this operation.

Example output snippet (simplified):

[
  {
    "id": 3550308,
    "nome": "São Paulo",
    "microrregiao": { ... },
    "mesorregiao": { ... },
    "regiao-imediata": { ... },
    "regiao-intermediaria": { ... }
  },
  ...
]

Dependencies

  • Requires internet access to call the BrasilAPI public endpoints.
  • No authentication or API keys are needed.
  • Uses the HTTP client library internally to perform GET requests to https://brasilapi.com.br/api/ibge/municipios/v1/{siglaUF}.

Troubleshooting

  • Timeouts or network errors: Ensure the node has internet connectivity and the BrasilAPI service is reachable.
  • Invalid state abbreviation: Using an incorrect or unsupported UF code may result in empty results or errors. Verify the UF value is valid.
  • Malformed Extra Query JSON: If the extra query parameter contains invalid JSON or unsupported filters, the API may reject the request or return unexpected results.
  • Unsupported operation error: This node only supports predefined operations; ensure "IBGE – Municípios" is selected correctly.

Links and References

Discussion