Overview
This node retrieves photos taken by Mars Rovers from NASA's public API. It is useful for scenarios where users want to access historical or recent images captured by specific Mars rovers on particular Earth dates. For example, a user might want to fetch photos taken by the Curiosity rover on a given date to analyze Martian terrain or share space exploration content.
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 the Mars Rover photos. |
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. This allows downstream nodes or workflows to process or display the images accordingly.
Dependencies
- Requires an API key credential for NASA's API to authenticate requests.
- The node makes HTTP GET requests to NASA's Mars Rover Photos API endpoint at
https://api.nasa.gov/mars-photos/api/v1/rovers/{roverName}/photos. - The date parameter is formatted as an ISO string (YYYY-MM-DD) based on the provided Earth date input.
Troubleshooting
- No photos returned: If no photos are found for the selected rover and date, verify that the date is within the operational period of the chosen rover.
- Authentication errors: Ensure that a valid NASA API key credential is configured in n8n.
- Invalid date format: The date must be a valid Earth date; otherwise, the API may reject the request.
- API rate limits: NASA's API has usage limits; hitting these may cause temporary failures.