CLI Commands
CLI Commands
Section titled “CLI Commands”All commands support --json for JSON output. Commands that call api.nasa.gov also support --api-key to override the environment variable.
Retrieve NASA’s Astronomy Picture of the Day.
# Today's APODnasa apod
# Specific datenasa apod --date 2024-01-01
# Random APODnasa apod --random
# Multiple random APODsnasa apod --random --count 5
# Date rangenasa apod --start 2024-01-01 --end 2024-01-07
# JSON outputnasa apod --json| Flag | Type | Description |
|---|---|---|
--date | string | Specific date (YYYY-MM-DD) |
--random | bool | Get random APOD(s) |
--count | int | Number of random APODs (default: 1, use with —random) |
--start | string | Range start date (YYYY-MM-DD) |
--end | string | Range end date (YYYY-MM-DD) |
--json | bool | Output as JSON |
--api-key | string | API key override |
Near-Earth Object Web Service. Requires a subcommand.
neo feed
Section titled “neo feed”List near-Earth objects approaching Earth within a date range (max 7 days).
# Default: next 7 daysnasa neo feed
# Custom date rangenasa neo feed --start 2024-06-01 --end 2024-06-07| Flag | Type | Description |
|---|---|---|
--start | string | Start date (YYYY-MM-DD, default: today) |
--end | string | End date (YYYY-MM-DD, default: start+7d) |
--json | bool | Output as JSON |
--api-key | string | API key override |
neo get
Section titled “neo get”Get detailed information about a specific near-Earth object.
nasa neo get 3542519| Flag | Type | Description |
|---|---|---|
--json | bool | Output as JSON |
--api-key | string | API key override |
neo browse
Section titled “neo browse”Browse the full near-Earth object catalog.
nasa neo browsenasa neo browse --page 2 --size 50| Flag | Type | Description |
|---|---|---|
--page | int | Page number (0-indexed, default: 0) |
--size | int | Results per page (default: 20) |
--json | bool | Output as JSON |
--api-key | string | API key override |
Space Weather Database (DONKI). Requires a subcommand.
All DONKI subcommands share these flags:
| Flag | Type | Description |
|---|---|---|
--start | string | Start date YYYY-MM-DD (default: 30 days ago) |
--end | string | End date YYYY-MM-DD (default: today) |
--json | bool | Output as JSON |
--api-key | string | API key override |
donki cme
Section titled “donki cme”nasa donki cmenasa donki cme --start 2024-01-01 --end 2024-01-31donki cme-analysis
Section titled “donki cme-analysis”Additional flags:
| Flag | Type | Description |
|---|---|---|
--most-accurate | bool | Filter to most accurate only |
--complete-entry | bool | Filter to complete entries only |
--speed | float64 | Minimum speed (km/s) |
--half-angle | float64 | Minimum half-angle (degrees) |
--catalog | string | Catalog filter |
nasa donki cme-analysis --most-accurate --speed 500donki gst
Section titled “donki gst”nasa donki gstdonki ips
Section titled “donki ips”Additional flags: --location, --catalog
nasa donki ips --location Earthdonki flr
Section titled “donki flr”nasa donki flrdonki sep
Section titled “donki sep”nasa donki sepdonki mpc
Section titled “donki mpc”nasa donki mpcdonki rbe
Section titled “donki rbe”nasa donki rbedonki hss
Section titled “donki hss”nasa donki hssdonki wsa-enlil
Section titled “donki wsa-enlil”nasa donki wsa-enlildonki notifications
Section titled “donki notifications”Additional flags:
| Flag | Type | Description |
|---|---|---|
--type | string | Filter: FLR, SEP, CME, IPS, MPC, GST, RBE, report |
nasa donki notifications --type CMEimages
Section titled “images”NASA Image and Video Library. Requires a subcommand. No API key needed.
images search
Section titled “images search”nasa images search "apollo 11"nasa images search "mars rover" --media-type image --year-start 2020| Flag | Type | Description |
|---|---|---|
--media-type | string | Filter: image, video, audio |
--year-start | int | Results from this year or later |
--year-end | int | Results up to this year |
--center | string | NASA center filter |
--page | int | Results page number |
--json | bool | Output as JSON |
images asset
Section titled “images asset”nasa images asset as11-40-5874images metadata
Section titled “images metadata”nasa images metadata as11-40-5874images captions
Section titled “images captions”nasa images captions "Space_Shuttle_Era"Small-Body Database (SSD/CNEOS). Requires a subcommand. No API key needed.
ssd cad
Section titled “ssd cad”Query close-approach data for asteroids and comets.
nasa ssd cadnasa ssd cad --date-min 2024-06-01 --date-max 2024-06-30 --dist-max 0.05| Flag | Type | Description |
|---|---|---|
--date-min | string | Minimum date (YYYY-MM-DD) |
--date-max | string | Maximum date (YYYY-MM-DD) |
--dist-max | float64 | Maximum approach distance (AU) |
--body | string | Close-approach body (e.g., Earth) |
--json | bool | Output as JSON |
ssd fireball
Section titled “ssd fireball”nasa ssd fireballnasa ssd fireball --date-min 2024-01-01 --date-max 2024-06-30| Flag | Type | Description |
|---|---|---|
--date-min | string | Minimum date (YYYY-MM-DD) |
--date-max | string | Maximum date (YYYY-MM-DD) |
--json | bool | Output as JSON |
ssd nhats
Section titled “ssd nhats”List near-Earth objects accessible for human exploration.
nasa ssd nhatsssd scout
Section titled “ssd scout”List objects tracked by the Scout impact hazard assessment system.
nasa ssd scoutssd sentry
Section titled “ssd sentry”List objects monitored by the Sentry impact monitoring system.
nasa ssd sentryssd sbdb
Section titled “ssd sbdb”Look up a small body in the JPL Small-Body Database.
nasa ssd sbdb Ceresnasa ssd sbdb "433 Eros"Earth Observatory Natural Event Tracker. Requires a subcommand.
eonet events
Section titled “eonet events”nasa eonet eventsnasa eonet events --status open --limit 10nasa eonet events --category wildfires --days 30| Flag | Type | Description |
|---|---|---|
--status | string | Event status: open, closed |
--category | string | Category filter |
--days | int | Events within last N days |
--limit | int | Maximum number of events |
--source | string | Source filter |
--start | string | Start date (YYYY-MM-DD) |
--end | string | End date (YYYY-MM-DD) |
--json | bool | Output as JSON |
--api-key | string | API key override |
eonet event
Section titled “eonet event”nasa eonet event EONET_6542eonet categories
Section titled “eonet categories”nasa eonet categorieseonet sources
Section titled “eonet sources”nasa eonet sources