Overview

HG Weather is a Brazilian weather API that returns current conditions and multi-day forecasts for cities across Brazil. It is easy to use: simply pass a city name or coordinates and your API key to get structured JSON back. This API is a great starting point for developers building apps focused on the Brazilian market.

Beginner Tip

Pass the city name using the city_name parameter or use woeid (a Yahoo location ID) for precise city targeting. Keep your API key out of client-side code by routing requests through a small backend.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

temperature
weather conditions
humidity
wind speed
forecast data

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "location": "Tokyo",
  "temperature": {
    "current": 22,
    "feels_like": 24,
    "min": 18,
    "max": 26
  },
  "condition": "Partly Cloudy",
  "humidity": 65,
  "wind": {
    "speed": 12,
    "direction": "NE"
  },
  "forecast": [
    {
      "date": "2025-01-16",
      "high": 25,
      "low": 17,
      "condition": "Sunny"
    }
  ]
}

Field Reference

results.temp Current temperature in degrees Celsius.
results.description Short weather description such as Chuva (rain) or Ensolarado (sunny).
results.humidity Current relative humidity as a percentage.
results.wind_speedy Current wind speed with unit, e.g., 15 km/h.
results.forecast Array of daily forecast objects with date, max/min temperatures, and description.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://hgbrasil.com/status/weather";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

401 Unauthorized The API key is missing or incorrect.
Register at hgbrasil.com/weather to obtain a free key and add it as key=YOUR_API_KEY in the query string.
City not found The city name was misspelled or is not in the database.
Try a major nearby city name or use the woeid parameter with a known Yahoo Weather location ID.
CORS error in browser Direct browser requests are blocked by the API CORS policy.
Make requests from a server-side function (e.g., Node.js, Serverless) and send results to the browser.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Weather
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →