Historical Weather APIs & Time-Series Analytics
Access daily and hourly historical weather data worldwide with APIFreaks’ Historical Weather APIs. Designed for accuracy and flexibility, it lets you retrieve detailed past weather records - including temperature, humidity, wind, precipitation, visibility, and astronomical details like sunrise, sunset, and moon phases - for any location, coordinates, or IP address.
You can retrieve historical weather data dating back to 1940, whether for a single day or an extended date range. For continuous datasets across multiple dates, use the Time-Series Weather API to fetch long-range climate records.
Built for developers and analysts, APIFreaks’ Historical Weather APIs power everything from climate research and data validation to weather analytics applications that demand precision, consistency, and global coverage.
Features
Global Historical Coverage
Retrieve historical weather data dating back to 1940 for any city, coordinate, or IP address worldwide.
Daily & Hourly Precision
Access daily historical weather data for long-term climate insights or hourly data for fine-grained event tracking and analysis.
Time Series Data
Use the Time-Series Weather API to fetch continuous past data between two dates - up to 90 days (daily) or 7 days (hourly).
Weather + Astronomical Data
Get combined data including temperature, humidity, wind, precipitation, sunrise, sunset, and moon cycles - all in one unified response.
Detailed Location Context
Each response includes complete geographic context with continent, country, state/province, district, city, locality, postal code, precise coordinates, elevation data, and timezone information.
Historical Lookup
API Endpoint
Time-Series Historical Lookup
API Endpoint
How to Guides
Get Historical Weather Data by Location, IP, or Coordinates
Retrieve past weather for a specific date using location, IP, or latitude-longitude parameters.
Example using Location
Use the location parameter to look up Historical weather by any location - city name, address etc.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/historical?location=New York, USA&date=2024-10-15&precision=daily&apiKey=API-KEY'
# Response
{
"location": {
"location_string": "New York, USA",
"country_name": "United States",
"state_prov": "New York",
"city": "Syracuse",
"locality": "Destiny USA Mall",
"latitude": "43.06923",
"longitude": "-76.17249",
"elevation": "128",
"timezone": "America/New_York",
"timezone_abbreviation": "GMT-5"
},
"historical": {
"daily": {
"timestamp": "2024-10-15",
"weather_code": 73,
"temperature_2m_mean": 5.9,
"temperature_2m_max": 9.1,
"temperature_2m_min": 3.8,
"apparent_temperature_mean": 2.7,
"apparent_temperature_max": 5,
"apparent_temperature_min": 1,
"precipitation_sum": 10.2,
"rain_sum": 9.3,
"snowfall_sum": 0.63,
"wind_speed_10m_max": 18.8,
"wind_gusts_10m_max": 38.9,
"wind_speed_10m_mean": 12,
"wind_speed_10m_min": 6.5,
Example using Coordinates
Use the lat and long parameters to retrieve historical weather conditions for any point on Earth.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/historical?lat=51.5074&long=-0.1278&date=2024-10-15&precision=hourly&apiKey=API-KEY'
# Response
{
"location": {
"latitude": "51.50740",
"longitude": "-0.12780",
"country_name": "",
"state_prov": "England",
"city": "London",
"locality": "",
"elevation": "12",
"timezone": "Europe/London",
"timezone_abbreviation": "GMT"
},
"historical": {
"hourly": [
{
"timestamp": "2024-10-15T00:00",
"temperature_2m": 10,
"relative_humidity_2m": 94,
"dew_point_2m": 9.1,
"apparent_temperature": 8.4,
"precipitation": 0,
"rain": 0,
"snowfall": 0,
"weather_code": 3,
"pressure_msl": 1017.7,
"surface_pressure": 1015.7,
"cloud_cover": 100,
"et0_fao_evapotranspiration": 0,
"wind_speed_10m": 9.3,
"wind_direction_10m": 103,
Example using IP
Use the ip parameter to display historical weather information at specific network locations.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/historical?ip=111.111.111.111&date=2024-10-15&precision=hourly&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "JP",
"country_code3": "JPN",
"country_name": "Japan",
"country_name_official": "Japan",
"is_eu": false,
"state_prov": "Tokyo",
"state_code": "JP-13",
"district": "Chiyoda",
"city": "Tokyo",
"zipcode": "102-0000",
"latitude": "35.69495",
"longitude": "139.75398",
"locality": "Chiyoda",
"elevation": "0",
"timezone": "Asia/Tokyo",
"timezone_abbreviation": "GMT+9"
},
"historical": {
"hourly": [
{
"timestamp": "2024-10-15T00:00",
"temperature_2m": 18.1,
"relative_humidity_2m": 91,
"dew_point_2m": 16.6,
"apparent_temperature": 18.5,
"precipitation": 0,
Auto-detect requesting users' IP address
If no location, IP, or coordinates are provided, the API automatically detects the requesting machine’s IP and returns daily weather data for that location.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/historical?date=2024-10-15&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"historical": {
"daily": {
"timestamp": "2024-10-15",
"weather_code": 0,
"temperature_2m_mean": 24.4,
"temperature_2m_max": 31.7,
"temperature_2m_min": 18.8,
"apparent_temperature_mean": 25.8,
"apparent_temperature_max": 33,
Control Historical Data Precision
The precision parameter lets you decide the level of detail you want for your historical query.
- Precision = daily: (Default) Best for climate trend analysis or summary statistics.
- Precision = hourly: Ideal for high-resolution analysis like event backtracking or forensic validation.
Example of "daily" Historical Data
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/historical?location=Sydney, Australia&date=2024-10-01&precision=daily&apiKey=API-KEY"'
# Response
{
"location": {
"location_string": "Sydney, Australia",
"country_name": "Australia",
"state_prov": "New South Wales",
"city": "Sydney",
"locality": "",
"latitude": "-33.86984",
"longitude": "151.20828",
"elevation": "10",
"timezone": "Australia/Sydney",
"timezone_abbreviation": "GMT+11"
},
"historical": {
"daily": {
"timestamp": "2024-10-01",
"weather_code": 1,
"temperature_2m_mean": 14.5,
"temperature_2m_max": 19.7,
"temperature_2m_min": 9,
"apparent_temperature_mean": 13.5,
"apparent_temperature_max": 20.7,
"apparent_temperature_min": 7.5,
"precipitation_sum": 0,
"rain_sum": 0,
"snowfall_sum": 0,
"wind_speed_10m_max": 18.6,
"wind_gusts_10m_max": 36.7,
"wind_speed_10m_mean": 10.2,
"wind_speed_10m_min": 2.6,
Example of "hourly" Historical Data
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/historical?location=Sydney, Australia&date=2024-10-01&precision=hourly&apiKey=API-KEY"
# Response
{
"location": {
"location_string": "Sydney, Australia",
"country_name": "Australia",
"state_prov": "New South Wales",
"city": "Sydney",
"locality": "",
"latitude": "-33.86984",
"longitude": "151.20828",
"elevation": "10",
"timezone": "Australia/Sydney",
"timezone_abbreviation": "GMT+11"
},
"historical": {
"hourly": [
{
"timestamp": "2024-10-01T00:00",
"temperature_2m": 11.2,
"relative_humidity_2m": 89,
"dew_point_2m": 9.4,
"apparent_temperature": 9.7,
"precipitation": 0,
"rain": 0,
"snowfall": 0,
"weather_code": 0,
"pressure_msl": 1022.7,
"surface_pressure": 1012.1,
"cloud_cover": 0,
"et0_fao_evapotranspiration": 0,
"wind_speed_10m": 8.8,
Get Time Series Weather Data (Date Ranges)
For continuous past weather across a range of dates, use the Time-Series Weather API. This allows you to fetch daily or hourly records for multiple days in one request.
- Precision=daily: (Default) Best for climate trend analysis or summary statistics. Suports upto 90 days.
- Precision=hourly: Ideal for high-resolution analysis like event backtracking or forensic validation. Supports upto 7 days.
Example of "Daily" Time Series Data
curl -X 'GET' "https://api.apifreaks.com/v1.0/weather/time-series?location=Toronto, Canada&startDate=2024-07-01&endDate=2024-07-15&precision=daily&apiKey=API-KEY"
# Response
{
"location": {
"location_string": "Toronto, Canada",
"country_name": "Canada",
"state_prov": "Ontario",
"city": "Toronto",
"locality": "",
"latitude": "43.65348",
"longitude": "-79.38393",
"elevation": "181",
"timezone": "America/Toronto",
"timezone_abbreviation": "GMT-5"
},
"historical": {
"2024-07-01": {
"daily": {
"timestamp": "2024-07-01",
"weather_code": 0,
"temperature_2m_mean": 18.3,
"temperature_2m_max": 24.1,
"temperature_2m_min": 11.5,
"apparent_temperature_mean": 17.6,
"apparent_temperature_max": 26,
"apparent_temperature_min": 9.4,
"precipitation_sum": 0,
"rain_sum": 0,
"snowfall_sum": 0,
"wind_speed_10m_max": 15.5,
"wind_gusts_10m_max": 30.6,
"wind_speed_10m_mean": 10.3,
Example of "Hourly" Time Series Data
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/time-series?lat=48.8566&long=2.3522&startDate=2024-09-10&endDate=2024-09-16&precision=hourly&apiKey=API-KEY"
# Response
{
"location": {
"latitude": "48.85660",
"longitude": "2.35220",
"country_name": "",
"state_prov": "Île-de-France",
"city": "Paris",
"locality": "",
"elevation": "0",
"timezone": "Europe/Paris",
"timezone_abbreviation": "GMT+1"
},
"historical": {
"2024-09-10": {
"hourly": [
{
"timestamp": "2024-09-10T00:00",
"temperature_2m": 14,
"relative_humidity_2m": 78,
"dew_point_2m": 10.3,
"apparent_temperature": 12,
"precipitation": 0,
"rain": 0,
"snowfall": 0,
"weather_code": 3,
"pressure_msl": 1016.3,
"surface_pressure": 1012,
"cloud_cover": 100,
"et0_fao_evapotranspiration": 0.02,
"wind_speed_10m": 14.8,
Auto-detect requesting users' IP address
If no location, IP address, or coordinates are provided, the API automatically detects the requester’s IP and returns daily time-series weather data for that location.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/time-series?&startDate=2024-07-01&endDate=2024-07-03&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"historical": {
"2024-07-01": {
"daily": {
"timestamp": "2024-07-01",
"weather_code": 53,
"temperature_2m_mean": 33.4,
"temperature_2m_max": 39.5,
"temperature_2m_min": 27.3,
"apparent_temperature_mean": 39.2,
Pricing
To perform a Historical Weather API request through the API, you will need API credits. Credits are only deducted for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.
- Historical Weather API: For each successful request, 2 credits will be charged.
- Time Series Weather API: For each successfully retrieved data, 5 credits will be charged.
Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.