Discover/SMHI API
live

SMHI APIsmhi.se

Access Swedish weather forecasts, current conditions, MESAN observations, and active severe weather warnings for any location in Sweden via the SMHI API.

Endpoint health
verified 4d ago
search_locations
get_current_weather
get_analysis
get_forecast
get_warnings
5/5 passing latest checkself-healing
Endpoints
5
Updated
18d ago

What is the SMHI API?

The SMHI API provides 5 endpoints covering Swedish weather data: search any Swedish place by name with search_locations, retrieve a 10-day hourly forecast with get_forecast, pull current conditions with get_current_weather, access MESAN model observations with get_analysis, and fetch all active national warnings with get_warnings. Every location-specific endpoint accepts a geonameid obtained from the search endpoint.

Try it
The city or place name to search for (e.g. 'Stockholm', 'Göteborg').
api.parse.bot/scraper/59cbac26-14c5-46e0-8e23-da063f04e411/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/59cbac26-14c5-46e0-8e23-da063f04e411/search_locations?query=Stockholm' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace smhi-se-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""SMHI Weather API — search locations, check conditions, read forecasts and warnings."""
from parse_apis.SMHI_Weather_API import SMHI, WarningLevel, LocationNotFound

client = SMHI()

# Search for a Swedish city and get the top result.
stockholm = client.locations.search(query="Stockholm", limit=3).first()
print(f"Found: {stockholm.place} ({stockholm.municipality}), pop {stockholm.population}")

# Get current weather for the location (instance method via constructible key).
current = stockholm.get_current_weather()
print(f"Current: {current.t}°C, symbol={current.wsymb2}, time_of_day={current.time_of_day}")

# Get the 10-day forecast and inspect the first day's summary.
forecast = stockholm.get_forecast()
day = forecast.forecast10d.days[0]
print(f"Today: {day.summary.min_temp}–{day.summary.max_temp}°C, precip={day.summary.acc_prec}mm")

# Get MESAN analysis (observations) for the location.
analysis = stockholm.get_analysis()
print(f"Analysis model: {analysis.modeltype}, approved: {analysis.approved_time}")

# List active weather warnings across Sweden.
for warning in client.warnings.list(limit=5):
    print(f"⚠ {warning.area_name.en}: {warning.event_description.en} [{warning.warning_level.code}]")

# Typed error handling: catch LocationNotFound for an invalid geonameid.
try:
    bad = client.location("0000000").get_current_weather()
except LocationNotFound as exc:
    print(f"Not found: geonameid={exc.geonameid}")

print("Exercised: locations.search, get_current_weather, get_forecast, get_analysis, warnings.list")
All endpoints · 5 totalmissing one? ·

Search for locations in Sweden by name. Returns a list of matching places with geonameid, coordinates, and administrative metadata. Results include nearby cities for larger metro areas. The geonameid from results is required for all weather data endpoints.

Input
ParamTypeDescription
queryrequiredstringThe city or place name to search for (e.g. 'Stockholm', 'Göteborg').
Response
{
  "type": "object",
  "fields": {
    "locations": "array of location objects with geonameid, place, lat, lon, type, municipality, county, country, district, population"
  },
  "sample": {
    "data": {
      "locations": [
        {
          "lat": 59.3294681359869,
          "lon": 18.0626392364502,
          "type": [
            "PPLC"
          ],
          "place": "Stockholm",
          "county": "Stockholms län",
          "country": "Sverige",
          "district": "Stockholms domkyrkodistrikt",
          "timezone": "Europe/Stockholm",
          "geonameid": 2673730,
          "population": 1253309,
          "municipality": "Stockholm"
        }
      ]
    },
    "status": "success"
  }
}

About the SMHI API

Location Search and Identifier Lookup

All weather data endpoints require a geonameid, which you get from search_locations. Pass a Swedish place name via the query parameter and receive an array of matching locations, each with geonameid, lat, lon, municipality, county, type, and population. Results include nearby cities for larger metropolitan areas, so it is worth checking multiple results when querying common place names.

Forecast and Current Conditions

get_forecast returns 10-day hourly weather data organized into three structures: forecast10d (a days array with per-hour temperature, precipitation, wind, and weather symbol codes), forecast24h (24-hour summary periods), and forecast6h (6-hour summary periods). Each day also exposes summary statistics. get_current_weather is narrower: it returns the next-hour temperature in Celsius (t), a wSymb2 weather symbol code on a 1–27 scale indicating conditions from clear sky to heavy snow, a day/night flag, and a refTime ISO timestamp — useful for lightweight current-conditions widgets.

Observations and Warnings

get_analysis exposes the MESAN numerical analysis model output, which reflects observed conditions rather than predictions. The response includes an approvedTime, referenceTime, and a days array of hourly measurements covering temperature, wind speed, humidity, visibility, and precipitation. get_warnings requires no parameters and returns all currently active national warnings with warningLevel values of Yellow, Orange, or Red, affected area names, event descriptions in both Swedish and English, approximate start and end times, and geographic polygons for mapping. The array is empty when no warnings are active.

Reliability & maintenanceVerified

The SMHI API is a managed, monitored endpoint for smhi.se — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when smhi.se changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official smhi.se API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
4d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Display current temperature and sky condition icons for any Swedish city using wSymb2 and t from get_current_weather.
  • Build a 10-day forecast widget using the forecast10d days array from get_forecast with hourly precipitation and wind data.
  • Alert users to active severe weather events by polling get_warnings and filtering on warningLevel Red or Orange.
  • Plot warning polygons on a map using the geographic boundary data returned in each warning object from get_warnings.
  • Compare observed vs. forecast conditions by pairing get_analysis MESAN output with get_forecast data for the same geonameid.
  • Resolve user-typed Swedish city names to coordinates and administrative metadata using search_locations with the municipality and county fields.
  • Build an hourly visibility and humidity dashboard for logistics planning using the days array from get_analysis.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does SMHI have an official developer API?+
Yes. SMHI publishes open data APIs at opendata.smhi.se, including meteorological forecasts, observations, and climate data, under an open license. The Parse API surfaces a curated subset of SMHI's data formatted for direct application use.
What does `get_warnings` return when conditions are calm?+
The warnings array will be empty. When warnings are active, each object includes id, areaName, warningLevel (Yellow/Orange/Red), eventDescription, affectedAreas, descriptions in Swedish and English, approximateStart, approximateEnd, and geographic polygon data.
Does the API cover weather data outside Sweden?+
No. Coverage is limited to Swedish locations. The search_locations endpoint only returns results within Sweden, and all forecast, analysis, and warning data is scoped to Swedish geography. You can fork this API on Parse and revise it to add endpoints targeting other countries or data sources.
How far back do the MESAN observations from `get_analysis` go?+
The get_analysis response includes recent hourly measurements organized by day, but it does not expose a configurable historical date range — it reflects current model output near the time of the request. The API does not currently support querying historical weather records by date. You can fork it on Parse and revise to add a historical observations endpoint if the underlying data source exposes one.
Can I get forecast data for specific coordinates rather than a `geonameid`?+
Not currently. All location-specific endpoints — get_forecast, get_current_weather, and get_analysis — require a geonameid obtained from search_locations. Direct latitude/longitude input is not supported as a parameter. You can fork this API on Parse and revise it to add coordinate-based lookup.
Page content last updated . Spec covers 5 endpoints from smhi.se.
Related APIs in WeatherSee all →
metoffice.gov.uk API
Access detailed UK weather forecasts, real-time lightning tracking, and weather warnings from the Met Office. Search locations to retrieve hourly, daily, regional, and long-range predictions, and monitor storm activity with spot forecasts across any geographic area.
weatherunderground.com API
Get real-time weather data and 10-day forecasts for any location, with access to current conditions like temperature, humidity, and wind speed. Search for locations and receive detailed weather narratives to plan your day or week ahead.
meteo.pl API
Get detailed weather forecasts with temperature, pressure, wind, precipitation, and cloud data for any location using multiple weather models (UM, GFS) from Poland's Institute of Meteorology and Water Management. Search locations and access available forecasts to plan ahead with comprehensive meteorological information.
weatherspark.com API
Get historical weather data, current METAR reports, and monthly climate summaries for any location by searching WeatherSpark's comprehensive weather database. Access detailed weather insights including temperature trends, precipitation patterns, and atmospheric conditions to power weather-dependent applications and analysis.
accuweather.com API
Get real-time weather conditions, multi-day forecasts, and health alerts for any location worldwide. Search cities and access detailed data including allergen information and air quality to plan your activities with confidence.
openweathermap.org API
Search for cities and retrieve live weather conditions and forecasts (current, minutely precipitation, hourly and daily) by coordinates or by city name.
weatherforecast.com API
Get detailed 12-day weather forecasts for any location worldwide, with temperature, wind, rain, humidity, and UV index data updated three times daily. Search locations and retrieve comprehensive weather information suitable for travel planning, research, and general forecasting needs.
bom.gov.au API
Get accurate weather forecasts for Australian cities with temperature, precipitation, UV index, and conditions from the Bureau of Meteorology. Search for any location and retrieve multi-day forecasts to plan your activities with confidence.