Loading
Loading
Retrieve historical weather data for any past date for any location worldwide. Supports lookup by city name or address, GPS coordinates, or IP address. Returns daily or hourly weather data plus astronomical information.
The Historical Weather API requires a date parameter (a single past date in YYYY-MM-DD format). Use precision to choose between daily (default) or hourly granularity. Each response includes an astronomy object with sunrise, sunset, and moon phase data for that date.
Pass your API key as the apiKey parameter in every request.
This is version v1.0 of the API.
The date parameter is required and must be a past date. Provide a location using location, lat/long, or ip. If no location is provided the API auto-detects the requesting IP address.
formatoptionalStringdefault: jsonResponse format: 'json'.
daterequiredStringSpecific date for which to fetch weather data. Must follow YYYY-MM-DD format (e.g., 2025-08-25). Historical dates must be past dates only. Current or future dates are not allowed.
locationoptionalStringSpecifies the target location. Accepts a city name, place name, or full address.
latoptionalFloatLatitude of the target location. Must be used together with "long".
longoptionalFloatLongitude of the target location. Must be used together with "lat".
ipoptionalStringIPv4 or IPv6 address used to infer location. Defaults to the requester's public IP if not provided.
precisionoptionalStringdefault: dailyData granularity. Supported values: "daily" (default) and "hourly".
timezoneoptionalStringSpecifies the timezone for returned results. Defaults to the resolved location's timezone.
A successful request returns a 200 OK with a JSON object containing location and historical. The historical object contains a daily or hourly sub-object depending on the precision parameter, plus an astronomy object. See the response preview for the full structure.
daily (Object), hourly (Array<Object>), astronomy (Object)
Address Lookup (Object), Coordinates Lookup (Object), IP Lookup (Object)
Reference for the weather_code field values returned in the daily, hourly, and astronomy objects. Codes follow the WMO standard for weather interpretation.
0Clear sky - completely clear with no cloud coverage.
1, 2, 3Mainly clear, partly cloudy, and overcast - varying cloud coverage levels.
45, 48Fog - standard fog (45) and depositing rime fog (48).
51, 53, 55Drizzle - light (51), moderate (53), and dense intensity (55).
56, 57Freezing drizzle - light (56) and dense/heavy intensity (57).
61, 63, 65Rain - slight (61), moderate (63), and heavy intensity (65).
66, 67Freezing rain - light (66) and heavy intensity (67).
71, 73, 75Snowfall - slight (71), moderate (73), and heavy intensity (75).
77Snow grains - small, white, opaque ice particles.
80, 81, 82Rain showers - slight (80), moderate (81), and violent intensity (82).
85, 86Snow showers - slight (85) and heavy intensity (86).
95Thunderstorm - slight or moderate intensity.
96, 99Thunderstorm with hail - slight hail (96) and heavy hail (99).
See the HTTP Status Codes documentation for a complete reference of common API errors and HTTP status codes.
Invalid latitude or longitude values. Latitude must be between -90 and 90, and longitude must be between -180 and 180
date cannot be current or future date
please pass correct parameters
Location not found