# NOAA Space Weather Prediction Center API

> Returns space weather scales, Kp index, alerts, GOES X-ray and proton flux, and solar cycle predictions.

Category: Government & Open Data. Region: US. 12 endpoints at `https://api.hoshime.com/v1/swpc/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/swpc
## GET /v1/swpc/scales

The NOAA space weather scales now and for the next days: radio, radiation and geomagnetic.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `day` (integer (int64)), `geomagnetic` (Scale), `geomagnetic.level` (integer (int64)), `geomagnetic.text` (string), `radioBlackout` (Scale), `radioBlackout.level` (integer (int64)), `radioBlackout.text` (string), `solarRadiation` (Scale), `solarRadiation.level` (integer (int64)), `solarRadiation.text` (string)

```bash
curl "https://api.hoshime.com/v1/swpc/scales" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/kpIndex

The planetary K index in three-hour steps, newest first: a measure of geomagnetic activity.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 24) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `aRunning` (integer (int64)), `kp` (number (double)), `observedAt` (string), `stationCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/swpc/kpIndex" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/alerts

The latest space weather product messages, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `issuedAt` (string), `message` (string), `productId` (string)

```bash
curl "https://api.hoshime.com/v1/swpc/alerts" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/xrays

Recent GOES X-ray flux (0.1 to 0.8 nm, the flare channel) with its flare class, newest first.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 360. (default 30; e.g. 5) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `flareClass` (string), `fluxWm2` (number (double)), `observedAt` (string), `satellite` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/swpc/xrays?limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/protons

Recent GOES integral proton flux for one energy threshold, newest first; high values signal a solar radiation storm.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `energy` | string | no | Energy threshold of the protons, such as >=10 MeV. (one of >=1 MeV, >=5 MeV, >=10 MeV, >=30 MeV, >=50 MeV, >=60 MeV, >=100 MeV, >=500 MeV; default >=10 MeV; e.g. >=10 MeV) |
| `limit` | integer | no | Items per page, 1 to 300. (default 30; e.g. 5) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `energy` (string), `fluxPfu` (number (double)), `observedAt` (string), `satellite` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/swpc/protons?energy=%3E%3D10+MeV&limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/solarCycle

The predicted monthly sunspot number and 10.7 cm flux of the solar cycle, earliest month first, with low and high bands.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 200. (default 12; e.g. 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `highSsn` (number (double)), `lowSsn` (number (double)), `month` (string), `predictedF107` (number (double)), `predictedSsn` (number (double))

```bash
curl "https://api.hoshime.com/v1/swpc/solarCycle?limit=12" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/dst

The recent Dst index, a minute-by-minute measure of the ring current; large negative values mean a geomagnetic storm.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 600. (default 60; e.g. 5) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `dstNt` (number (double)), `observedAt` (string)

```bash
curl "https://api.hoshime.com/v1/swpc/dst?limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/aurora

The chance of seeing the aurora at a point, from NOAA's OVATION model: the nearest one-degree grid cell.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lat` | string | yes | Latitude, -90 to 90. (e.g. -6.2) |
| `lon` | string | yes | Longitude, -180 to 180. (e.g. 106.8) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `forecastAt` (string), `latitude` (number (double)), `longitude` (number (double)), `observedAt` (string), `probability` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/swpc/aurora?lat=-6.2&lon=106.8" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/summary

Space weather now: solar wind speed, interplanetary magnetic field and the 10.7 cm solar radio flux.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `btNt` (number (double)), `bzNt` (number (double)), `observedAt` (string), `solarFlux10cm` (number (double)), `solarWindSpeedKms` (number (double))

```bash
curl "https://api.hoshime.com/v1/swpc/summary" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/kpForecast

The predicted planetary K index in three-hour steps for the coming days, earliest first: a forecast of geomagnetic storms.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `kp` (number (double)), `startsAt` (string), `status` (string)

```bash
curl "https://api.hoshime.com/v1/swpc/kpForecast" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/flareOutlook

NOAA's daily odds of C, M and X solar flares and of proton events over the three days from each date, newest first.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 31. (default 7; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `cFlare` (any[]), `date` (string), `mFlare` (any[]), `polarCapAbsorption` (string), `protonEvent` (any[]), `xFlare` (any[])

```bash
curl "https://api.hoshime.com/v1/swpc/flareOutlook?limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swpc/activeRegions

The sunspot active regions NOAA tracks, newest observation first, with their size, magnetic class and flare odds.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 200. (default 20; e.g. 5) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `area` (integer (int64)), `cFlare` (integer (int64)), `location` (string), `mFlare` (integer (int64)), `magneticClass` (string), `number` (integer (int64)), `numberSpots` (integer (int64)), `observedOn` (string), `protonEvent` (integer (int64)), `spotClass` (string), `xFlare` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/swpc/activeRegions?limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
