Query Apiverket API
govdata_queryCall any Apiverket API endpoint to access Swedish government data, providing endpoint path and optional parameters for weather, jobs, transport, and other public information.
Instructions
Call any Apiverket API endpoint to retrieve Swedish government data.
Use govdata_discover first to find the right endpoint path and required parameters. Then call this tool with the endpoint path and any path/query parameters.
Args:
endpoint (string, required): The API path (e.g. "/v1/weather/{city}")
path_params (object, optional): Values for path parameters like {city}, {code}, {id}
query_params (object, optional): Query string parameters (q, limit, offset, lat, lon, etc.)
Examples:
Current weather in Stockholm: endpoint="/v1/weather/{city}", path_params={"city": "stockholm"}
Search jobs: endpoint="/v1/jobs/search", query_params={"q": "developer", "limit": 5}
Train departures from Stockholm Central: endpoint="/v1/transport/trains/{station}", path_params={"station": "Cst"}
Exchange rates: endpoint="/v1/rates"
Population by municipality: endpoint="/v1/population/{municipalityCode}", path_params={"municipalityCode": "0180"}
Police events in Stockholm: endpoint="/v1/police/events", query_params={"location": "Stockholm", "limit": 10}
Find EV chargers near a location: endpoint="/v1/infrastructure/ev-chargers", query_params={"lat": 59.33, "lon": 18.07}
Returns: The API response as JSON, containing a "meta" envelope with request info and a "data" object with the actual data.
Error handling:
Returns clear error messages if the API is unreachable, the endpoint doesn't exist, or parameters are invalid
Large responses are automatically truncated with pagination guidance
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | API endpoint path from the discover tool (e.g. '/v1/weather/{city}', '/v1/rates', '/v1/police/events') | |
| path_params | No | Path parameter values to substitute in the endpoint URL. Example: { "city": "stockholm" } for /v1/weather/{city} | |
| query_params | No | Query string parameters. Example: { "q": "developer", "limit": 5 } for search endpoints |