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, the "CPTEC – Buscar Cidade" operation allows users to search for cities by name using CPTEC (Center for Weather Forecast and Climate Studies) data.

Common scenarios where this node is beneficial include:

  • Retrieving detailed city information for weather forecasting or climate-related applications.
  • Enriching datasets with official city data from CPTEC.
  • Automating workflows that require Brazilian city metadata based on partial or full city names.

For example, a user can input a city name like "São Paulo" and receive structured data about that city from CPTEC, which can then be used in subsequent workflow steps such as fetching weather forecasts or demographic data.

Properties

Name Meaning
Nome Cidade The name of the city to search for. This is a string input where you specify the city name to query CPTEC's city database.

Output

The output is a JSON object containing the response from the CPTEC API endpoint for city search. It typically includes details about the city matching the provided name, such as its official identifiers, geographic data, and other relevant metadata.

The node does not output binary data; all results are returned as JSON.

Example output structure (simplified):

{
  "id": 1234,
  "nome": "São Paulo",
  "uf": "SP",
  "regiao": "Sudeste",
  "latitude": -23.5505,
  "longitude": -46.6333,
  ...
}

Dependencies

  • Requires internet access to call the BrasilAPI public endpoints.
  • No special authentication or API keys are needed since BrasilAPI is publicly accessible.
  • Uses the HTTP client library internally to perform GET requests with a 10-second timeout.

Troubleshooting

  • Timeouts or slow responses: The node sets a 10-second request timeout. If the API is slow or unresponsive, consider retrying later or checking your network connection.
  • Unsupported operation error: If an invalid operation is selected, the node will throw an error indicating the operation is unsupported. Ensure "CPTEC – Buscar Cidade" is selected when searching for cities.
  • Empty or no results: If the city name does not match any records, the API may return empty data. Verify the spelling and try more general or alternative city names.
  • Invalid input type: Make sure the "Nome Cidade" property is provided as a non-empty string.

Links and References

Discussion