/history provides hourly historical weather api data for any location worldwide. Only available for Plus and Business plan.

GET Base URL
https://historical.weatherxu.com/v1/history
Requires authentication via API Key
Parameter Description
lat Required Latitude of the location (-90 to 90)
lon Required Longitude of the location (-180 to 180)
start Required Start time (Unix timestamp)
end Required End time (Unix timestamp)
units Optional Unit system for response values:
  • metric: Temperature in Celsius, wind speed in m/s, ...
  • imperial: Temperature in Fahrenheit, wind speed in mph, ...
Default: 'metric'. See units table for details.

Basic request with query parameter API key:

https://historical.weatherxu.com/v1/history?lat=40.7128&lon=-74.0060
        &start=1704880800&end=1704970800
        &api_key=YOUR_API_KEY
Using API key as a query parameter for New York City historical weather between January 10, 2024 at 10am to January 11, 2024 at 11am.

Basic request with header API key:

curl https://historical.weatherxu.com/v1/history?lat=40.7128&lon=-74.0060 \
    &start=1704880800&end=1704970800 \
    -H 'X-API-KEY: YOUR_API_KEY'
Using API key in request header for New York City historical weather between January 10, 2024 at 10am to January 11, 2024 at 11am.

Request with imperial units:

curl https://historical.weatherxu.com/v1/history?lat=34.0522&lon=-118.2437&units=imperial \
    &start=1704880800&end=1704970800 \
    -H 'X-API-KEY: YOUR_API_KEY'
Returns all historical weather data for Los Angeles with temperature in Fahrenheit and wind speed in mph between January 10, 2024 at 10am to January 11, 2024 at 11am.

Below is an abbreviated response for Los Angeles (34.0522°N, -118.2437°W) using metric units. The response includes hourly historical weather data between January 10, 2024 at 10am to January 11, 2024 at 11am.

Sample response (metric)
https://historical.weatherxu.com/v1/history?lat=34.0522&lon=-118.2437&start=1704880800&end=1704970800
Sample response (imperial)
https://historical.weatherxu.com/v1/history?lat=34.0522&lon=-118.2437&start=1704880800&end=1704970800&units=imperial

{
    "success": true,
    "data": {
        "latitude": 40.7128,
        "longitude": -74.006,
        "units": "metric",
        "timezone": "America/New_York",
        "timezone_abbreviation": "EST",
        "timezone_offset": -18000,
        "dt": 1704880800,
        "hourly": {
            "data": [
                {
                  "forecastStart": 1704880800,
                  "apparentTemperature": 10.82,
                  "cloudCover": 0.46,
                  "dewPoint": 8.35,
                  "pressure": 981,
                  "humidity": 0.81,
                  "precipIntensity": 0,
                  "temperature": 11.5,
                  "windGust": 46.08,
                  "windSpeed": 17.08,
                  "windDirection": 252,
                  "icon": "partly_cloudy"
                },
                // Additional hourly forecasts
            ]
        }
    }
}

Please take a look at Units for a complete list of available units for each parameter.

Parameter Type Description
latitude string Latitude of the location (-90 to 90)
longitude string Longitude of the location (-180 to 180)
units string Unit system for response values. Learn more
timezone string IANA timezone identifier (e.g., "America/Los_Angeles")
timezone_abbreviation string Timezone abbreviation (e.g., "PDT")
timezone_offset number Offset from UTC in seconds
dt number Unix timestamp for the start of request

Array containing hour-by-hour forecast. Each hour contains:

[Array]
Parameter Type Description
apparentTemperature number "Feels like" temperature
cloudCover number Percentage of sky covered by clouds
dewPoint number Dew point in degrees
forecastStart number Unix timestamp for the start of this forecast period
humidity number Relative humidity percentage
icon string Weather condition icon identifier
precipIntensity number Precipitation intensity
pressure number Sea-level air pressure
temperature number Air temperature in degrees
windDirection number Wind direction in degrees
windGust number Wind gust speed
windSpeed number Wind speed