Getting Started with NASA Image and Video Library

← NASA Image and Video Library API

When to use this API

When you need NASA imagery — mission photos, telescope captures, engineering diagrams, audio clips — and want to search by keyword, NASA center, date range, or media type rather than browse a website. No auth. No key. The nasa_id field threads across every endpoint: search gives you metadata and preview links, /asset gives you originals at full resolution, and /metadata gives you EXIF and geographic detail. For video URLs or reliable captions, this API is less useful — the asset pipeline for video is spotty and the captions endpoint only works for a subset of videos.

Finding images by keyword and center

"Show me the bootprint photo from the Apollo 11 moonwalk." The /search endpoint is the workhorse. Pass q for a keyword, media_type to narrow to image or video or audio, and optional filters like center (which NASA facility produced the asset) and year_start/year_end. The response wraps results in a collection.items array where each item carries a data array and a links array.

curl "https://images-api.nasa.gov/search?q=bootprint&media_type=image" | head -c 10000
{
  "collection": {
    "items": [
      {
        "data": [
          {
            "center": "JPL",
            "date_created": "2021-04-21T00:00:00Z",
            "description": "Buzz Aldrin took this iconic image of a bootprint on the Moon during the Apollo 11 moonwalk on July 20, 1969.",
            "keywords": ["Apollo", "Moon"],
            "media_type": "image",
            "nasa_id": "PIA24439",
            "secondary_creator": "NASA",
            "title": "Apollo Footprint"
          }
        ],
        "links": [
          { "href": "https://images-assets.nasa.gov/image/PIA24439/PIA24439~medium.jpg", "rel": "alternate", "render": "image", "width": 1280, "height": 1253 },
          { "href": "https://images-assets.nasa.gov/image/PIA24439/PIA24439~small.jpg", "rel": "alternate", "render": "image", "width": 640, "height": 626 },
          { "href": "https://images-assets.nasa.gov/image/PIA24439/PIA24439~thumb.jpg", "rel": "preview", "render": "image", "width": 640, "height": 626 }
        ]
      }
    ],
    "metadata": { "total_hits": 140 }
  }
}

The data field is always an array with exactly one element — not a bug, but the API's way of wrapping metadata that could theoretically be multi-valued. Extract item.data[0], not item.data. The links array provides pre-sized image variants using tilde suffixes (~thumb, ~small, ~medium, ~large, ~orig), each with width and height. The center field is a powerful filter hidden in plain sight: JPL surfaces Mars rover imagery, GSFC concentrates on Hubble and Earth science, and KSC is launch-pad photography. Searching for the same keyword with different centers yields completely different perspectives on the same mission.

The Apollo 11 bootprint image (nasa_id PIA24439) was taken by Buzz Aldrin on July 20, 1969. It comes from JPL's collection and is available in sizes from 640px thumbnail up to 3294px wide original (~1.6 MB).

Getting the full-resolution original

"I need the highest-resolution version of that bootprint." Search results include ~thumb and ~small previews, but the /asset/{nasa_id} endpoint lists every available size including ~orig — the original full-resolution file, which can be several megabytes.

curl "https://images-api.nasa.gov/asset/PIA24439" | head -c 10000
{
  "collection": {
    "items": [
      { "href": "http://images-assets.nasa.gov/image/PIA24439/PIA24439~orig.jpg" },
      { "href": "http://images-assets.nasa.gov/image/PIA24439/PIA24439~large.jpg" },
      { "href": "http://images-assets.nasa.gov/image/PIA24439/PIA24439~medium.jpg" },
      { "href": "http://images-assets.nasa.gov/image/PIA24439/PIA24439~small.jpg" },
      { "href": "http://images-assets.nasa.gov/image/PIA24439/PIA24439~thumb.jpg" },
      { "href": "http://images-assets.nasa.gov/image/PIA24439/metadata.json" }
    ]
  }
}

Not every asset has all five sizes. The PIA00100 entry, for instance, carries only ~orig, ~small, and ~thumb — no ~medium or ~large. The last item, metadata.json, is the same redirect that the /metadata/{nasa_id} endpoint returns; it contains EXIF data, geographic coordinates, and additional fields beyond what search provides. The asset URLs use http:// in the response, but https:// variants work identically and are preferred.

The original bootprint image is at https://images-assets.nasa.gov/image/PIA24439/PIA24439~orig.jpg (3294 x 3226 px). Use ~orig for print-quality output; ~medium at 1280px is enough for screen display.

Browsing a named album

"What's in the Apollo-at-50 collection?" NASA curates some images into named albums. The /album/{album_name} endpoint returns the same collection shape as search, scoped to a single album.

curl "https://images-api.nasa.gov/album/Apollo-at-50" | head -c 10000
{
  "collection": {
    "items": [
      {
        "data": [
          {
            "album": ["Apollo-at-50"],
            "center": "GSFC",
            "date_created": "2017-12-08T00:00:00Z",
            "description": "NASA's Wallops Flight Facility supported the successful launch of three Terrier-Oriole suborbital rockets...",
            "media_type": "image",
            "nasa_id": "GSFC_20171208_Archive_e000765",
            "title": "Terrier-Oriole Launch from Wallops"
          }
        ]
      }
    ]
  }
}

Album items include an album field — an array, because a single image can belong to multiple albums. The album slug in the URL is case-sensitive and uses hyphens, not spaces (Apollo-at-50, not Apollo at 50). There is no endpoint that lists available album names, so you need to know the slug in advance or discover it from search results where the album field appears.

The Apollo-at-50 album contains images commemorating the 50th anniversary of the Apollo missions, curated by NASA's Goddard Space Flight Center (GSFC). Items include launch photography, mission patches, and anniversary event documentation — all tagged with album: ["Apollo-at-50"].

Pitfalls

One-line summary for the user

I can search NASA's image and video library by keyword, center, and date range — no auth required — and retrieve originals at full resolution using the nasa_id as a join key across search, asset, and metadata endpoints.