Weather API
v1.0.0 Release notes
The Weather API returns the current weather, an hourly forecast, a daily forecast and the weather along a route for one or more coordinates. Every answer carries the weather condition as text, the weather parameters in the unit system you choose, and, on the current weather and route answers, the official weather warnings that apply at each point.
The forecasts combine high-resolution regional models with a global model: where a regional model covers a point it is used, and the global model fills the rest of the forecast range. Daily values are computed per local calendar day of each point.
:::info Complete API Reference View the complete Weather API Reference for detailed request/response schemas, examples, and interactive documentation. :::
Endpoints:
| Endpoint | Returns |
|---|---|
GET /weather/CurrentWeather | the weather now, with weather warnings |
GET /weather/HourlyWeather | an hourly forecast, up to 240 hours |
GET /weather/DailyWeather | a daily forecast, up to 10 days |
GET /weather/WeatherRoute | the weather at each route point at the time you pass it, with weather warnings |
Base URL: https://api.magiclane.net/api/v1
Key Features
- Weather for up to 500 coordinates in one request
- Current weather with sunrise and sunset, "feels like" temperature, air quality and snow depth
- Hourly forecast with temperature, dew point, pressure, humidity, UV index, wind, precipitation, snowfall and snow depth
- Daily forecast per local calendar day with high and low temperature, precipitation, snowfall, snow depth, humidity, UV index, wind, gusts and "feels like" high and low
- Weather along a route: each point is answered for the time you reach it
- Official weather warnings with an encoded hazard and severity code, a severity rank for sorting, and optionally the warning area as polygons
- Metric, imperial UK and imperial US units; parameter names, weather conditions, warnings and unit symbols translated into the requested language
Common Parameters
All endpoints are GET requests with query parameters.
lat,lon- Latitude and longitude of a single point, in degreescoords- Several points as{lat,lon;lat,lon;...}(up to 500); instead oflat/lon. A point may carry its altitude in meters as a third value (lat,lon,alt); points without one get it from the elevation data. The route endpoint takes{lat,lon,timestamp;...}or{lat,lon,alt,timestamp;...}instead. Point formats may be mixed in one requestunit-metric(default),imperial_uk(imperialis accepted too) orimperial_us- see Unitsdetails-1for all weather parameters; without it the answer carries the short set (temperature and the weather condition, see each endpoint)extended-1, together withdetails=1, adds the daily precipitation, humidity, UV index, wind, gusts and "feels like" high / low, and the hourly precipitation (daily, hourly and route endpoints) - see Weather Parameterslang- Language of theTranslationsandUnitsblocks added to the answer - see Translationsformat-json(default and the only format served)
coords uses curly braces. With curl, pass -g (--globoff) so they are sent as they are.
Example Request - Current Weather with All Parameters
curl -g "https://api.magiclane.net/api/v1/weather/CurrentWeather?coords={45.65,25.60;40.71,-74.00}&details=1" \
-H "Authorization: YOUR_API_KEY"
The current weather of Brașov and New York, with all parameters. Each point also carries the weather warnings that apply there; add geometry=geojson or geometry=polyline to receive each warning's area (see Weather Warnings).
CurrentWeather parameters
lat/lonorcoords,unit,details,lang,format- see Common Parametersgeometry- The area of each warning:geojson(a GeoJSON geometry object) orpolyline(1is accepted too; encoded polylines); without it the warnings carry no geometry
Without details=1 the answer carries Temperature, Sunrise, Sunset and the warnings.
Example Request - Hourly Forecast
curl "https://api.magiclane.net/api/v1/weather/HourlyWeather?lat=45.65&lon=25.60&noHours=24&details=1&extended=1" \
-H "Authorization: YOUR_API_KEY"
The next 24 hours for Brașov, with all parameters including the hourly precipitation.
HourlyWeather parameters
lat/lonorcoords,unit,details,extended,lang,format- see Common ParametersnoHours- Number of hours (default48, at most240)startingWith- Unix timestamp in seconds of the first hour to return, when it lies in the future (default: the first forecast hour)
Without details=1 the answer carries Temperature and the weather condition of each hour.
Example Request - Daily Forecast
curl "https://api.magiclane.net/api/v1/weather/DailyWeather?lat=45.65&lon=25.60&noDays=7&details=1&extended=1&unit=imperial_us&lang=en-US" \
-H "Authorization: YOUR_API_KEY"
Seven days for Brașov in imperial US units, with all daily parameters and with the labels and unit symbols in American English.
DailyWeather parameters
lat/lonorcoords,unit,details,extended,lang,format- see Common ParametersnoDays- Number of days (default10, at most10)startingWith- Unix timestamp in seconds of the first day to return; the days before it count towardnoDays
Without details=1 the answer carries TemperatureHigh, TemperatureLow and the weather condition of each day; details=1 adds Snowfall and SnowDepth, and details=1&extended=1 adds the other daily parameters.
Example Request - Weather Along a Route
curl -g "https://api.magiclane.net/api/v1/weather/WeatherRoute?coords={45.65,25.60,1795434334;44.43,26.10,1795437934}&details=1&extended=1" \
-H "Authorization: YOUR_API_KEY"
Two points of a drive from Brașov to Bucharest, each with the Unix timestamp (seconds) at which it is reached. Each point is answered with the weather at that time, and with the weather warnings valid there at that time.
WeatherRoute parameters
coords- The route points with the time each is reached:{lat,lon,timestamp;...}or{lat,lon,alt,timestamp;...}unit,details,extended,lang,format- see Common Parametersgeometry- The area of each warning, as for the current weather
A point reached from 30 minutes in the past to 30 minutes ahead is answered with the current weather (values the current weather does not have, such as Precipitation, come from the hourly forecast), a later one with the hourly forecast for that time. A point whose timestamp lies more than 30 minutes in the past is answered with "Error": "No historical data" instead of weather. Without details=1 each point carries only Temperature. Use timestamps in the future: the ones in the example are past by now.
Response Structure
Every answer is a JSON object with:
unit- The unit system of the values (metric,imperial_ukorimperial_us)- The list of points, one object per requested point, in request order:
CurrentWeather(current weather),Hourly forecast,Daily forecastorWeather route
TranslationsandUnits- Only withlang(see Translations)warnings- Route endpoint only: the weather warnings referenced by the route points, each once; left out when no point has a warninginfo-copyrights: data attribution to show with the data
Point object (current weather, hourly and daily forecasts):
latitude,longitude- The pointUpdateTime- Unix timestamp in seconds (UTC) of the forecast run the values come fromCurrentParameters(current weather) - one condition objecthourlyWeatherParameters/dailyWeatherParameters- Array of condition objects, one per hour / day
Condition object:
date- Unix timestamp in seconds (UTC). Current weather: the moment of the answer. Hourly: the forecast hour. Daily: 00:00 UTC of the forecast dayWeatherConditions- The weather condition as English text, e.g."Light snow"(see Weather Conditions); translated inTranslationswhenlangis givendaylight-dayornight(not in daily forecasts)parameters- Object with one numeric value per weather parameter, keyed by the parameter name (see Weather Parameters). A parameter without a value at a point is left out - it is never sent as0or as a placeholder. On the current weather this object also holdsSunrise,Sunsetandwarnings
Route point object: a condition object (date is the point's timestamp) with latitude, longitude and, when warnings apply at that point and time, warnings - an array of indexes into the top-level warnings array.
Example Response - Daily Forecast (details=1&extended=1, metric)
{
"unit": "metric",
"Daily forecast": [
{
"latitude": 45.65,
"longitude": 25.6,
"UpdateTime": 1795392000,
"dailyWeatherParameters": [
{
"date": 1795392000,
"WeatherConditions": "Mixture of precipitations",
"parameters": {
"TemperatureHigh": 4,
"TemperatureLow": -2,
"Snowfall": 4.2,
"SnowDepth": 2.6,
"Precipitation": 6.5,
"Humidity": 91,
"UV": 0,
"WindSpeed": 21,
"WindGust": 52,
"WindDirection": 117,
"FeelsLikeHigh": 1,
"FeelsLikeLow": -7
}
},
{
"date": 1795478400,
"WeatherConditions": "Partly cloudy",
"parameters": {
"TemperatureHigh": 1,
"TemperatureLow": -5,
"Snowfall": 0.0,
"SnowDepth": 3.1,
"Precipitation": 0.0,
"Humidity": 78,
"UV": 1,
"WindSpeed": 6,
"WindGust": 31,
"WindDirectionVariable": 1,
"FeelsLikeHigh": -1,
"FeelsLikeLow": -8
}
}
]
}
],
"info": {
"copyrights": ["MagicLane"]
}
}
Example Response - Current Weather (details=1, metric)
{
"unit": "metric",
"CurrentWeather": [
{
"latitude": 45.65,
"longitude": 25.6,
"UpdateTime": 1795430400,
"CurrentParameters": {
"date": 1795430727,
"WeatherConditions": "Light rain",
"daylight": "day",
"parameters": {
"Temperature": 4,
"DewPoint": 1,
"Pressure": 997,
"Visibility": 1.78,
"Humidity": 97,
"UV": 0,
"WindSpeed": 11,
"WindDirection": 91,
"AirQuality": 8,
"FeelsLike": 1,
"SnowDepth": 0.2,
"warnings": [
{
"translationString": "EUSI.E",
"warningLevel": "yellow",
"warningSeverityRank": 208,
"warningPhenomenon": "ninsori viscolite; intensificări ale vântului",
"warningDescription": "Atenționare meteorologică: ninsori viscolite; intensificări ale vântului",
"warningStartDate": "2026-11-24T08:00:00Z",
"warningEndDate": "2026-11-24T18:00:00Z",
"countyName": "Brașov"
}
],
"Sunrise": 1795411656,
"Sunset": 1795444796
}
}
}
],
"info": {
"copyrights": ["MagicLane"]
}
}
Example Response - Weather Along a Route (details=1&extended=1)
{
"unit": "metric",
"Weather route": [
{
"date": 1795434334,
"WeatherConditions": "Light snow",
"daylight": "day",
"parameters": {
"Temperature": 2,
"DewPoint": 0,
"Pressure": 1004,
"Precipitation": 1.0,
"Humidity": 99,
"UV": 0,
"WindSpeed": 9,
"WindDirection": 118,
"Snowfall": 0.7,
"SnowDepth": 0.2,
"FeelsLike": 0
},
"latitude": 45.65,
"longitude": 25.6,
"warnings": [0]
},
{
"date": 1795437934,
"WeatherConditions": "Light rain",
"daylight": "day",
"parameters": {
"Temperature": 9,
"DewPoint": 6,
"Pressure": 1001,
"Precipitation": 0.2,
"Humidity": 82,
"UV": 0,
"WindSpeed": 29,
"WindDirection": 88,
"Snowfall": 0.0,
"SnowDepth": 0.0,
"FeelsLike": 5
},
"latitude": 44.43,
"longitude": 26.1
}
],
"warnings": [
{
"translationString": "EUSI.E",
"warningLevel": "yellow",
"warningSeverityRank": 208,
"warningPhenomenon": "ninsori viscolite moderate cantitativ, strat de zăpadă și intensificări ale vântului",
"warningDescription": "Avertizare meteorologică: ninsori viscolite moderate cantitativ, strat de zăpadă și intensificări ale vântului",
"warningStartDate": "2026-11-23T08:00:00Z",
"warningEndDate": "2026-11-24T00:00:00Z",
"countyName": "Brașov"
}
],
"info": {
"copyrights": ["MagicLane"]
}
}
Weather Parameters
Values are numbers in the unit system of the request (see Units). Which parameters an answer carries depends on the endpoint and on details / extended:
| Parameter | Meaning | Current | Hourly / route | Daily |
|---|---|---|---|---|
Temperature | air temperature | ✓ | ✓ | |
TemperatureHigh / TemperatureLow | highest / lowest temperature of the day | ✓ | ||
FeelsLike | "feels like" temperature: wind chill, heat index and the warming of the sun | details | details | |
FeelsLikeHigh / FeelsLikeLow | highest / lowest "feels like" temperature of the day | extended | ||
DewPoint | dew point | details | details | |
Pressure | air pressure | details | details | |
Humidity | relative humidity; daily: average of the day | details | details | extended |
UV | UV index; daily: highest of the day | details | details | extended |
Visibility | visibility | details | ||
AirQuality | air quality index from nearby monitoring stations | details | ||
WindSpeed | wind speed; daily: the strongest wind of the day | details | details | extended |
WindGust | the strongest gust of the day | extended | ||
WindDirection | the direction the wind comes from, in degrees clockwise from north (0 north, 90 east, 180 south, 270 west; 0 also for calm); daily: the direction the day's average wind comes from | details | details | extended |
WindDirectionVariable | value 1: the wind had no steady direction that day; a day has either WindDirection or WindDirectionVariable | extended | ||
Precipitation | precipitation as water; hourly: the hour ending at date; daily: total of the day | extended | extended | |
Snowfall | new snow; hourly: the hour ending at date; daily: total of the day | details | details | |
SnowDepth | snow on the ground; daily: the greatest depth of the day | details | details | details |
Sunrise / Sunset | Unix timestamps in seconds (UTC) of today's sunrise and sunset | ✓ |
✓ - always; details - with details=1; extended - with details=1&extended=1.
The daily values cover the local calendar day of each point. SnowDepth has no value over open water; AirQuality is only given where a monitoring station is near enough.
Units
| Parameter | metric | imperial_uk | imperial_us | Precision |
|---|---|---|---|---|
Temperatures (Temperature, TemperatureHigh / Low, FeelsLike, FeelsLikeHigh / Low, DewPoint) | °C | °C | °F | whole |
Pressure | mbar | mbar | inHg | whole (inHg: 2 decimals) |
WindSpeed, WindGust | km/h | mph | mph | whole |
WindDirection | ° | ° | ° | whole, 0–359 |
Visibility | km | mi | mi | 2 decimals |
Precipitation | mm | mm | in | 1 decimal (in: 2 decimals) |
Snowfall, SnowDepth | cm | cm | in | 1 decimal (in: 2 decimals) |
Humidity | % | % | % | whole |
UV, AirQuality | index | index | index | whole |
Weather Conditions
WeatherConditions is one of these English texts (translated in Translations when lang is given). Treat them as identifiers - compare them exactly as written (including "An icing mix changing to rain"):
All weather conditions
No report, Drizzle, Sprinkles, Scattered showers, A few showers, Light showers, Passing showers, Light rain, Rain showers, Rain, Numerous showers, Showery, Heavy rain, Lots of rain, Tons of rain, Flash floods, Widely scattered thunderstorms, Isolated thunderstorms, A few thunderstorms, Thundershowers, Thunderstorms, Strong thunderstorms, Severe thunderstorms, Hail, Tornado, Tropical storm, Hurricane, Light freezing rain, Light mixture of precipitations, Sleet, Icy mix, Freezing rain, Mixture of precipitations, Heavy mixture of precipitations, Snow changing to rain, Snow changing to an icy mix, An icy mix changing to snow, An icing mix changing to rain, Rain changing to snow, Rain changing to an icy mix, Scattered flurries, Snow flurries, Light snow showers, Snow showers, Light snow, Snow, Moderate snow, Heavy snow, Snowstorm, Blizzard, Sprinkles early, Showers early, Light rain early, Rain early, Heavy rain early, Thunderstorms early, Flurries early, Snow showers early, Light snow early, Snow early, Heavy snow early, Light icy mix early, Icy mix early, Sprinkles late, Showers late, Light rain late, Rain late, Heavy rain late, Isolated thunderstorms late, Scattered thunderstorms late, Thunderstorms late, Flurries late, Snow showers late, Light snow late, Snow late, Heavy snow late, Light icy mix late, Icy mix late, Sunny, Clear, Mostly sunny, Mostly clear, Hazy sunshine, Haze, Passing clouds, More sun than clouds, Scattered clouds, Partly cloudy, A mixture of sun and clouds, High level clouds, More clouds than sun, Partly sunny, Broken clouds, Mostly cloudy, Cloudy, Overcast, Low clouds, Light fog, Fog, Dense fog, Ice fog, Sandstorm, Duststorm, Increasing cloudiness, Decreasing cloudiness, Clearing skies, Breaks of sun late, Early fog followed by sunny skies, Afternoon clouds, Morning clouds, Smoke, Low level haze
Weather Warnings
The current weather (per point, inside parameters) and the route answer (top-level warnings, referenced by index from each route point) carry the official weather warnings that apply. The current weather lists every warning that has not yet ended, including warnings published for a later start; check warningStartDate if you want only the active ones. A route point lists the warnings valid at the time the point is reached.
Each warning has:
translationString- Encoded hazard and severity,<HAZARD>.<SEVERITY>, e.g."EUSI.E"(snow/ice, yellow). The translated warning name is inTranslationsunder this code whenlangis givenwarningLevel- Severity as an English word, as the issuing service names it (e.g."yellow","Warning","Severe")warningSeverityRank- One number to sort warnings from different services by: severity × 100 + hazard class. Severity (value / 100): 0 unknown, 1 minor, 2 moderate, 3 severe, 4 extreme, 5 the highest level of the European scale. Sort descending; the highest is the headline warningwarningPhenomenon,warningDescription- Texts of the issuing service, in its languagewarningStartDate,warningEndDate- ISO 8601 date and time, UTC (Z)countyName- Area name given by the issuing service- Further fields given by some services (e.g.
warningUrgency,warningCertainty,warningSeverity,color) - treat every field as optional geometry- Only withgeometry=: the warning's area.geometry=geojson: a GeoJSONPolygonorMultiPolygon([lon, lat]), with an extra"format": "geojson".geometry=polyline:{"format": "polyline", "type": "Polygon" | "MultiPolygon", "polygons": [{"outer": "<encoded polyline>", "holes": ["..."]}]}, Google encoded polylines with precision 5 (holesonly when there are any). Areas can hold thousands of points - request them only to draw them
Translations
With lang, the answer gets two more objects:
Translations- The translated texts of what the answer contains: parameter names (keyed by the parameter name), weather conditions (keyed by the English text), warning names (keyed bytranslationString),day/nightand the labelslatitude,longitude,coordinates,daylight,WeatherConditions. Daily forecasts useLatitude,Longitude,Coordinatesand have nodaylight,day,night; the current weather also hasDay,NightUnits- The translated unit symbol of each parameter of the answer that has a unit, for the requested unit system
lang takes an ISO 639-2 code with an optional region (deu, ron, eng-USA, srp_Latn) or an ISO 639-1 form (de, en-US, zh-TW, es-419); a region without its own translation falls back to the language (de-CH → German), an unknown language to English. The weather values themselves are the same with and without lang.
Example - Daily Forecast with lang=deu
"Translations": {
"FeelsLikeHigh": "Gefühlt max.",
"FeelsLikeLow": "Gefühlt min.",
"Humidity": "Luftfeuchtigkeit",
"Mixture of precipitations": "Wechsel der Niederschlagsarten",
"Precipitation": "Niederschlag",
"TemperatureHigh": "Hoch",
"TemperatureLow": "Niedrig",
"WindDirectionVariable": "Umlaufend",
"WindGust": "Böen",
"WindSpeed": "Windgeschwindigkeit"
},
"Units": {
"FeelsLikeHigh": "°C",
"Precipitation": "mm",
"TemperatureHigh": "°C",
"WindGust": "km/h",
"WindSpeed": "km/h"
}
Errors
A request that cannot be answered returns HTTP 400 with an Error text, for example:
{ "Error": "Coordinates are wrong! Either latitude or longitude is missing or the values are not in the right intervals." }
Other 400 causes: a malformed point in coords (the text names the point), more than 500 points, an unknown unit ("Unknown metric system: ..."), an unknown geometry ("Unknown geometry format: ..."), an unknown format. A route point more than 30 minutes in the past is answered with "Error": "No historical data" in place of its weather, while the other points are answered normally. An hourly request with no data for the point is answered with 400 and { "error": "No data" }.
When there is no forecast data, the hourly and route endpoints answer 500 with { "Error": "No forecast data are available." }. When the weather data is temporarily not available, every endpoint answers 503 with an empty body.
Related Documentation
- Routing API - Compute the route whose points and times you pass to the weather route endpoint