# NOAA Space Weather API

> NOAA Space Weather returns aurora forecasts and space weather alerts as a workflow and API.

NOAA Space Weather, also called NOAA SWPC, gives aurora chances and Kp outlooks for a required city or place. List space weather alerts returns recent NOAA messages; provide how many days back to look, from 1 to 7.

- Page: https://fous.com/workflows/noaa-space-weather
- Handle: `@noaa-space-weather`
- Category: [Weather](https://fous.com/workflows/category/weather)
- Source website: https://swpc.noaa.gov
- Last verified: Sep 29, 2026
- Fous is not affiliated with NOAA Space Weather.

## Methods

### Get aurora forecast

Operation `get_aurora_forecast`, version 1. 1 credit per call.

Get the 30-minute chance of aurora overhead near a place, current geomagnetic activity, and the three-day Kp outlook. Visibility also depends on darkness and local conditions; tonight uses approximate local solar hours 18:00–06:00.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `location` | string | yes | `"Edinburgh"` | City or place near which to check the aurora, for example Fairbanks or Edinburgh. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "location"
  ],
  "properties": {
    "location": {
      "type": "string",
      "description": "City or place near which to check the aurora, for example Fairbanks or Edinburgh.",
      "examples": [
        "Edinburgh",
        "Fairbanks",
        "Hobart, Tasmania"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "location": "Edinburgh"
    },
    {
      "location": "Fairbanks"
    },
    {
      "location": "Hobart, Tasmania"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `verdict` | string | `"unlikely"` | Likely (50% or more), possible (10–49%), or unlikely (below 10%). |
| `latitude` | number | `55.9533456` | Latitude of matched place. |
| `longitude` | number | `-3.1883749` | Longitude of matched place. |
| `current_kp` | number | `0` | Latest estimated planetary Kp on a 0–9 scale. |
| `aurora_type` | string | `"Northern lights"` | Northern or southern lights at this latitude. |
| `storm_level` | string | `"G0 None"` | Current NOAA geomagnetic storm level in words. |
| `forecast_time` | string | `"2026-09-29T06:14:00+00:00"` | Time of the aurora forecast, ISO 8601 with offset. |
| `matched_place` | string | `"City of Edinburgh, Scotland, United Kingdom"` | Place matched to the location. |
| `aurora_page_link` | string | `"https://www.swpc.noaa.gov/products/aurora-30-minute-forecast"` | NOAA aurora forecast page. |
| `highest_kp_tonight` | number or null | `2` | Highest predicted Kp in the available 18:00–06:00 local solar night periods, or null when unavailable. |
| `aurora_chance_percent` | number | `0` | Forecast chance of aurora overhead, in percent. |
| `three_day_kp_forecast` | array |  | Three-day outlook at three-hour UTC intervals. |
| `three_day_kp_forecast[].kp` | number | `1.67` | Predicted planetary Kp. |
| `three_day_kp_forecast[].start_time` | string | `"2026-09-29T00:00:00+00:00"` | Three-hour interval start time, ISO 8601 with offset. |

**Example input**

```json
{
  "location": "Edinburgh"
}
```

**Example output**

```json
{
  "verdict": "unlikely",
  "latitude": 55.9533456,
  "longitude": -3.1883749,
  "current_kp": 0,
  "aurora_type": "Northern lights",
  "storm_level": "G0 None",
  "forecast_time": "2026-09-29T06:14:00+00:00",
  "matched_place": "City of Edinburgh, Scotland, United Kingdom",
  "aurora_page_link": "https://www.swpc.noaa.gov/products/aurora-30-minute-forecast",
  "highest_kp_tonight": 2,
  "aurora_chance_percent": 0,
  "three_day_kp_forecast": [
    {
      "kp": 1.67,
      "start_time": "2026-09-29T00:00:00+00:00"
    },
    {
      "kp": 2,
      "start_time": "2026-09-29T03:00:00+00:00"
    },
    {
      "kp": 1.67,
      "start_time": "2026-09-29T06:00:00+00:00"
    }
  ]
}
```

### List space weather alerts

Operation `list_space_weather_alerts`, version 1. 1 credit per call.

List NOAA space weather alerts, warnings, watches, and summaries issued in the past 1–7 days, newest first. Validity times and NOAA scale levels are included when the message gives them.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `days` | integer | no | `7` | How many days back to look, from 1 to 7. Example: 3. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "days": {
      "type": "integer",
      "default": 3,
      "maximum": 7,
      "minimum": 1,
      "description": "How many days back to look, from 1 to 7. Example: 3.",
      "examples": [
        7,
        1
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "days": 7
    },
    {},
    {
      "days": 1
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `messages` | array |  | Messages issued during the selected period, newest first. |
| `messages[].kind` | string | `"alert"` | Type of space weather message. |
| `messages[].title` | string | `"Electron 2MeV Integral Flux exceeded 1,000pfu"` | Message headline without its alert, watch, warning or summary prefix. |
| `messages[].valid_to` | string or null |  | UTC end time if supplied in the message, ISO 8601 with offset. |
| `messages[].page_link` | string | `"https://www.swpc.noaa.gov/products/alerts-watches-and-warnings"` | NOAA page listing space weather alerts, watches, and warnings. |
| `messages[].issue_time` | string | `"2026-09-28T05:00:40.090+00:00"` | UTC issue time in ISO 8601 with offset. |
| `messages[].valid_from` | string or null | `"2026-09-26T15:35:00+00:00"` | UTC start time if supplied in the message, ISO 8601 with offset. |
| `messages[].message_text` | string | `"Space Weather Message Code: ALTEF3\r\nSerial Number: 3747\r\nIssue Time: 2026 Sep 28 0500 UTC\r\n\r\nCONTINUED ALERT: E` | Full message as published by NOAA. |
| `messages[].product_code` | string or null | `"ALTEF3"` | NOAA product identifier. |
| `messages[].serial_number` | string or null | `"3747"` | NOAA message serial number. |
| `messages[].noaa_scale_level` | string or null |  | NOAA scale code and level in words, when given. |

**Example input**

```json
{}
```

**Example output**

```json
{
  "messages": [
    {
      "kind": "alert",
      "title": "Electron 2MeV Integral Flux exceeded 1,000pfu",
      "valid_to": null,
      "page_link": "https://www.swpc.noaa.gov/products/alerts-watches-and-warnings",
      "issue_time": "2026-09-28T05:00:40.090+00:00",
      "valid_from": "2026-09-26T15:35:00+00:00",
      "message_text": "Space Weather Message Code: ALTEF3\r\nSerial Number: 3747\r\nIssue Time: 2026 Sep 28 0500 UTC\r\n\r\nCONTINUED ALERT: Electron 2MeV Integral Flux exceeded 1,000pfu\nContinuation of Serial Number: 3746\nBegin Ti…",
      "product_code": "ALTEF3",
      "serial_number": "3747",
      "noaa_scale_level": null
    },
    {
      "kind": "alert",
      "title": "Electron 2MeV Integral Flux exceeded 1,000pfu",
      "valid_to": null,
      "page_link": "https://www.swpc.noaa.gov/products/alerts-watches-and-warnings",
      "issue_time": "2026-09-27T05:02:04.940+00:00",
      "valid_from": "2026-09-26T15:35:00+00:00",
      "message_text": "Space Weather Message Code: ALTEF3\r\nSerial Number: 3746\r\nIssue Time: 2026 Sep 27 0502 UTC\r\n\r\nCONTINUED ALERT: Electron 2MeV Integral Flux exceeded 1,000pfu\nContinuation of Serial Number: 3745\nBegin Ti…",
      "product_code": "ALTEF3",
      "serial_number": "3746",
      "noaa_scale_level": null
    },
    {
      "kind": "alert",
      "title": "Geomagnetic K-index of 4",
      "valid_to": null,
      "page_link": "https://www.swpc.noaa.gov/products/alerts-watches-and-warnings",
      "issue_time": "2026-09-27T00:40:33.327+00:00",
      "valid_from": null,
      "message_text": "Space Weather Message Code: ALTK04\r\nSerial Number: 2688\r\nIssue Time: 2026 Sep 27 0040 UTC\r\n\r\nALERT: Geomagnetic K-index of 4 \nThreshold Reached: 2026 Sep 27 0040 UTC\nSynoptic Period: 0000-0300\nActive …",
      "product_code": "ALTK04",
      "serial_number": "2688",
      "noaa_scale_level": null
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@noaa-space-weather",
  "visibility": "public",
  "operation": "get_aurora_forecast",
  "version": 1,
  "input": {
    "location": "Edinburgh"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@noaa-space-weather\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_aurora_forecast\",\n  \"version\": 1,\n  \"input\": {\n    \"location\": \"Edinburgh\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@noaa-space-weather",
  "visibility": "public",
  "operation": "get_aurora_forecast",
  "version": 1,
  "input": {
    "location": "Edinburgh"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@noaa-space-weather","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Check aurora chances near a destination
- Compare current geomagnetic activity with the three-day Kp outlook
- Review recent NOAA space weather alerts and warnings
- Track alert issue and validity times

## FAQ

### Is Fous affiliated with NOAA Space Weather?

No. Fous is not affiliated with NOAA Space Weather. This workflow reads the public swpc.noaa.gov website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a NOAA Space Weather account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from swpc.noaa.gov when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What is the aurora chance near a place?

Get aurora forecast returns the forecast chance and verdict for a required city or place.

### What is the three-day Kp outlook?

Get aurora forecast returns the three-day Kp outlook at three-hour intervals for a required city or place.

### Which space weather alerts were issued recently?

List space weather alerts returns NOAA messages from the selected 1–7-day period, newest first.

## Related

- [National Weather Service API](https://fous.com/workflows/national-weather-service.md): National Weather Service provides U.S. day-and-night forecasts for seven days, hourly forecasts for up to 156 hours where available, active alerts, and latest nearby station observations.
- [The Weather Channel API](https://fous.com/workflows/the-weather-channel.md): The Weather Channel returns current conditions, today’s high/low, up to 15 daily forecasts (sometimes fewer), 1–48 local hourly forecasts, and active severe weather alerts.
- [AccuWeather API](https://fous.com/workflows/accuweather.md): AccuWeather provides current conditions and RealFeel, plus up to 15 available daily forecasts; shorter public forecasts may return fewer days.
- [AirNow API](https://fous.com/workflows/airnow.md): Current and forecast air quality for reporting areas in the United States and covered cities in Canada and Mexico.
- [NOAA Tides and Currents API](https://fous.com/workflows/noaa-tides-and-currents.md): NOAA Tides and Currents provides coastal observations and predictions: tide times within 30 miles of prediction stations, latest levels within 50 miles of reporting stations.
- [MSN Weather API](https://fous.com/workflows/msn-weather.md): MSN Weather provides current conditions and forecasts for places worldwide, including up to 10 days ahead and optional hourly forecasts for the next 24 hours.
- [NASA API](https://fous.com/workflows/nasa.md): NASA provides astronomy pictures from June 16, 1995 onward, up to 100 media matches, inclusive UTC asteroid approaches, recent approximate natural events, and upcoming ISS sightings for listed cities.
- [National Park Service API](https://fous.com/workflows/national-park-service.md): The National Park Service provides official park and site information, visiting details, and current alerts; schedules and booking rules can change, and alert update dates may be unavailable.
- [All Weather workflows](https://fous.com/workflows/category/weather)
