Weather APIs

Technical documentation of the external APIs used by Snow Day Calculation — what each one does, how we use it, and how we handle caching, reliability, and failures.

🌤️

Open-Meteo Forecast API

api.open-meteo.com/v1/forecast

Purpose: Primary weather data source. Provides the live forecast variables used to compute the snow day probability score.

Provider: Open-Meteo — an open-source, free weather API that aggregates output from multiple global and regional numerical weather prediction models including GFS (NOAA), ECMWF, GEM (Environment Canada), and others. No API key is required; the service is free for non-commercial use.

Variables requested:

  • snowfall — hourly snowfall accumulation (cm)
  • temperature_2m — air temperature at 2 metres above ground (°C)
  • apparent_temperature — feels-like / wind chill temperature (°C)
  • precipitation_probability — probability of any precipitation occurring (%)
  • precipitation — total precipitation (mm, all types)
  • weathercode — WMO weather interpretation code
  • windspeed_10m — wind speed at 10 metres (km/h)
Update frequency
Every 1–6 hours depending on model run schedule
Forecast range
Up to 16 days ahead; we use the next 24–36 hours
Geographic coverage
Global — US and Canada well-supported
Client-side cache
~10 minutes (browser local storage)
Rate limits
10,000 requests/day per IP on the free tier (as of last check — see Open-Meteo terms for current limits)
Authentication
None required — no API key
📍

Open-Meteo Geocoding API

geocoding-api.open-meteo.com/v1/search

Purpose: Converts typed city names and postal codes into latitude/longitude coordinates, which are then passed to the forecast API.

Provider: Open-Meteo Geocoding — an open-source geocoding service backed by GeoNames and OpenStreetMap data. Supports city search by name with country filtering.

Usage in this site: When you type a city or ZIP code and press Predict, the geocoding API is queried first to resolve coordinates. The first result is used if it matches a city, town, or populated place. If the input cannot be resolved, the user sees an error prompting them to try a different format.

Client-side cache
~60 minutes — city-to-coordinate mappings rarely change
Fallback
If geocoding fails, the user is prompted to try a different location format
Authentication
None required
🔄

BigDataCloud Reverse Geocoding API

api.bigdatacloud.net/data/reverse-geocode-client

Purpose: Used for the "Use My Location" feature. When a user grants GPS permission, the browser provides raw coordinates. BigDataCloud converts those coordinates back into a human-readable city name for display in the prediction result header.

Provider: BigDataCloud — provides a free client-side reverse geocoding endpoint that runs directly in the browser. No server-side proxy is needed; the request goes from the user's browser directly to the BigDataCloud API.

Trigger
Only called when user clicks "Use My Location"
Data returned
City name, locality, country code — for display only
Authentication
None required for client-side endpoint
Fallback
If unavailable, coordinates are shown instead of a city name — prediction still works
📊

Open-Meteo Archive API

archive-api.open-meteo.com/v1/archive

Purpose: Powers the "Historical Snowfall Trends" chart. Retrieves monthly snowfall totals for the past several years to provide historical context for the current prediction.

Provider: Open-Meteo Historical Weather API — provides weather observations going back to 1940 for most global locations, based on the ERA5 reanalysis dataset from ECMWF.

Usage: This API is called only when the user explicitly clicks "Load Historical Data." It is not called on every prediction to keep API usage low and page load fast. Historical data is loaded once per session and is not cached persistently.

Data range
1940–present (ERA5 reanalysis)
On-demand loading
Not called automatically — user-triggered only
Fallback
If unavailable, chart shows an error message; prediction is unaffected

Caching Strategy

Snow Day Calculation uses a two-layer caching approach to reduce unnecessary API calls, improve response speed, and stay within free-tier usage limits:

No server-side caching proxy is used. All API calls go directly from the user's browser to the respective API provider.

Reliability & Failure Handling

If an API request fails (network error, API outage, rate limit exceeded), Snow Day Calculation shows a clear error message to the user rather than silently returning incorrect data. The prediction will not display until a successful API response is received. The historical chart (archive API) is the only optional component — if it fails, the main prediction is unaffected.

Rate Limits & Fair Use

Open-Meteo's free tier allows up to 10,000 forecast API calls per day per IP address (subject to change — refer to Open-Meteo's terms for current limits). Client-side caching significantly reduces the number of actual API calls made per user session. Snow Day Calculation does not currently use a server-side proxy or a commercial API plan. If the site's usage grows to a level where free-tier limits become a constraint, we will upgrade to a paid plan or explore alternative data sources.

📋
More context See the Data Sources page for how these APIs feed into the prediction model, or the References page for the underlying meteorological sources.