๐ง Provide normalized weather forecasts with WeatherAPI and Open-Meteo
โก 9 views ยท ๐ง Miscellaneous
Description
Quick overview
This workflow exposes a webhook-based weather proxy API that builds a request from query parameters, fetches forecast data from WeatherAPI or historical averages from Open-Meteo Archive, and returns a simplified JSON response with key temperature and condition fields.
How it works
- Receives a webhook request on the
/weather-proxyendpoint with query parameters likelat,lon, andstart_date. - Builds an external API URL by comparing
start_dateto today, using WeatherAPI for dates within 14 days and Open-Meteo Archive for older dates. - Calls the selected weather provider over HTTP to retrieve forecast or historical daily weather data.
- Normalizes the provider response into a compact JSON payload (max/min temperature and a derived condition such as hot/cold/rain/snow, plus rain chance or rain percentage).
- Returns the formatted JSON response to the webhook caller with CORS and JSON content-type headers.
Setup
- Replace the hardcoded WeatherAPI key in the parameter-building code with your own WeatherAPI API key.
- Ensure the calling app sends
lat,lon, andstart_dateas webhook query parameters (or rely on the default Tokyo coordinates). - Copy the production webhook URL for
/weather-proxyand configure it in your client application as the weather endpoint.
๐ Nodes Used
HTTP Request, Webhook
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File