Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Operational geomagnetic and space-weather indices for building grid, radio, and satellite-environment monitors.
From source to product signal
SWPC publishes JSON products for planetary K-index and related scales. Start with the compact planetary K-index file. A high Kp value is not a confirmed power-grid outage, radio blackout, or satellite anomaly.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://services.swpc.noaa.gov/products/noaa-planetary-k-index.json",
timeout=30,
)
response.raise_for_status()
kp = pd.DataFrame(response.json())
kp["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(kp.tail(12))Test a useful signal
Test whether recent Kp values can trigger a bounded space-weather awareness alert.
NOAA Space Weather Prediction Center is a government source. Last verified 2026-08-17. Temporal coverage: continuously updated operational products.