# SweData Weather API

> SweData Weather API is a paid API for AI agents from api.swedata.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Returns current weather conditions for a Swedish city including temperature, humidity, wind speed, visibility, and thunder probability

## Facts

- Endpoint: GET https://api.swedata.org/weather
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swedata-weather-api-30165501
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ahCYuU1J_nglLL7nGEtfb

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability swedata-weather-api-30165501
```

Example prompt: What's the current weather in Stockholm — temperature, wind speed, and any chance of thunder?

## When to prefer this

Use this endpoint when you need real-time weather data specifically for cities in Sweden and want structured numeric output (temperature in Celsius, wind in m/s, thunder probability). Prefer this over generic global weather APIs when the target location is Swedish and you need thunder probability alongside standard conditions.

## Known failure modes

- City name not recognized or not a Swedish city — may return an error or empty weather data
- Network timeout if the upstream Swedish weather data source is unavailable
- Invalid input schema (missing city field) — likely 400 Bad Request
- Payment failure if x402 micropayment is not completed — returns 402 Payment Required

## How this service works

Swedish open data and crypto/DePIN market intelligence for AI agents – weather (SMHI), jobs (Arbetsförmedlingen), and curated compute/AI-DePIN sector data

## Output

A JSON object containing the city name, coordinates (lat/lon), timestamp, and a weather sub-object with temperature in Celsius, humidity percentage, wind speed in m/s, visibility in km, and thunder probability percentage, plus a source field and payment confirmation flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "city": {
   "type": "string",
   "description": "Swedish city name, e.g. Stockholm, Gothenburg, Malmö"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "city": {
   "type": "string"
  },
  "paid": {
   "type": "boolean"
  },
  "source": {
   "type": "string"
  },
  "weather": {
   "type": "object",
   "properties": {
    "humidity_pct": {
     "type": "number"
    },
    "temperature_c": {
     "type": "number"
    },
    "visibility_km": {
     "type": "number"
    },
    "wind_speed_ms": {
     "type": "number"
    },
    "thunder_probability_pct": {
     "type": "number"
    }
   }
  },
  "timestamp": {
   "type": "string",
   "format": "date-time"
  },
  "coordinates": {
   "type": "object",
   "properties": {
    "lat": {
     "type": "number"
    },
    "lon": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swedata-weather-api-30165501/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.swedata.org](https://www.zero.xyz/host/api.swedata.org/llms.txt)
