Retrieve all mars photos from a specific day and camera.
Ensure a seamless setup with the following prerequisites:
- Docker - See Get Docker
- Docker Compose - Installed with Docker Desktop, See Install Docker Compose
- API Key - To generate the API Key access the NASA website, See Generate NASA API Key
- Clone github repository in your local system
git clone https://github.com/FelippoDev/Emotive-task
- Navigate to the project directory in your terminal
- Create the necessary environment variables: within the repository, create a file called
.env
insideapp
folder then inside this file set the environment variables following the examples in the.env.example
- set the environment variable
NASA_BASE_URL
tohttps://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos
and the variableNASA_API_KEY
set the generated API Key - At last, run the command:
docker-compose up --build
You can access the API docs by visiting this URL in your preferred browser.
API Docs: http://127.0.0.1:8000/
In the API we have a endpoint called GET /api/v1/mars_photos
that awaits two query parameters:
-
camera(Enum): Select camera by name, Only accepts the following cameras names:
Chemistry and Camera Complex
Navigation Camera
Rear Hazard Avoidance Camera
Front Hazard Avoidance Camera
Mast Camera
Mars Hand Lens Imager
Mars Descent Imager
-
earth_date(Date): Retrieve mars photo by earth date, example:
2024-01-01