NASA Pics icon

NASA Pics

Get data from NASAs API

Actions2

  • Astronomy Picture of the Day Actions
  • Mars Rover Photo Actions

Overview

This node fetches photos taken by Mars Rovers from NASA's public API. It is useful for retrieving images captured on specific Earth dates by one of the Mars rovers: Curiosity, Opportunity, Perseverance, or Spirit. Typical use cases include space research, educational projects, or any application requiring access to authentic Mars surface imagery.

For example, you can get photos taken by the Curiosity rover on a particular date to analyze terrain changes or share recent Mars exploration visuals.

Properties

Name Meaning
Rover Name Choose which Mars Rover to get a photo from. Options: Curiosity, Opportunity, Perseverance, Spirit
Date The Earth date for which to retrieve photos. The date is formatted as YYYY-MM-DD

Output

The node outputs JSON data containing an array of photos taken by the specified Mars rover on the given Earth date. Each photo object typically includes metadata such as the image URL, camera details, and the date the photo was taken on Mars.

No binary data output is indicated in the source code.

Dependencies

  • Requires an API key credential for NASA's API.
  • The node makes HTTP GET requests to NASA's API endpoint at https://api.nasa.gov/mars-photos/api/v1/rovers/{roverName}/photos.
  • The user must configure the node with a valid NASA API key credential in n8n.

Troubleshooting

  • Common issues:
    • Invalid or missing API key will cause authentication errors.
    • Requesting photos for a date when the rover did not take any pictures will return an empty array.
    • Incorrect date format may lead to request failures or no results.
  • Error messages:
    • Authentication errors indicate problems with the API key; ensure it is correctly set up.
    • HTTP 404 or similar errors may mean the rover name or endpoint URL is incorrect.
    • Empty results are not errors but indicate no photos available for the chosen date.

Links and References

Discussion