Foreca Weather API · Documentation

Historical Weather API Documentation

Historical Weather API provides observational weather information from the past by showing measured weather parameters in a certain location at a specific date. The API delivers all the measured weather parameters as both daily summary values and hourly values. The queries can be made based on a given day and coordinate point.

Read more about features, use cases and plans: Historical Weather API overview

Get an API key

The API will respond with observational data from the nearest relevant weather station or from weather forecast model data (augmented observation). Augmented observations are provided when the closest weather station with sufficient observations is too far away to give representative information.

Observations come from official weather stations:

  • SYNOP stations, mainly on land and at sea, from 1 January 2009
  • METAR stations, mainly at airports, from 1 January 2011
  • Augmented observations for every SYNOP and METAR location from about mid-January 2016, and augmented snow depth from 9 February 2016
Historical Weather Operations

Endpoints

Point history

Path Parameters

your_endpoint_idType: stringrequired

path segment

Query Parameters

lonType: stringrequired

Longitude

latType: stringrequired

Latitude

dateType: stringrequired

Date in YYYYMMDD format

daysType: string

Number of days returned, starting at "date" (default 1, maximum 14)

tempunitType: string

Temperature unit (F, C; default C)

windunitType: string

Wind unit (MS, KTS, KMH, MPH, BFT; default MS)

precunitType: string

Precipitation unit (MM, IN)

langType: string

Language (ISO 639-1 codes). Options: de, en, es, fr, it, pl, ru, fi, sv, nl, ko, pt, th, tr, zh, zh_TW (Chinese in Taiwan), zh_CN (Chinese in China). (default en)

optparamsType: string

Optional parameters to include in the response. Currently supported: "station" - includes the weather station name and coordinates from which the observations originate.

GET/{your_endpoint_id}/json.phpShell Curl
curl 'https://fhw.foreca.com/{your_endpoint_id}/json.php' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
200
{
  "station": {
    "name": "Tholen Wp",
    "lon": 4.2,
    "lat": 51.48
  },
  "hourly": {
    "date": {
      "pretty": "00:00 on January 23, 2016",
      "year": "2016",
      "month": "01",
      "day": "23",
      "hour": "00",
      "min": "00",
      "tz": "Europe/Amsterdam"
    },
    "utcdate": {
      "iso8601": "2016-01-22T23:00",
      "year": "2016",
      "month": "01",
      "day": "22",
      "hour": "23",
      "min": "00",
      "tz": "UTC"
    },
    "observations": [
      {
        "dt": {
          "pretty": "00:00 on January 23, 2016",
          "year": "2016",
          "month": "01",
          "day": "23",
          "hour": "00",
          "min": "00",
          "tz": "Europe/Amsterdam"
        },
        "dtu": {
          "iso8601": "2016-01-22T23:00",
          "year": "2016",
          "month": "01",
          "day": "22",
          "hour": "23",
          "min": "00",
          "tz": "UTC"
        },
        "t": "5.7",
        "d": "5.6",
        "rh": "99",
        "ws": "4",
        "gust": "4",
        "wd": "230",
        "wn": "southwest",
        "v": "400",
        "p": "1022.2",
        "tf": "3",
        "pr1": "",
        "sT": "Haze",
        "s": "600",
        "fog": "1",
        "rain": "0",
        "snow": "0",
        "hail": "0",
        "thunder": "0",
        "tornado": "0"
      }
    ]
  },
  "dailysummary": {
    "dt": {
      "pretty": "00:00 on January 23, 2016",
      "year": "2016",
      "month": "01",
      "day": "23",
      "hour": "00",
      "min": "00",
      "tz": "Europe/Amsterdam"
    },
    "fog": "1",
    "rain": "0",
    "snow": "0",
    "snowfall": "",
    "snowfallmonthtodate": "",
    "snowfallsincejul1": "",
    "snowdepth": "",
    "hail": "0",
    "thunder": "0",
    "tornado": "0",
    "ta": "6.2",
    "da": "5.6",
    "pa": "1029.7",
    "wsa": "3.5",
    "wna": "north",
    "wda": "219",
    "va": "4857",
    "rha": "96",
    "tx": "8",
    "tn": "4",
    "rhx": "100",
    "rhn": "87",
    "dx": "7",
    "dn": "4",
    "px": "1033.5",
    "pn": "1022.2",
    "wsx": "5",
    "wsn": "2",
    "vx": "10600",
    "vn": "390",
    "pr24": "",
    "prtype": "noprec"
  }
}
{
  "type": "object",
  "properties": {
    "station": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "example": "Tholen Wp"
        },
        "lon": {
          "type": "number",
          "example": 4.2
        },
        "lat": {
          "type": "number",
          "example": 51.48
        }
      },
      "description": "Weather station information (included when optparams=station). Contains name (string), lon (number) and lat (number)."
    },
    "hourly": {
      "type": "object",
      "properties": {
        "date": {
          "type": "object",
          "properties": {
            "pretty": {
              "type": "string",
              "example": "00:00 on January 23, 2016"
            },
            "year": {
              "type": "string",
              "example": "2016"
            },
            "month": {
              "type": "string",
              "example": "01"
            },
            "day": {
              "type": "string",
              "example": "23"
            },
            "hour": {
              "type": "string",
              "example": "00"
            },
            "min": {
              "type": "string",
              "example": "00"
            },
            "tz": {
              "type": "string",
              "example": "Europe/Amsterdam"
            }
          }
        },
        "utcdate": {
          "type": "object",
          "properties": {
            "iso8601": {
              "type": "string",
              "example": "2016-01-22T23:00"
            },
            "year": {
              "type": "string",
              "example": "2016"
            },
            "month": {
              "type": "string",
              "example": "01"
            },
            "day": {
              "type": "string",
              "example": "22"
            },
            "hour": {
              "type": "string",
              "example": "23"
            },
            "min": {
              "type": "string",
              "example": "00"
            },
            "tz": {
              "type": "string",
              "example": "UTC"
            }
          }
        },
        "observations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "dt": {
                "type": "object",
                "properties": {
                  "pretty": {
                    "type": "string",
                    "example": "00:00 on January 23, 2016"
                  },
                  "year": {
                    "type": "string",
                    "example": "2016"
                  },
                  "month": {
                    "type": "string",
                    "example": "01"
                  },
                  "day": {
                    "type": "string",
                    "example": "23"
                  },
                  "hour": {
                    "type": "string",
                    "example": "00"
                  },
                  "min": {
                    "type": "string",
                    "example": "00"
                  },
                  "tz": {
                    "type": "string",
                    "example": "Europe/Amsterdam"
                  }
                }
              },
              "dtu": {
                "type": "object",
                "properties": {
                  "iso8601": {
                    "type": "string",
                    "example": "2016-01-22T23:00"
                  },
                  "year": {
                    "type": "string",
                    "example": "2016"
                  },
                  "month": {
                    "type": "string",
                    "example": "01"
                  },
                  "day": {
                    "type": "string",
                    "example": "22"
                  },
                  "hour": {
                    "type": "string",
                    "example": "23"
                  },
                  "min": {
                    "type": "string",
                    "example": "00"
                  },
                  "tz": {
                    "type": "string",
                    "example": "UTC"
                  }
                }
              },
              "t": {
                "type": "string",
                "example": "5.7",
                "description": "Temperature"
              },
              "d": {
                "type": "string",
                "example": "5.6",
                "description": "Dew point"
              },
              "rh": {
                "type": "string",
                "example": "99",
                "description": "Relative humidity (%)"
              },
              "ws": {
                "type": "string",
                "example": "4",
                "description": "Wind speed"
              },
              "gust": {
                "type": "string",
                "example": "4",
                "description": "Wind gust speed"
              },
              "wd": {
                "type": "string",
                "example": "230",
                "description": "Wind direction in degrees"
              },
              "wn": {
                "type": "string",
                "example": "southwest",
                "description": "Wind direction (N, NE, E, SE, S, SW, W, NW)"
              },
              "v": {
                "type": "string",
                "example": "400",
                "description": "visibility in meters, e.g. \"10000\" for 10 km"
              },
              "p": {
                "type": "string",
                "example": "1022.2",
                "description": "Atmospheric pressure normalized to sea level (hPa)"
              },
              "tf": {
                "type": "string",
                "example": "3",
                "description": "Feels like temperature"
              },
              "pr1": {
                "type": "string",
                "example": "",
                "description": "1 hour accumulated precipitation"
              },
              "sT": {
                "type": "string",
                "example": "Haze",
                "description": "symbol text"
              },
              "s": {
                "type": "string",
                "example": "600",
                "description": "Weather symbol code"
              },
              "fog": {
                "type": "string",
                "example": "1",
                "description": "Whether there was fog"
              },
              "rain": {
                "type": "string",
                "example": "0",
                "description": "Whether there was rain"
              },
              "snow": {
                "type": "string",
                "example": "0",
                "description": "Whether there was snow or sleet"
              },
              "hail": {
                "type": "string",
                "example": "0",
                "description": "Whether there was hail"
              },
              "thunder": {
                "type": "string",
                "example": "0",
                "description": "Whether there was thunder"
              },
              "tornado": {
                "type": "string",
                "example": "0",
                "description": "Whether there were tornadoes"
              }
            }
          }
        }
      }
    },
    "dailysummary": {
      "type": "object",
      "properties": {
        "dt": {
          "type": "object",
          "properties": {
            "pretty": {
              "type": "string",
              "example": "00:00 on January 23, 2016"
            },
            "year": {
              "type": "string",
              "example": "2016"
            },
            "month": {
              "type": "string",
              "example": "01"
            },
            "day": {
              "type": "string",
              "example": "23"
            },
            "hour": {
              "type": "string",
              "example": "00"
            },
            "min": {
              "type": "string",
              "example": "00"
            },
            "tz": {
              "type": "string",
              "example": "Europe/Amsterdam"
            }
          }
        },
        "fog": {
          "type": "string",
          "example": "1",
          "description": "Whether there was fog"
        },
        "rain": {
          "type": "string",
          "example": "0",
          "description": "Whether there was rain"
        },
        "snow": {
          "type": "string",
          "example": "0",
          "description": "Whether there was snow or sleet"
        },
        "snowfall": {
          "type": "string",
          "example": "",
          "description": "Accumulated snowfall (cm)"
        },
        "snowfallmonthtodate": {
          "type": "string",
          "example": "",
          "description": "Accumulated snowfall month-to-date"
        },
        "snowfallsincejul1": {
          "type": "string",
          "example": "",
          "description": "Accumulated snowfall since last July 1st"
        },
        "snowdepth": {
          "type": "string",
          "example": "",
          "description": "Snow depth (cm)"
        },
        "hail": {
          "type": "string",
          "example": "0",
          "description": "Whether there was hail"
        },
        "thunder": {
          "type": "string",
          "example": "0",
          "description": "Whether there was thunder"
        },
        "tornado": {
          "type": "string",
          "example": "0",
          "description": "Whether there were tornadoes"
        },
        "ta": {
          "type": "string",
          "example": "6.2",
          "description": "Average temperature"
        },
        "da": {
          "type": "string",
          "example": "5.6",
          "description": "Average dew point"
        },
        "pa": {
          "type": "string",
          "example": "1029.7",
          "description": "Average pressure (hPa)"
        },
        "wsa": {
          "type": "string",
          "example": "3.5",
          "description": "Average wind speed"
        },
        "wna": {
          "type": "string",
          "example": "north",
          "description": "Average wind direction name"
        },
        "wda": {
          "type": "string",
          "example": "219",
          "description": "Average wind direction (degrees)"
        },
        "va": {
          "type": "string",
          "example": "4857",
          "description": "Average visibility (meters)"
        },
        "rha": {
          "type": "string",
          "example": "96",
          "description": "Average relative humidity (%)"
        },
        "tx": {
          "type": "string",
          "example": "8",
          "description": "Maximum temperature"
        },
        "tn": {
          "type": "string",
          "example": "4",
          "description": "Minimum temperature"
        },
        "rhx": {
          "type": "string",
          "example": "100",
          "description": "Maximum relative humidity (%)"
        },
        "rhn": {
          "type": "string",
          "example": "87",
          "description": "Minimum relative humidity (%)"
        },
        "dx": {
          "type": "string",
          "example": "7",
          "description": "Maximum dew point"
        },
        "dn": {
          "type": "string",
          "example": "4",
          "description": "Minimum dew point"
        },
        "px": {
          "type": "string",
          "example": "1033.5",
          "description": "Maximum pressure (hPa)"
        },
        "pn": {
          "type": "string",
          "example": "1022.2",
          "description": "Minimum pressure (hPa)"
        },
        "wsx": {
          "type": "string",
          "example": "5",
          "description": "Maximum wind speed"
        },
        "wsn": {
          "type": "string",
          "example": "2",
          "description": "Minimum wind speed"
        },
        "vx": {
          "type": "string",
          "example": "10600",
          "description": "Maximum visibility (meters)"
        },
        "vn": {
          "type": "string",
          "example": "390",
          "description": "Minimum visibility (meters)"
        },
        "pr24": {
          "type": "string",
          "example": "",
          "description": "Accumulated precipitation from 24h"
        },
        "prtype": {
          "type": "string",
          "example": "noprec",
          "description": "Most occurred precipitation type (rain, hail, snow, mixed) or noprec if no precipitation during the time"
        }
      }
    }
  }
}
Success