DEV Community

Cover image for How to Build a Flight Status Dashboard with SkyLink API and React
SkyLink API
SkyLink API

Posted on • Originally published at skylinkapi.com

How to Build a Flight Status Dashboard with SkyLink API and React

Building a real-time flight status dashboard is one of the most practical applications of aviation data APIs. In this tutorial, we walk through creating a fully functional dashboard using SkyLink API and React that displays live departures, arrivals, and flight status updates.

Hero image by Luke Chesser on Unsplash

Why Build a Flight Status Dashboard?

Flight status dashboards are used by airports, airlines, travel agencies, and logistics companies to keep passengers, staff, and systems informed. Whether you are building a customer-facing display, an internal operations tool, or a travel app feature, a flight dashboard is a high-value component.

With SkyLink API, you get access to:

  • Real-time flight status (delays, cancellations, gate changes)
  • 12-hour departure and arrival schedules for any airport
  • 50,000+ airports worldwide
  • 99.99% uptime for production-grade reliability

Prerequisites

Before starting, make sure you have:

  • Node.js 18+ installed
  • A SkyLink API key (sign up free at RapidAPI)
  • Basic familiarity with React and REST APIs

Step 1: Set Up the React Project

npx create-react-app flight-dashboard
cd flight-dashboard
npm install axios
Enter fullscreen mode Exit fullscreen mode

Create a .env file at the project root:

REACT_APP_SKYLINK_API_KEY=your_rapidapi_key_here
REACT_APP_SKYLINK_HOST=skylink-api.p.rapidapi.com
Enter fullscreen mode Exit fullscreen mode

Step 2: Create the API Service Layer

Create a file src/services/skylinkApi.js to centralize all API calls:

import axios from 'axios';

const api = axios.create({
  baseURL: 'https://skylink-api.p.rapidapi.com/v3',
  headers: {
    'x-rapidapi-key': process.env.REACT_APP_SKYLINK_API_KEY,
    'x-rapidapi-host': process.env.REACT_APP_SKYLINK_HOST,
  },
});

// Get departures for an airport
export const getDepartures = async (icaoCode) => {
  const response = await api.get(`/flights/departures`, {
    params: { airport: icaoCode },
  });
  return response.data;
};

// Get arrivals for an airport
export const getArrivals = async (icaoCode) => {
  const response = await api.get(`/flights/arrivals`, {
    params: { airport: icaoCode },
  });
  return response.data;
};

// Get status for a specific flight
export const getFlightStatus = async (flightIata) => {
  const response = await api.get(`/flights/status`, {
    params: { flight: flightIata },
  });
  return response.data;
};
Enter fullscreen mode Exit fullscreen mode

Step 3: Build the Departure Board Component

Create src/components/DepartureBoard.jsx:

import React, { useEffect, useState } from 'react';
import { getDepartures } from '../services/skylinkApi';

const DepartureBoard = ({ airportCode }) => {
  const [departures, setDepartures] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    const fetchDepartures = async () => {
      try {
        const data = await getDepartures(airportCode);
        setDepartures(data.flights || []);
      } catch (error) {
        console.error('Failed to fetch departures:', error);
      } finally {
        setLoading(false);
      }
    };

    fetchDepartures();

    // Refresh every 60 seconds
    const interval = setInterval(fetchDepartures, 60000);
    return () => clearInterval(interval);
  }, [airportCode]);

  if (loading) return <div>Loading departures...</div>;

  return (
    <div className="departure-board">
      <h2>Departures - {airportCode}</h2>
      <table>
        <thead>
          <tr>
            <th>Flight</th>
            <th>Destination</th>
            <th>Scheduled</th>
            <th>Status</th>
          </tr>
        </thead>
        <tbody>
          {departures.map((flight, index) => (
            <tr key={index}>
              <td>{flight.flight_iata}</td>
              <td>{flight.arr_iata}</td>
              <td>{flight.dep_time_utc}</td>
              <td>{flight.status}</td>
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  );
};

export default DepartureBoard;
Enter fullscreen mode Exit fullscreen mode

Step 4: Add Airport Search

Let users search for any airport using the SkyLink Airport Search endpoint. Add to your API service:

export const searchAirports = async (query) => {
  const response = await api.get(`/airports/search`, {
    params: { query },
  });
  return response.data;
};
Enter fullscreen mode Exit fullscreen mode

Then create a search component that lets users type an airport name and see matching results with ICAO codes.

Step 5: Combine Everything in App.js

import React, { useState } from 'react';
import DepartureBoard from './components/DepartureBoard';
import ArrivalBoard from './components/ArrivalBoard';

function App() {
  const [airport, setAirport] = useState('KJFK');

  return (
    <div className="App">
      <header>
        <h1>Flight Status Dashboard</h1>
        <input
          type="text"
          value={airport}
          onChange={(e) => setAirport(e.target.value.toUpperCase())}
          placeholder="Enter ICAO code (e.g., KJFK)"
        />
      </header>
      <main>
        <DepartureBoard airportCode={airport} />
        <ArrivalBoard airportCode={airport} />
      </main>
    </div>
  );
}

export default App;
Enter fullscreen mode Exit fullscreen mode

Step 6: Auto-Refresh and Error Handling

For a production dashboard, add these improvements:

  • Auto-refresh every 30-60 seconds using setInterval
  • Error boundaries for graceful failure handling
  • Loading skeletons for better UX during data fetches
  • Rate limit awareness -- SkyLink API plans start at 1,000 requests/month (free), scaling to 200,000+

Optimizing API Usage

SkyLink API offers tiered pricing that fits projects of any size:

Plan Requests/Month Price
Basic 1,000 Free
Pro 5,000 $15.99/mo
Ultra 50,000 $38.99/mo
Mega 200,000 $89.99/mo

For a dashboard with 60-second refresh intervals serving a single airport, you would use approximately 1,440 requests per day. The Ultra plan at $38.99/month comfortably covers this with room to spare.

Next Steps

Once your basic dashboard is running, consider adding:

  • Weather data from SkyLink's METAR/TAF endpoints for pre-flight conditions
  • Live ADS-B tracking to display aircraft positions on a map
  • ML-powered flight time predictions using SkyLink's prediction endpoints
  • AI-generated briefings for a complete operational overview

Conclusion

Building a flight status dashboard with SkyLink API and React is straightforward thanks to the API's clean RESTful design, comprehensive documentation, and reliable data feeds. Whether you are prototyping an idea or shipping to production, SkyLink API provides the aviation data backbone your application needs.

Ready to start building? Sign up for free and get 1,000 API requests per month at no cost.

Top comments (0)