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 N dias" operation fetches weather forecasts for a given city code over a specified number of days (1 to 6). This is useful for workflows that require weather predictions, such as planning events, agricultural activities, or travel arrangements in Brazil.

For example, you can input a city code and request a 3-day weather forecast to automate notifications or decision-making processes based on upcoming weather conditions.

Properties

Name Meaning
City Code Numeric identifier of the city for which the weather forecast is requested.
Days (1-6) Number of days for the weather forecast, ranging from 1 to 6 days.

Output

The node outputs JSON data containing the weather forecast information retrieved from the CPTEC endpoint of BrasilAPI. The structure typically includes daily weather details such as temperature, precipitation, humidity, wind, and other meteorological parameters for each day requested.

No binary data output is produced by this operation.

Dependencies

  • Requires internet access to call the BrasilAPI public endpoints.
  • No authentication or API keys are needed since BrasilAPI is a public API.
  • The node uses the HTTP client library internally to perform GET requests with a timeout of 10 seconds.

Troubleshooting

  • Timeouts: If the API does not respond within 10 seconds, the request will fail. Ensure stable internet connectivity.
  • Invalid City Code: Providing an incorrect or unsupported city code may result in errors or empty responses. Verify city codes before use.
  • Days Parameter Range: The "Days" property must be between 1 and 6. Values outside this range may cause errors.
  • Unsupported Operation Error: If the operation parameter is changed incorrectly, the node throws an error indicating the operation is unsupported.

Links and References

Discussion