Arun Gopinath

Discover with Arun Gopinathan: Tech, Photography, and Everything in Between

Exploring Space in Real-Time: A Shiny App Adventure

Arun Gopinath / 2023-12-16

Exploring Space in Real-Time: A Shiny App Adventure

Space Exploration

Space Exploration


Space has always fascinated humanity, and with the advent of technology, we now have the ability to track the movement of astronauts and spacecraft in real-time. In this blog post, we’ll explore a Shiny app that provides a captivating experience of monitoring the current inhabitants of space and the live position of the International Space Station (ISS).

The Shiny App

Libraries and Functionality

The Shiny app is built using R and leverages several key libraries:

The app includes a function getWikipediaLink to fetch Wikipedia links for astronauts based on their names. This feature allows users to dive deeper into the background of each astronaut.

# Function to get Wikipedia link for a given person
getWikipediaLink <- function(name) {
    # Search for the Wikipedia page using the person's name
    wikipedia_url <- paste0("", gsub(" ", "_", name))
    # Validate if the Wikipedia page exists
    if (httr::GET(wikipedia_url)$status_code == 200) {
    } else {
  }, error = function(e) {

Real-Time Data Retrieval

The app fetches real-time data from two APIs:

  1. People in Space API: Retrieves information about the astronauts currently in space.
  2. ISS Location API: Provides the live location of the International Space Station.

The app then converts the latitude and longitude data into numeric values for mapping purposes.

# People in space right now
astro <- httr::GET("")
data <- jsonlite::fromJSON(rawToChar(astro$content))

# Live ISS location
live <- httr::GET("")
now <- jsonlite::fromJSON(rawToChar(live$content))

# Convert latitude and longitude to numeric
now$iss_position$latitude <- as.numeric(now$iss_position$latitude)
now$iss_position$longitude <- as.numeric(now$iss_position$longitude)

User Interface

Dashboard Overview

The user interface is designed with a sleek and modern look using the “flatly” theme. The dashboard consists of three main sections:

  1. Total People in Space: A visually appealing box displaying the total number of people currently in space, adorned with an icon of people to provide a quick visual cue.
# Display total number of people in space in a square box
  value = length(data$people$name),
  subtitle = "Total People in Space",
  icon = icon("users"),
  color = "blue"  # Change 'primary' to 'blue'
  1. List of People in Space: A table showcasing the astronauts along with hyperlinks to their Wikipedia pages. This section allows users to explore detailed information about each astronaut.
# Create a new data frame with hyperlinked names
hyperlinked_data <- data.frame(
  name = sapply(seq_along(data$people$name), function(i) {
    if (!is.null(wikipedia_links[i])) {
      sprintf('<a href="%s" target="_blank">%s</a>', wikipedia_links[i], data$people$name[i])
    } else {
  stringsAsFactors = FALSE

# Display the table with hyperlinked names
  1. Live Position of ISS: An interactive map displaying the real-time location of the ISS. Users can zoom in and out and click on the marker to view detailed information about the ISS’s latitude and longitude.
# Render ISS live location on a leaflet map
output$map <- renderLeaflet({
  leaflet() %>%
    addTiles() %>%
    setView(lng = now$iss_position$longitude, lat = now$iss_position$latitude, zoom = 8) %>%
      lng = now$iss_position$longitude,
      lat = now$iss_position$latitude,
      popup = sprintf("Latitude: %s<br>Longitude: %s", now$iss_position$latitude, now$iss_position$longitude)

Additional Tabs

The section includes about app and about me sections.


In a world where space exploration is becoming more accessible, this Shiny app provides a unique and engaging way to stay updated on the whereabouts of astronauts and the ISS. Whether you’re a space enthusiast, a student, or just curious about what’s happening above our planet, this app offers a visually appealing and informative experience.

🌐 Explore the Shiny app here.

👨‍💻 GitHub Repository: People in Space Explorer on GitHub

For more information about the developer, visit Arun Gopinathan’s LinkedIn profile.

Happy exploring the cosmos in real-time! 🚀✨