images.nasa.gov APIimages.nasa.gov ↗
Search and retrieve NASA media: images, videos, audio, HD assets, captions, metadata, and trending items via a structured JSON API.
curl -X GET 'https://api.parse.bot/scraper/d4074a66-699d-4314-ad64-6f0c3c2f25e2/search?q=Apollo&query=Mars&media_type=image' \ -H 'X-API-Key: $PARSE_API_KEY'
Search the NASA media library by keyword with optional filtering by media type, year range, keywords, and center. Returns paginated results with metadata and preview links.
| Param | Type | Description |
|---|---|---|
| page | string | Page number for pagination. |
| query | string | Search query text (e.g. 'Mars', 'Apollo 11'). If omitted, returns all items matching other filters. |
| center | string | NASA center that published the item (e.g. 'JPL', 'GSFC', 'JSC'). |
| keywords | string | Comma-separated keywords to filter results. |
| year_end | string | Filter results to items created on or before this year (4-digit year, e.g. '2023'). |
| page_size | string | Number of results per page (max 100). |
| media_type | string | Comma-separated media types to include. Accepted values: image, video, audio. |
| year_start | string | Filter results to items created on or after this year (4-digit year, e.g. '2020'). |
{
"type": "object",
"fields": {
"collection": "object containing search results with items array, metadata (total_hits), and pagination links"
},
"sample": {
"data": {
"collection": {
"href": "http://images-api.nasa.gov/search?q=Mars&media_type=image%2Cvideo%2Caudio&page=1&page_size=100",
"items": [
{
"data": [
{
"title": "NASA Chopper Ready for a Spin on Mars",
"center": "JPL",
"nasa_id": "JPL-20190606-TECHf-0001-Mars Chopper Ready for a Spin on Mars",
"keywords": [
"NASA",
"Mars"
],
"media_type": "video",
"description": "NASA Mars 2020 mission helicopter demo.",
"date_created": "2019-06-06T00:00:00Z"
}
],
"href": "https://images-assets.nasa.gov/video/JPL-20190606-TECHf-0001-Mars Chopper Ready for a Spin on Mars/collection.json",
"links": [
{
"rel": "alternate",
"href": "https://images-assets.nasa.gov/video/JPL-20190606-TECHf-0001-Mars Chopper Ready for a Spin on Mars/JPL-20190606-TECHf-0001-Mars Chopper Ready for a Spin on Mars~large.jpg",
"render": "image"
}
]
}
],
"links": [
{
"rel": "next",
"href": "http://images-api.nasa.gov/search?q=Mars&media_type=image%2Cvideo%2Caudio&page=2&page_size=100",
"prompt": "Next"
}
],
"version": "1.1",
"metadata": {
"total_hits": 28284
}
}
},
"status": "success"
}
}About the images.nasa.gov API
This API exposes 10 endpoints covering the NASA Image and Video Library at images.nasa.gov, giving you access to search results, trending and newest uploads, full-resolution assets, EXIF/XMP metadata, and video captions. The get_item_details endpoint returns a single structured object combining the item's descriptive data, all asset URLs at every available resolution, and embedded technical metadata fields — making it the primary endpoint for building media-detail views.
Search and Discovery
The search endpoint accepts a free-text query string alongside optional filters: media_type (image, video, or audio, comma-separated), center (NASA publishing center such as JPL or GSFC), keywords, year_start, and year_end. Results are paginated — use page and page_size (up to 100 per page) to walk through the collection object returned, which includes a total_hits count and navigation links. If you omit query, the endpoint returns all items matching the remaining filters. The get_trending_and_popular and get_newest_uploads endpoints take no parameters and return ordered collections with nasa_id, title, media_type, and date_created for each item.
Asset Resolution and HD Retrieval
Every media item is identified by a nasa_id string (e.g. PIA12235). The get_asset endpoint returns the full manifest of file URLs for that ID, which may include original (~orig), medium, small, and thumbnail variants, plus a metadata.json link. The get_hd_image_url endpoint distills that manifest to a single hd_url string pointing to the highest available resolution — falling back from ~orig to ~large to ~medium when a lower tier is the best available. The get_top3_trending_images endpoint combines trending discovery with asset resolution, returning nasa_id, title, thumbnail, and hd_url for the top three results in one call.
Detailed Item Metadata
The get_item_details endpoint is the richest response shape available. For a given nasa_id it returns a data object with title, description, keywords, center, date_created, and media_type; a links array of preview URLs; a full assets array; the resolved hd_url; and a metadata object containing EXIF, XMP, and AVAIL fields extracted from the image file itself. This makes it suitable for applications that need both editorial context and technical imaging data in a single request.
Captions and Convenience Endpoints
For video assets, the get_captions endpoint accepts a nasa_id and returns a location string pointing to the .srt subtitle file for that video. The get_trending_images_only and get_all_trending_image_urls endpoints filter the trending collection to images exclusively, returning arrays of nasa_id, title, and thumbnail URLs — useful for feed widgets or gallery prefetching without needing to filter media_type client-side.
- Build a NASA media gallery that surfaces trending images with HD download links using
get_top3_trending_images. - Populate an educational content platform with the latest NASA uploads by polling
get_newest_uploadson a schedule. - Index NASA video content with synchronized subtitles by pairing
search(media_type=video) withget_captionsper result. - Display full technical provenance for a spacecraft image — EXIF, XMP, and editorial description — using
get_item_details. - Filter historical Apollo-era imagery by querying
searchwithyear_start=1961,year_end=1972, andkeywords=Apollo. - Generate a center-specific media feed by passing
center=JPLorcenter=JSCto thesearchendpoint. - Resolve the highest-quality download URL for any NASA asset by calling
get_hd_image_urlwith itsnasa_id.
| 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 | 250 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 provide an official developer API for images.nasa.gov?+
What does `get_item_details` return that `get_asset` does not?+
get_asset returns only the array of file-resolution URLs for a given nasa_id. get_item_details combines those asset URLs with the item's editorial data (title, description, keywords, center, date_created, media_type), a links array, the resolved hd_url, and a metadata object containing EXIF, XMP, and AVAIL fields — so it aggregates what would otherwise require two or three separate calls.Does the `search` endpoint support full-text search across item descriptions and keywords?+
query parameter matches against the NASA library's title, description, and keyword fields. You can also pass a separate keywords filter alongside query to narrow by explicit tags. There is no dedicated field-scoped search (e.g. title-only or description-only queries) — both inputs apply broadly. Pagination is controlled by page and page_size (max 100 per page); total_hits in the response tells you the full result count.Can I retrieve user-uploaded or community-contributed media through this API?+
center field (e.g. JPL, GSFC, JSC) identifying the publishing organization. Community or third-party uploads are not part of the NASA Image and Video Library and are not accessible here. You can fork this API on Parse and revise it to add endpoints pulling from other public NASA data sources if needed.Are audio assets accessible the same way as images and videos?+
search results when media_type includes audio, and their asset URLs are returned by get_asset and get_item_details like any other media type. However, the convenience endpoints (get_trending_images_only, get_all_trending_image_urls, get_top3_trending_images, get_hd_image_url) are scoped to images only and will not surface audio items. You can fork this API on Parse and revise it to add audio-specific convenience endpoints.