Real-Time ISS Tracker

international-space-station
The International Space Station (ISS) is moving at close to 28,000 km/h and orbits the Earth 16 times per day, once every 90 minutes! In this python challenge we are going to use an open source API (Open Notify) to retrieve some real-time data from Nasa about the location of the ISS.

Our aim is to retrieve the current longitude and latitude of the International Space Station and to use this information to plot it on the map.

You can read more about the API on: http://open-notify.org/Open-Notify-API/ISS-Location-Now/

Note that we will also use the Open Notify API to retrieve the current numbers of astronauts in space and to retrieve all their names and the spacecraft they are on. You can read more about this API on: http://open-notify.org/Open-Notify-API/People-In-Space/

Both these APIs use 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 https://www.json.org/

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. You may need to see this trinket in full screen view to see the position of the ISS on the world map. An infinite “while True” loop is used to constantly update the position of the ISS on the map, with a 5-second delay between each iteration.

Your Task


The Open Notify API provides a third API to find out when the ISS will next pass over a specific location. The API requires you to provide the longitude and latitude of a location and returns a list of the next 5 date and time timestamps when the ISS will pass over, or closed to, this location.

You can find out more about this API on http://open-notify.org/Open-Notify-API/ISS-Pass-Times/

Your task is to write a Python script to display the date and time of the next five passes of the ISS over Paris, France (longitude: 45.51° N, latitude: 2.20° E).

Note that you will need to use the time library to convert a Unix Epoch Timestamp into a human readable format, using the following code:

Share Button
Tagged with: ,