NASA APIapi.nasa.gov ↗
Access NASA's APOD, Near Earth Objects, EPIC Earth imagery, DONKI space weather, Exoplanet Archive, and EONET natural events via a single structured API.
What is the NASA API?
This API exposes 11 endpoints covering NASA's core open data collections — from asteroid orbital data via get_neo_lookup to daily astronomy imagery via get_apod. Each endpoint returns structured JSON with concrete fields like close_approach_data, estimated_diameter, and explanation, making it straightforward to integrate NASA science data into applications without managing multiple upstream API keys or query formats.
curl -X GET 'https://api.parse.bot/scraper/6db36254-5228-41a6-82a1-a7102cd098e8/get_apod?date=2026-06-08&end_date=2026-06-10&start_date=2026-06-08' \ -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 api-nasa-gov-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.
"""NASA Open APIs — SDK walkthrough: bounded, re-runnable; every call capped."""
from parse_apis.NASA_Open_APIs import (
Nasa, EpicCategory, EventStatus, MediaType, AsteroidNotFound
)
client = Nasa()
# Fetch the Astronomy Picture of the Day by a known date.
apod = client.apods.get(date="2024-01-15")
print(apod.title, apod.media_type, apod.url)
# Look up a famous asteroid (Eros) by its SPK-ID.
eros = client.asteroids.get(id="2000433")
print(eros.name, eros.absolute_magnitude_h, eros.is_potentially_hazardous_asteroid)
# Browse the full asteroid catalog — limit caps total items fetched.
for asteroid in client.asteroids.browse(limit=3):
print(asteroid.id, asteroid.name)
# Get EPIC Earth images filtered by category enum.
for img in client.epic_images.list(date="2024-01-15", category=EpicCategory.NATURAL, limit=2):
print(img.identifier, img.caption)
# Query the Exoplanet Archive for recent discoveries.
for planet in client.exoplanets.query(
query="select top 3 pl_name,hostname,disc_year from ps where disc_year > 2020",
limit=3,
):
print(planet.pl_name, planet.hostname, planet.disc_year)
# List open natural events using the EventStatus enum.
for event in client.natural_events.list(status=EventStatus.OPEN, limit=3):
print(event.id, event.title)
# Typed error handling: catch a not-found asteroid gracefully.
try:
client.asteroids.get(id="9999999")
except AsteroidNotFound as exc:
print(f"Asteroid not found: {exc}")
print("exercised: apods.get / asteroids.get / asteroids.browse / epic_images.list / exoplanets.query / natural_events.list")
Get the Astronomy Picture of the Day (APOD) metadata. Returns a single APOD object when date is specified, or a wrapped array ({items: [...]}) when start_date/end_date or count is used. The primary use case is fetching by a single date. Parameters date, count, and start_date/end_date are mutually exclusive; date takes priority.
| Param | Type | Description |
|---|---|---|
| date | string | Date of the APOD image in YYYY-MM-DD format. Cannot be used with start_date/end_date or count. Takes priority if multiple are provided. |
| count | integer | Return a specified number of random APOD images wrapped in {items: [...]}. Cannot be used with date or start_date/end_date. |
| thumbs | boolean | Return URL of video thumbnail if media_type is video. |
| end_date | string | End date for a range of APODs in YYYY-MM-DD format. Used with start_date. Cannot be used with date or count. |
| start_date | string | Start date for a range of APODs in YYYY-MM-DD format. Used with end_date. Cannot be used with date or count. |
{
"type": "object",
"fields": {
"url": "string — URL of the image or video",
"date": "string — date of the APOD in YYYY-MM-DD format",
"hdurl": "string — high-definition image URL (absent for videos)",
"title": "string — title of the APOD",
"media_type": "string — 'image' or 'video'",
"explanation": "string — description of the image"
},
"sample": {
"data": {
"url": "https://apod.nasa.gov/apod/image/2401/IC348_webb_960.jpg",
"date": "2024-01-15",
"hdurl": "https://apod.nasa.gov/apod/image/2401/IC348_webb_3788.jpg",
"title": "Star Cluster IC 348 from Webb",
"media_type": "image",
"explanation": "Sometimes, it's the stars that are the hardest to see...",
"service_version": "v1"
},
"status": "success"
}
}About the NASA API
Astronomy and Earth Imagery
get_apod returns metadata for NASA's Astronomy Picture of the Day, including url, hdurl, media_type, title, and explanation. A single date parameter (YYYY-MM-DD) returns one object; using start_date/end_date or count returns an {items: [...]} array. The thumbs parameter adds a video thumbnail URL when media_type is video. get_epic_images delivers metadata from the DSCOVR spacecraft's Earth Polychromatic Imaging Camera — pass a date and category (natural or enhanced) to get an array of image objects including identifier, caption, and centroid_coordinates.
Near Earth Objects and Space Weather
get_neo_feed returns asteroids grouped by close-approach date for up to a 7-day window — the near_earth_objects field is a date-keyed object with arrays of asteroid summaries. get_neo_lookup accepts a NASA JPL SPK-ID (e.g., 2000433 for Eros) and returns full detail including estimated_diameter in four unit systems, absolute_magnitude_h, is_potentially_hazardous_asteroid, and a close_approach_data array with velocities and miss distances. get_neo_browse pages through the full asteroid database with orbital summaries. DONKI endpoints (get_donki_cme, get_donki_notifications) cover Coronal Mass Ejection events and space weather notifications filtered by date range and type (FLR, CME, GST, and others); note that very recent single-day CME queries may encounter intermittent upstream errors.
Exoplanet Archive and Natural Events
get_exoplanet_data accepts full ADQL queries against NASA's Exoplanet Archive TAP service. Use select top 10 pl_name,hostname from ps where disc_year > 2020 syntax — SQL LIMIT is not supported, only ADQL TOP. Results arrive in a {results: [...]} wrapper. get_eonet_events returns active or closed natural event records (wildfires, storms, volcanic eruptions) with GeoJSON geometry, filterable by status (open/closed) and limit. search_nasa_library queries the NASA Image and Video Library with q, media_type, and page parameters, returning collection.items with asset metadata and pagination links.
Data Freshness and Coverage Notes
The InSight Mars weather endpoint (get_insight_mars_weather) returns historical data only — the mission ended November 2022, and the available sols are fixed around October 2020 (sols 675–681). APOD data goes back to June 1995. NEO and DONKI data reflect NASA JPL and Space Weather Database of Notifications, Knowledge, Information (DONKI) records, which are updated continuously upstream.
The NASA API is a managed, monitored endpoint for api.nasa.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when api.nasa.gov 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 api.nasa.gov 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?+
- Build a daily astronomy widget that displays the APOD
title,explanation, andhdurlfor a given date. - Track potentially hazardous asteroids by querying
get_neo_feedand filtering onis_potentially_hazardous_asteroid. - Visualize DSCOVR Earth imagery by fetching EPIC image metadata including
centroid_coordinatesfor a given date. - Alert users to space weather events by polling
get_donki_notificationsfor CME or solar flare message types. - Query confirmed exoplanet discoveries with ADQL against the Exoplanet Archive, filtering by
disc_yearor host star. - Map active wildfire and storm events using EONET GeoJSON geometry from
get_eonet_eventswithstatus=open. - Search the NASA media library for historical mission footage using
search_nasa_libraryfiltered bymedia_type=video.
| 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 NASA have an official developer API?+
What does `get_neo_lookup` return beyond basic asteroid name and size?+
get_neo_lookup returns close_approach_data — an array of historical and future close approach events including approach date, relative velocity, and miss distance in multiple units — along with absolute_magnitude_h and the is_potentially_hazardous_asteroid boolean. You identify the target asteroid by its NASA JPL SPK-ID, such as 2000433 for Eros.How current is the InSight Mars weather data?+
get_insight_mars_weather endpoint returns fixed historical records covering sols 675–681 from around October 2020. No new weather readings will be added.Does the API expose Solar Energetic Particle (SEP) or Geomagnetic Storm (GST) events as dedicated endpoints?+
get_donki_notifications using the type parameter (e.g., type=GST or type=SEP). Individual DONKI event-type endpoints (like a standalone GST or SEP endpoint) are not currently included. You can fork this API on Parse and revise it to add dedicated endpoints for those DONKI event categories.Can I retrieve APOD images for a range of dates in a single call?+
start_date and end_date together on get_apod to receive an {items: [...]} array covering that range. The date, count, and start_date/end_date parameters are mutually exclusive — combining them is not supported.