Brasil API icon

Brasil API

Consulta endpoints públicos da BrasilAPI

Overview

This node integrates with the BrasilAPI public API to fetch various types of Brazilian public data. Specifically, for the "CPTEC – Ondas 1 dia" operation, it retrieves wave forecast data for a given city code for one day from the CPTEC (Center for Weather Forecast and Climate Studies) service. This is useful for applications related to marine activities, surfing forecasts, coastal weather monitoring, or any scenario where wave conditions are relevant.

For example, a user could input a city code representing a coastal city in Brazil and receive detailed wave information for that location for the current day.

Properties

Name Meaning
City Code Numeric code identifying the city for which the wave forecast is requested (e.g., 4750).

Output

The output is a JSON object containing the wave forecast data for the specified city code for one day. The exact structure depends on the CPTEC API response but typically includes details such as wave height, direction, period, and other relevant oceanographic parameters.

No binary data output is produced by this operation.

Example output JSON (simplified):

{
  "cityCode": 4750,
  "date": "2024-06-01",
  "waves": [
    {
      "time": "08:00",
      "height": 1.2,
      "direction": "NE",
      "period": 8
    },
    ...
  ]
}

Dependencies

  • Requires internet access to call the BrasilAPI endpoints.
  • No special API keys or authentication tokens are needed since BrasilAPI provides public endpoints.
  • 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 the city code against CPTEC city listings.
  • Unsupported Operation Error: If the operation parameter is set incorrectly, the node throws an error indicating the operation is unsupported.
  • API Changes: Since the node relies on a third-party public API, changes or downtime on BrasilAPI or CPTEC services can cause failures.

Links and References

Discussion