JUHE API Marketplace
Comprehensive Documentation

API Documentation

Everything you need to integrate and use our APIs effectively with guides, references, and examples

Globel Flight API

2 min read

Build a Live Flight Tracker Widget in 15 Minutes with a REST API

Building a live flight tracker is a fantastic project for any developer. It teaches you how to handle user input, make authenticated requests to a third-party API, and dynamically display real-time data—all essential skills.

This tutorial will walk you through building a simple but functional flight tracker widget using HTML, CSS, and vanilla JavaScript. A user will be able to enter a flight number and a date, and our application will call a REST API to display its live status, position, and delay information. We'll be using the Global Flight API on hub.juheapi.com for its simple lookup functionality and clear JSON response.

Step 1: Get Your API Key

Before you can track any flights, you need to authenticate your requests.

  1. Sign up for a free account at juheapi.com.
  2. Navigate to your user dashboard to find and copy your API key.
  3. Keep this key ready for use in our JavaScript code.

Step 2: Understanding the API Request and Response

The API is designed for simplicity.

  • The Request: You'll make a GET request with simple query parameters:
    • key: Your API key.
    • name: The unique flight identifier (e.g., the flight IATA code like AA123).
    • date: The flight's departure date in YYYY-MM-DD format.
  • The JSON Response: A successful call returns a JSON object. The result object contains all the flight details. Key fields include:
    • flight_status: The most important field (e.g., scheduled, active, landed, cancelled).
    • live: An object containing real-time latitude, longitude, speed_horizontal.
    • departure.delay, arrival.delay: Delay information in minutes.
    • airline.name, departure.airport, arrival.airport: Key descriptive information.

Step 3: Building the Application

Create your own application now.

Conclusion & Next Steps

Congratulations! You've now built a live flight tracker, a core feature for any travel or logistics application.

Happy coding!