Current Conditions
Retrieves the current weather conditions for a given country and zip/postal code.
Endpoint GET
https://api.ttgtoolbox.com/v1/weather/country_code/postal_code/current
Required path parameters
This endpoint uses the GET
method and has the following required parameters.
country_coderequired
We support the following country codes.
Country | Code |
---|---|
United States | US |
Canada | CA |
postal_coderequired
A valid zip / postal code is required.
Optional query parameters
units
Use the units
parameter to specify the units for all fields with standard units, e.g., miles or kilometers. The following units are supported:
units | Examples |
---|---|
imperial | miles, fahrenheit, in. mercury |
metric | kilometers, celsius, pascals |
Example request URL
https://api.ttgtoolbox.com/v1/weather/US/49010/current
Example request URL with optional parameter
https://api.ttgtoolbox.com/v1/weather/US/49010/current
?units=metric
Response
json
{
"time": "2024-03-06T11:22:13-05:00",
"timezone": "America/Detroit",
"latitude": 42.5256,
"longitude": -85.8661,
"location": "Allegan, Michigan, US",
"temperature": 44.85,
"feels_like": 40.98,
"humidity": 78,
"dew_point": 38.43,
"uv_index": 2.55,
"clouds": 89,
"visibility": 10000,
"wind_speed": 7,
"wind_deg": 36,
"wind_direction": "NE",
"wind_gust": 14,
"description": "overcast clouds",
"units": "imperial"
}