NASA API: Search media
Searches NASA public photos, videos or audio by words and creation year, returning matches in relevance order with thumbnails and full-size file links.
Unofficial. Not affiliated with or endorsed by NASA.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Query, required
query Words to search for, for example Saturn rings.
Saturn rings
- End Year optional
end_year Latest creation year, for example 1970.
Not set
Whole number from 1800 to 2100.
- Media Type optional
media_type Type of media to find, for example image.
image (default)
One of
image,video,audio.- Start Year optional
start_year Earliest creation year, for example 1969.
Not set
Whole number from 1800 to 2100.
- Max Results optional
max_results Maximum matches to return, for example 20.
20 (default)
Whole number from 1 to 100.
Input as JSON
{ "query": "Saturn rings"}Output
{ "results": [ { "title": "Saturn Rings", "keywords": [ "S Rings", "Voyager" ], "page_link": "https://images.nasa.gov/details/PIA02241" , "description": "Saturn Rings", "nasa_center": "Jet Propulsion Laboratory", "date_created": "2000-02-07", "nasa_media_id": "PIA02241", "full_size_link": "https://images-assets.nasa.gov/image/PIA02241/PIA02241~orig.jpg" , "thumbnail_link": "https://images-assets.nasa.gov/image/PIA02241/PIA02241~thumb.jpg" , "photographer_or_credit": "NASA/JPL" }, { "title": "Saturn A-ring", "keywords": [ "S Rings", "Voyager" ], "page_link": "https://images.nasa.gov/details/PIA01952" , "description": "Saturn A-ring", "nasa_center": "Jet Propulsion Laboratory", "date_created": "1999-04-11", "nasa_media_id": "PIA01952", "full_size_link": "https://images-assets.nasa.gov/image/PIA01952/PIA01952~orig.jpg" , "thumbnail_link": "https://images-assets.nasa.gov/image/PIA01952/PIA01952~thumb.jpg" , "photographer_or_credit": "NASA/JPL" }, { "title": "Saturn A-Ring", "keywords": [ "S Rings", "Voyager" ], "page_link": "https://images.nasa.gov/details/PIA01988" , "description": "Saturn A-Ring", "nasa_center": "Jet Propulsion Laboratory", "date_created": "1999-07-23", "nasa_media_id": "PIA01988", "full_size_link": "https://images-assets.nasa.gov/image/PIA01988/PIA01988~orig.jpg" , "thumbnail_link": "https://images-assets.nasa.gov/image/PIA01988/PIA01988~thumb.jpg" , "photographer_or_credit": "NASA/JPL" } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"nasa.gov/search_images","input":{"query":"Saturn rings"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "nasa.gov/search_images" , "input": { "query": "Saturn rings" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "nasa.gov/search_images" , "input": { "query": "Saturn rings" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run nasa.gov/search_images# with {"query":"Saturn rings"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "query" ], "properties": { "query": { "type": "string", "minLength": 1, "description": "Words to search for, for example Saturn rings." }, "end_year": { "type": "integer", "maximum": 2100, "minimum": 1800, "description": "Latest creation year, for example 1970." }, "media_type": { "enum": [ "image", "video", "audio" ], "type": "string", "default": "image", "description": "Type of media to find, for example image." }, "start_year": { "type": "integer", "maximum": 2100, "minimum": 1800, "description": "Earliest creation year, for example 1969." }, "max_results": { "type": "integer", "default": 20, "maximum": 100, "minimum": 1, "description": "Maximum matches to return, for example 20." } }, "additionalProperties": false}Output schema
{ "type": "object", "required": [ "results" ], "properties": { "results": { "type": "array", "items": { "type": "object", "required": [ "title", "description", "date_created", "nasa_center", "photographer_or_credit", "keywords", "thumbnail_link", "full_size_link", "page_link", "nasa_media_id" ], "properties": { "title": { "type": [ "string", "null" ] }, "keywords": { "type": "array", "items": { "type": "string" } }, "page_link": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "nasa_center": { "type": [ "string", "null" ] }, "date_created": { "type": [ "string", "null" ], "format": "date" }, "nasa_media_id": { "type": "string" }, "full_size_link": { "type": [ "string", "null" ] }, "thumbnail_link": { "type": [ "string", "null" ] }, "photographer_or_credit": { "type": [ "string", "null" ] } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
nasa.gov/search_images- Returns
- title, description, date created, NASA center, credit, keywords, thumbnail link, full-size link, page link, media id
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method nasa.gov/search_images with the inputs above.
Ask your agent
- Find NASA photos of Saturn's rings taken between 2004 and 2017
- Show me NASA videos about the Apollo 11 moon landing from 1969
- Look for audio recordings from Mission Control during Apollo 13 in 1970
- Search NASA images of the Hubble telescope from the 1990s, up to 20 results
- Need NASA video clips of Mars rovers created between 2010 and 2021
See more
All NASA methodsReturns NASA's Astronomy Picture of the Day for a date: title, explanation, featured media link, optional high-resolution link, and credit.
nasa.gov/get_astronomy_picture_of_the_dayList EONET natural events with latest observations in the past number of days, most recent first. A country or region filter matches reported event locations against mapped boundaries; locations and ongoing status are approximate, and not all events have a reported size or strength.
nasa.gov/list_natural_eventsFinds upcoming International Space Station sightings for a city in NASA's city list, with local start times, visibility and sky directions. Cities without scheduled passes return an empty list.
nasa.gov/get_iss_sightingsLists near-Earth asteroids that pass Earth between two UTC dates within a chosen distance, with approach times, size ranges, speed and hazard status.
nasa.gov/list_near_earth_asteroidsSearches public National Archives Catalog records by keywords, year range, material type and online availability, in catalog relevance order.
catalog.archives.gov/search_recordsSearches NPR-published articles by keyword, newest first or by best match, with optional publication dates, and returns each article's date, authors, section and summary.
npr.org/search_newsSearches New York Times article headlines and summaries by keyword, optionally within a date range, and returns matching articles with dates, authors, sections and links, newest or most relevant first.
nytimes.com/search_newsSearches Reuters articles by keyword through Google News, with optional publication date range, order and page. Summaries and bylines are filled in when Reuters serves the article page.
reuters.com/search_news