This project fetches and analyzes asteroid data from NASA's Near Earth Object Web Service (NeoWs) API. The activity is designed for a team-based collaborative workflow using Git.
- Fetch asteroid data using JavaScript
fetch
withasync/await
- Analyze the retrieved data for insights
- Collaborate using Git to manage workflow effectively
-
Get an API Key
- Visit NASA API and generate your API Key.
- You’ll receive an email with your API Key.
-
Set Up the Repository
- One team member should create a repository.
- Ensure the repository includes:
package.json
(for dependencies).gitignore
(to ignorenode_modules
)
The team will be divided into two sub-groups:
📌 Task: Retrieve asteroid data from NASA's API.
- Create a file:
asteroidFetcher.js
- Fetch asteroid data from: https://api.nasa.gov/neo/rest/v1/feed?start_date=$today&end_date=$sevenDaysLater&api_key=API_KEY
- Extract the diameters (km) of asteroids approaching Earth in the next 7 days.
- Ensure error handling for API failures.
📌 Task: Analyze the fetched asteroid data.
- Create a file:
asteroidAnalyzer.js
- Compute:
- Total count of asteroids.
- Average diameter of asteroids.
- Log the results.
- Each sub-group creates feature branches: feature/fetching_data feature/analyze_stats
- Merge work into the
main
branch after completion.
After merging, create a main file (index.js
) to:
- Import functions from
asteroidFetcher.js
&asteroidAnalyzer.js
- Run the fetch function and pass the data to the analyzer
- Display the final results
Enhance the project by fetching and analyzing additional asteroid data attributes!
Happy coding! 🚀🌍