This project interacts with NASA's NeoWs (Near Earth Object Web Service) API to fetch and extract information about Near-Earth Objects. It provides users with insights into asteroids based on their diameter, relative velocity, and miss distances and showcases this data via a user-friendly interface.
- Fetches asteroid data within a specific date range.
- Extracts and presents the maximum and minimum diameters of asteroids.
- Displays the relative velocities of asteroids.
- Showcases the miss distances of asteroids.
- Provides a web interface for users to interactively view asteroid data.
- Docker support for easy deployment.
- Java 11 or newer
- Maven
- Docker
- A valid NASA API key. Get it from NASA's API portal
- Python 3.8
git clone https://github.com/GravityDarkLab/asteroids.git
cd nasa-neows-extractor
mvn clean install
- Build and start the application:
docker-compose up --build
This command will build the Docker image using the configurations provided in docker-compose.yml
and then run the container.
Now, you can access the application at http://localhost:8080/
.
- Stop the application:
If you wish to stop the application and the associated container, you can use:
docker-compose down
- Set up your NASA API key in
application.properties
or as an environment variable. - Run the application:
mvn spring-boot:run
- Navigate to
http://localhost:8080/
to access the user interface. Use the date selection to fetch data for a specific range. - For direct API access, use
http://localhost:8080/listRelativeVelocity?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
replacingYYYY-MM-DD
with your desired date range.
To retrieve asteroid-related data in JSON format, you can use the following endpoints:
-
Miss Distance Data:
Endpoint:/listMissDistanceJson
Usage:http://localhost:8080/listMissDistanceJson?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example:http://localhost:8080/listMissDistanceJson?start_date=2023-08-10&end_date=2023-08-11
-
Relative Velocity Data:
Endpoint:/listRelativeVelocityJson
Usage:http://localhost:8080/listRelativeVelocityJson?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example:http://localhost:8080/listRelativeVelocityJson?start_date=2023-08-10&end_date=2023-08-11
-
Max and Min Diameter Data:
Endpoint:/listMaxMinDiameterJson
Usage:http://localhost:8080/listMaxMinDiameterJson?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example:http://localhost:8080/listMaxMinDiameterJson?start_date=2023-08-10&end_date=2023-08-11
Replace YYYY-MM-DD
with the desired start and end date for which you want to retrieve asteroid-related data.
Remember, you can use tools like Postman or any service that allows HTTP requests to call these endpoints. Simply input the URL, set the request type to GET
, and hit send!
The application comes with an intuitive web interface that allows users to:
- Select Date Range: Specify the start and end date to fetch asteroid data.
- View Data: Displays the fetched asteroid data in a structured format.
I also offer a dashboard that allows you to visualize the fetched data in a graphical format. This dashboard provides a more intuitive and interactive way to understand and analyze the data from the NASA NeoWs API.
For detailed instructions on setting up and using the dashboard, please visit this link.
This project utilizes the NASA's NeoWs API.
Distributed under the MIT License. See LICENSE
for more information.