# Public API & RSS feed

URL: https://pro-weather.com/docs/public-api

> Read your station's current conditions as JSON, or subscribe to it as an RSS feed.

Your site publishes two machine-readable surfaces alongside the page itself: a
small JSON API and an RSS feed. Both serve exactly what your public page already
shows to any visitor - nothing about your account, your credentials or your
archive - so they are on by default.

## The JSON API

```
GET https://pro-weather.com/api/v1/<your-subdomain>/current
```

For example, `https://pro-weather.com/api/v1/ardooie/current`.

The response is versioned, flat, and carries **both unit systems**, so whatever
you are building never has to know which units you picked:

```json
{
  "version": 1,
  "station": {
    "subdomain": "ardooie",
    "name": "Ardooie",
    "title": "Ardooie Weather",
    "latitude": 50.9925,
    "longitude": 3.2003,
    "elevationMeters": 25,
    "timezone": "Europe/Brussels",
    "url": "https://ardooie.pro-weather.com"
  },
  "observation": {
    "time": 1785000000,
    "iso": "2026-08-03T14:00:00.000Z",
    "temperature": { "celsius": 22.5, "fahrenheit": 72.5 },
    "feelsLike": { "celsius": 22.5, "fahrenheit": 72.5 },
    "dewPoint": { "celsius": 15.5, "fahrenheit": 59.9 },
    "humidity": 64,
    "pressure": { "hpa": 1017.1, "inHg": 30.03, "trend": 0 },
    "wind": {
      "speed": { "kmh": 12.9, "mph": 8, "ms": 3.6 },
      "direction": { "degrees": 225, "cardinal": "SW" }
    },
    "windGust": { "kmh": 19.3, "mph": 12, "ms": 5.4 },
    "rain": {
      "today": { "mm": 5.2, "inches": 0.2 },
      "rate": { "mmPerHour": 1.2, "inchesPerHour": 0.05 }
    },
    "solar": { "wm2": 432.5 },
    "uv": { "index": 3 },
    "airQuality": null
  }
}
```

Anything your station does not measure comes back as `null` rather than being
omitted, so the shape is stable.

### Using it

- **CORS is wide open**, so a browser dashboard can fetch it directly.
- **No key is needed.** The data is already public on your page.
- **Cached for about 2.5 minutes**, half the refresh interval - polling faster
  than that gets you the same answer. Every reading carries its own `time`, so a
  cached response is never wrong, only slightly older than the label suggests.
- **Rate limited** per client to 120 requests every 5 minutes. Well beyond
  anything a dashboard needs, and a wall for a scraper.

### Status codes

| Code | Meaning |
| --- | --- |
| `200` | Here is the current observation. |
| `403` | The owner turned the public API off. |
| `404` | No such station, the site is not published, or there is no current reading. |
| `429` | Too many requests from your address. |

## The RSS feed

```
https://<your-subdomain>.pro-weather.com/feed.xml
```

It also lives at `https://pro-weather.com/api/v1/<your-subdomain>/feed.xml`, and
on your custom domain if you have one. Your page links to it in its `<head>`, so
a reader that supports autodiscovery finds it from the site address alone.

Four items, following the same shape the weewx Seasons skin publishes:

1. **Current conditions** - temperature, humidity, dew point, pressure, wind,
   rain, solar and UV.
2. **Daily summary** - today's high, low, mean, rainfall and peak gust.
3. **Monthly summary** - the same, for the calendar month so far.
4. **Yearly summary** - the same, for the calendar year so far.

> **Why it is not one item per reading**
>
  Each item keeps a stable id per period - the current-conditions item is keyed
  to the hour, the summaries to their day, month and year. A feed that minted a
  new id every five minutes would light up every subscriber's unread count 288
  times a day, which is how a station gets unsubscribed from.

## Turning them off

Both are controlled by one switch, because they are the same promise: this
station is readable by machines. Under **Settings**, turn off **Public data API
and RSS feed**. The API then answers `403`, the feed disappears, and the
autodiscovery link is removed from your page. Your site itself is unaffected.

## Next steps

- [Publish to weather networks](https://pro-weather.com/docs/publishing) - the outbound direction
- [Custom domain](https://pro-weather.com/docs/custom-domain)
