sverigesmiljomal APIsverigesmiljomal.se ↗
Access Sweden's environmental quality objectives and indicators via API. Retrieve gravel production time-series, regional breakdowns, and indicator data for all 21 counties.
What is the sverigesmiljomal API?
This API exposes 13 endpoints covering Sweden's official environmental quality objectives (miljökvalitetsmål) and associated indicators from sverigesmiljomal.se. Endpoints like get_national_gravel_production return annual time-series data in millions of tonnes across material types (Naturgrus, Krossberg, Morän), while list_all_indicators enumerates every tracked environmental indicator with its goal association and slug for downstream lookups.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/4123503b-86ae-46e1-b6f0-7f0f653066d6/get_national_gravel_production' \ -H 'X-API-Key: $PARSE_API_KEY'
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 sverigesmiljomal-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.
"""Walkthrough: Sveriges Miljömål SDK — bounded, re-runnable; every call capped."""
from parse_apis.sveriges_miljömål_api import SverigesMiljomal, IndicatorNotFound
client = SverigesMiljomal()
# Get national gravel production trends — the primary dataset.
national = client.gravelproductions.get_national()
print(f"National: {national.title} ({national.subtitle})")
for series in national.series:
print(f" {series.name}: {len(series.data)} data points")
# List environmental goals and drill into one goal's indicators.
goal = client.goals.list(limit=3).first()
if goal:
print(f"\nGoal: {goal.name} (slug={goal.slug})")
for indicator in goal.indicators.list(limit=3):
print(f" Indicator: {indicator.name} [{indicator.indicator_slug}]")
# Get regional gravel production for a specific county.
regional = client.gravelproductions.get_regional(county_slug="stockholms-lan")
print(f"\nRegional: {regional.title} — {regional.subtitle}")
for series in regional.series:
print(f" {series.name}: {len(series.data)} data points")
# Get indicator chart detail with typed-error handling.
try:
detail = client.indicatordetails.get(
url="https://sverigesmiljomal.se/miljomalen/grundvatten-av-god-kvalitet/grusanvandning/"
)
for chart in detail.data:
print(f"\nChart: {chart.title} ({chart.subtitle})")
except IndicatorNotFound as exc:
print(f"Indicator not found: {exc}")
# Get annual follow-up summary.
followup = client.annualfollowups.get()
print(f"\nAnnual followup: {followup.summary[:80]}...")
print(f"Source: {followup.url}")
print("\nexercised: gravelproductions.get_national / goals.list / goal.indicators.list / gravelproductions.get_regional / indicatordetails.get / annualfollowups.get")
Retrieves national-level gravel production time-series data from the Grusanvändning indicator page. Returns annual delivered quantities for Naturgrus, Krossberg, and Morän in millions of tonnes as [year, value] pairs. One chart object with title, subtitle (Sverige), and series array.
No input parameters required.
{
"type": "object",
"fields": {
"title": "string, chart title describing the data series",
"xAxis": "array of category labels or null when data uses [x,y] pairs",
"series": "array of objects each with name (string) and data (array of [year, value] pairs)",
"subtitle": "string, geographic scope (e.g. 'Sverige')"
},
"sample": {
"data": {
"title": "Naturgrusanvändning - krossberg, morän och naturgrus",
"xAxis": null,
"series": [
{
"data": [
[
1994,
28.6
],
[
2024,
84.9
]
],
"name": "Krossberg"
},
{
"data": [
[
1994,
3.2
],
[
2024,
0.9
]
],
"name": "Morän"
},
{
"data": [
[
1994,
43.8
],
[
2024,
3.83
]
],
"name": "Naturgrus"
}
],
"subtitle": "Sverige"
},
"status": "success"
}
}About the sverigesmiljomal API
Environmental Goals and Indicators
The list_environmental_goals endpoint returns the names, URLs, and slugs of all Swedish environmental quality objectives found on the miljömålen index page. From there, list_all_indicators provides a full enumeration of every indicator with its goal_slug, indicator_slug, and page URL. You can narrow results by goal using list_indicators_for_goal, passing a goal_slug value such as grundvatten-av-god-kvalitet or begransad-klimatpaverkan. The get_groundwater_goal_overview endpoint targets the Good Quality Groundwater goal specifically, returning the goal name and a list of related indicators with their URLs.
Gravel Production and Usage Data
Several endpoints focus on the Grusanvändning (gravel use) indicator. get_national_gravel_production returns a national time-series with title, subtitle, xAxis categories, and a series array where each object contains a material name and an array of [year, value] pairs. For county-level data, get_regional_gravel_production accepts a county_slug (e.g. skane-lan, vasterbottens-lan) and returns the same structure scoped to that county. get_gravel_usage_by_application_national breaks down natural gravel extraction by application category (Betong, Väg, Fyllnad, Övrigt, etc.) over time. get_gravel_usage_by_region_snapshot returns a cross-county snapshot for the most recent year, while get_gravel_share_map_data provides per-county percentage shares keyed by Highcharts map codes such as se-st for Stockholm.
Arbitrary Indicator Data
get_indicator_detail and get_indicator_download_data are functionally equivalent: both accept an absolute indicator page URL and return all chart configurations found on that page as an array of objects, each with title, subtitle, xAxis, and series. This covers any indicator on the site, not just gravel. For county-level breakdowns, get_indicator_regional_detail takes a goal_slug, county_slug, and indicator_slug and returns the same chart structure — if the indicator does not support regional data, the response data array will be empty. The get_annual_followup endpoint retrieves the summary text from the fakta-och-statistik annual review page along with the source URL.
The sverigesmiljomal API is a managed, monitored endpoint for sverigesmiljomal.se — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when sverigesmiljomal.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 sverigesmiljomal.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.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track annual trends in natural gravel vs. crushed rock extraction across Swedish counties using
get_regional_gravel_production. - Map natural gravel share by county using Highcharts map codes from
get_gravel_share_map_data. - Build a dashboard of all Swedish environmental quality objectives by iterating over results from
list_environmental_goalsandlist_all_indicators. - Pull time-series data for any environmental indicator by passing its page URL to
get_indicator_detail. - Compare gravel usage by application type (concrete, road, fill, other) over time using
get_gravel_usage_by_application_national. - Generate county-level reports on environmental indicator status using
get_indicator_regional_detailwith a specificcounty_slug. - Retrieve the latest annual environmental follow-up summary text programmatically via
get_annual_followup.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 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.
Does sverigesmiljomal.se have an official developer API?+
What does `get_indicator_regional_detail` return when a county-level breakdown is not available for an indicator?+
data field that is an empty array. Not all indicators on sverigesmiljomal.se expose county-level chart data, so callers should check for an empty array before processing results.Does the API return goal assessment status or definition text for environmental goals other than groundwater?+
get_groundwater_goal_overview targets a specific goal overview page, and even that endpoint notes that definition and assessment_status may be empty depending on page rendering. The other goal overview pages are not individually addressed by dedicated endpoints. You can fork this API on Parse and revise it to add dedicated overview endpoints for other goals such as Begränsad klimatpåverkan or Ingen övergödning.Does the API expose historical gravel data broken down by both county and application type simultaneously?+
get_gravel_usage_by_region_snapshot provides application-type breakdowns across all 21 counties but only for the most recent available year. get_regional_gravel_production provides multi-year time-series per county but not by application type. A combined county-by-application time-series is not currently covered. You can fork this API on Parse and revise it to add an endpoint combining both dimensions if the underlying indicator page exposes that data.What county slugs are valid for endpoints like `get_regional_gravel_production`?+
stockholms-lan, skane-lan, vasterbottens-lan, and equivalents for all 21 Swedish counties (län). The slug format matches the Swedish county name lowercased with spaces replaced by hyphens.