Spaceweather APIspaceweather.com ↗
Access real-time solar wind, X-ray flares, sunspot counts, K-index, and near-Earth asteroid encounters from spaceweather.com via a structured API.
What is the Spaceweather API?
The spaceweather.com API exposes 4 endpoints covering live space weather conditions, daily editorial reports, historical archives, and near-Earth asteroid encounter tables. The get_current_conditions endpoint alone returns 7 distinct data objects including solar wind speed and density, interplanetary magnetic field strength, X-ray flare classifications, planetary K-index, sunspot count, and the thermosphere climate index — all in a single structured response.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/78067577-55c2-473b-98ef-f00e6cde97e7/get_current_conditions' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace spaceweather-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""SpaceWeather.com SDK — monitor solar activity, retrieve reports, track asteroids."""
from parse_apis.spaceweather_com_api import SpaceWeather, ArchiveDateNotFound
client = SpaceWeather()
# Fetch current space weather conditions
conditions = client.conditionses.current()
print(f"Solar wind: {conditions.solar_wind.speed_km_sec} km/s, density {conditions.solar_wind.density_protons_cm3} p/cm³")
print(f"Sunspot number: {conditions.sunspot_number} (updated: {conditions.sunspot_number_updated})")
print(f"IMF Bz: {conditions.imf.bz_nT} nT ({conditions.imf.bz_direction})")
# Get today's daily report with news stories
report = client.dailyreports.current()
print(f"\nDaily report for {report.date}, {len(report.stories)} stories")
if report.stories:
story = report.stories[0]
print(f" Top headline: {story.headline}")
print(f" Links: {len(story.links)}, Images: {len(story.images)}")
# Retrieve an archived report for a historical date
try:
archive = client.archivereports.get(year="2025", month="01", day="15")
print(f"\nArchive: {archive.date}")
print(f" Sunspot number was: {archive.conditions.sunspot_number}")
print(f" Solar wind was: {archive.conditions.solar_wind.speed_km_sec} km/s")
except ArchiveDateNotFound as exc:
print(f"Archive not found: {exc}")
# Check near-Earth asteroid encounters
asteroids = client.asteroidtables.current()
print(f"\nPHAs tracked: {asteroids.pha_count}")
print(f"Upcoming encounters: {len(asteroids.recent_encounters)}")
if asteroids.recent_encounters:
closest = asteroids.recent_encounters[0]
print(f" Next: {closest.designation} on {closest.date_ut}, miss distance {closest.miss_distance_ld}")
print("\nExercised: conditionses.current / dailyreports.current / archivereports.get / asteroidtables.current")
Get current space weather conditions sidebar data including solar wind speed and density, X-ray flare classifications, sunspot number, planetary K-index, interplanetary magnetic field strength, and thermosphere climate index. All values reflect the latest measurements published on the spaceweather.com homepage. Returns a single Conditions object.
No input parameters required.
{
"type": "object",
"fields": {
"imf": "object containing btotal_nT (number), bz_nT (number), bz_direction (string), updated (string)",
"kp_index": "object containing current (object with value, status) and max_24hr (object with value, status)",
"solar_wind": "object containing speed_km_sec (number), density_protons_cm3 (number), updated (string)",
"xray_flares": "object containing max_6hr (object with class, time), max_24hr (object with class, time or null), updated (string)",
"sunspot_number": "integer - current sunspot count",
"sunspot_number_updated": "string - timestamp of last sunspot update",
"thermosphere_climate_index": "object containing value_x10_10_W (number), status (string or null), updated (string)"
},
"sample": {
"data": {
"imf": {
"bz_nT": 2.53,
"updated": "Updated: Today at 0126 UT",
"btotal_nT": 8.85,
"bz_direction": "north"
},
"kp_index": {
"current": {
"value": 1.67,
"status": "quiet"
},
"max_24hr": {
"value": 2.6,
"status": "7"
}
},
"solar_wind": {
"updated": "Updated: Today at 0126 UT",
"speed_km_sec": 398,
"density_protons_cm3": 11.23
},
"xray_flares": {
"max_6hr": {
"time": "",
"class": "C6"
},
"updated": "0002 UT Jun11",
"max_24hr": null
},
"sunspot_number": 120,
"sunspot_number_updated": "Updated 10 Jun 2026",
"thermosphere_climate_index": {
"status": null,
"updated": "Updated 10 Jun 2026",
"value_x10_10_W": 14.7
}
},
"status": "success"
}
}About the Spaceweather API
Real-Time Space Weather Conditions
The get_current_conditions endpoint returns a snapshot of the current solar environment. Key fields include solar_wind.speed_km_sec, solar_wind.density_protons_cm3, imf.btotal_nT, imf.bz_nT, and imf.bz_direction (which indicates whether the interplanetary magnetic field is northward or southward — relevant to geomagnetic storm risk). The kp_index object includes both the current value and a 24-hour maximum, each paired with a status label. The thermosphere_climate_index returns a watt value and status string indicating atmospheric heating conditions.
Daily and Archived Reports
The get_daily_report endpoint returns the current date and an array of stories, where each story includes a headline, content text, images array, and links. This mirrors the editorial content published on the spaceweather.com homepage. The get_archive_report endpoint accepts three required parameters — year (four-digit), month (two-digit with leading zero), and day (two-digit with leading zero) — and returns the same stories structure for that historical date plus a conditions object with the same fields as get_current_conditions. This makes it straightforward to correlate past news coverage with recorded solar metrics.
Near-Earth Asteroid Encounters
The get_near_earth_asteroids endpoint returns pha_count (the number of currently tracked potentially hazardous asteroids) and a recent_encounters array. Each entry includes the asteroid's designation, date_ut, miss_distance_ld (in lunar distances), velocity_km_s, and estimated diameter. This data reflects the close-approach table shown on the spaceweather.com homepage, covering both recent passes and near-term upcoming encounters.
The Spaceweather API is a managed, monitored endpoint for spaceweather.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when spaceweather.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official spaceweather.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Alert users when the planetary K-index exceeds a threshold indicating geomagnetic storm conditions, using the
kp_index.current.valuefield. - Log solar wind speed and density over time from
get_current_conditionsto build time-series charts for space weather research. - Pull archived reports via
get_archive_reportto correlate historical X-ray flare classifications with satellite anomaly records. - Build an aurora forecast tool using the
imf.bz_directionandkp_indexfields from the current conditions endpoint. - Track upcoming near-Earth asteroid close approaches by parsing
recent_encountersfromget_near_earth_asteroids, filtered bymiss_distance_ld. - Aggregate daily
sunspot_numbervalues across archived reports to study solar cycle progression. - Display the thermosphere climate index alongside other solar metrics in a space environment dashboard using the
thermosphere_climate_index.value_x10_10_Wfield.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does spaceweather.com offer an official developer API?+
What does the `get_archive_report` endpoint return, and how far back does the archive go?+
stories array and a conditions object for any historical date you specify using the year, month, and day parameters. Spaceweather.com has published daily reports since the late 1990s, so the archive spans decades. However, the completeness of structured conditions data for very old dates depends on what the source recorded at the time — some older entries may have partial fields.Does the API return solar flare forecasts or only observed flare data?+
xray_flares field in get_current_conditions provides the maximum flare class over the past 6 and 24 hours, with timestamps. Forward-looking forecasts (probability of M- or X-class flares, for example) are not currently exposed. You can fork this API on Parse and revise it to add a forecast endpoint if that data becomes a priority.Is there a way to filter the near-Earth asteroid encounters by size or miss distance within the API?+
get_near_earth_asteroids endpoint returns the full encounter table as a list; it does not accept filter parameters. All filtering by miss_distance_ld, velocity_km_s, or estimated diameter must be done client-side after fetching the response. You can fork this API on Parse and revise it to add query parameters that filter the returned list.How current is the data returned by `get_current_conditions`?+
updated timestamp field — for example, solar_wind.updated and imf.updated — so you can see exactly when each measurement was last refreshed. Spaceweather.com updates different instruments on different cadences; solar wind data typically refreshes more frequently than sunspot numbers.