This Python project uses NASA's public API to fetch and display raw images captured by the Curiosity Rover on Mars. Users input a Martian solar day ("sol") to request and view photos taken by the rover’s front hazard avoidance camera.
- Real-world API integration with authentication.
- JSON parsing of nested responses.
- Image downloading and handling with
requests
. - Image visualization using
matplotlib
. - Simple input validation for user experience.
File Name | Description |
---|---|
apiProject.py |
Main Python script that fetches, saves, and shows image. |
rover.jpg |
Sample downloaded image after script is run. |
- Clone or download the repository.
- Navigate to the folder in your terminal.
- Make sure
requests
andmatplotlib
are installed:pip install requests matplotlib
- Run the script: python apiProject.py
- Enter a number between 14 and 3291 when prompted to select a Martian sol.
🌐 API Reference NASA Mars Rover Photos API: https://api.nasa.gov/
You must use a valid API key — the project currently uses a demo key. You can register for your own at the same link.
🧑💻 Author Veer Sawhney This project was created as part of my exploration into using real-world APIs and working with multimedia data in Python.