Real-Time Asteroid Watch

asteroidEvery day asteroids are passing close to planet Earth. Their trajectory is closely monitored by NASA as some of these could potentially pose a threat to our planet. In this python challenge we are going to use the NeoWs API to retrieve some real-time data from NASA about these near Earth asteroids.

You can read more about the NeoWs API on:


This API uses JSON to format the data. JSON (JavaScript Object Notation) is a popular lightweight data-interchange format. Its main benefit is that it is easy for humans to read and write and it is easy for machines to parse and generate as you can see in the code provided below. You can read more about JSON on

You can see what the JSON data returned by the API looks like:

Python Code

Check our code to see how we make a call to the API and how we retrieve and extract the requested JSON data.

Your Task

Update this code to show all the near Earth asteroids approaching Earth in the next 7 days.
The JSON data also contains links to web pages for each asteroid (e.g. Update the Python code to also display the relevant web addresses.

Did you like this challenge?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 9

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: