# Smhi — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Get accurate weather forecasts, current conditions, and severe weather warnings for any location across Sweden. Search for specific Swedish locations to retrieve detailed meteorological analysis and real-time weather data.

**Category:** Weather | **Website:** [smhi.se/](https://smhi.se/) | **Docs:** [parse.bot/marketplace/5a302a84-1db6-4d05-8161-cd16ecf3d6bc/smhi-se-api](https://parse.bot/marketplace/5a302a84-1db6-4d05-8161-cd16ecf3d6bc/smhi-se-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_analysis

Get current weather analysis/observations (MESAN model) for a location. Returns observed weather data including hourly measurements for recent hours with temperature, wind speed, humidity, visibility, and precipitation. Data is organized by day with summary statistics.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `geonameid` | string | Yes | The geonameid of the location as returned by search_locations (e.g. '2673730' for Stockholm). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/get_analysis \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"geonameid":"<string>"}'
```

### get_current_weather

Get current weather conditions (next hour) for a location. Returns the temperature in Celsius, weather symbol code (1-27 indicating clear/cloudy/rain/snow/etc), time of day (day or night), reference time, and full location metadata.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `geonameid` | string | Yes | The geonameid of the location as returned by search_locations (e.g. '2673730' for Stockholm). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/get_current_weather \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"geonameid":"<string>"}'
```

### get_forecast

Get the 10-day hourly weather forecast for a specific location. Returns detailed forecast data including 10-day hourly breakdowns (days with temperature, precipitation, wind, weather symbols), 24-hour summary periods, and 6-hour summary periods. Each day includes summary statistics (min/max temp, accumulated precipitation) and sunrise/sunset times.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `geonameid` | string | Yes | The geonameid of the location as returned by search_locations (e.g. '2673730' for Stockholm). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/get_forecast \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"geonameid":"<string>"}'
```

### get_warnings

Get all active weather warnings and alerts for Sweden. Returns current warnings with severity levels (Yellow/Orange/Red), affected areas, descriptions in Swedish and English, and geographic polygons. The list may be empty if no warnings are currently active.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/get_warnings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_locations

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | The city or place name to search for (e.g. 'Stockholm', 'Göteborg'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-smhi-se-api-5a302a84/search_locations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
