Brasil API icon

Brasil API

Consulta endpoints públicos da BrasilAPI

Overview

This node integrates with BrasilAPI, a public API service providing various Brazilian data endpoints. Specifically, the "CPTEC – Previsão 1 dia" operation fetches a one-day weather forecast for a given city identified by its city code from CPTEC (Centro de Previsão de Tempo e Estudos Climáticos).

Use cases include:

  • Retrieving daily weather forecasts for Brazilian cities to inform decision-making in logistics, event planning, or agriculture.
  • Automating weather data collection for dashboards or reports.
  • Integrating weather information into other workflows that depend on current climate conditions.

Example: Given a city code, the node returns detailed weather forecast data for that city for the next day.

Properties

Name Meaning
City Code Numeric identifier of the city for which the one-day weather forecast is requested.

Output

The node outputs JSON data containing the weather forecast for the specified city for one day. The structure includes various meteorological details such as temperature, humidity, wind, precipitation, and other relevant weather parameters provided by CPTEC.

No binary data output is produced by this operation.

Dependencies

  • Requires internet access to call the BrasilAPI endpoints.
  • No special authentication or API keys are needed as BrasilAPI is a public API.
  • The node uses the got HTTP client library internally to perform requests.
  • No additional n8n environment variables or credentials are required for this operation.

Troubleshooting

  • Common issues:

    • Invalid or incorrect city code may result in errors or empty responses.
    • Network connectivity problems can cause request timeouts or failures.
    • BrasilAPI service downtime or changes in API endpoints could lead to unexpected errors.
  • Error messages:

    • Unsupported operation ... — indicates an invalid operation parameter; ensure "CPTEC – Previsão 1 dia" is selected.
    • Request timeout errors — check network connection and retry.
    • API response errors — verify the city code is valid and corresponds to a known city in CPTEC.

Links and References

Discussion