Skip to content

bsowlx/jetlag-be

Repository files navigation

Jetlag Backend API

Flight search API powered by AeroDataBox via RapidAPI.

API Endpoint

GET /api/flights/:flightNumber?flightDate=YYYY-MM-DD

Example:

GET /api/flights/KL856?flightDate=2025-11-11

Response:

{
  "results": [
    {
      "airline": "KLM",
      "flightNumber": "KL 856",
      "departure": {
        "airport": "Seoul Incheon",
        "code": "ICN",
        "timezone": "Asia/Seoul",
        "gmtOffset": 9,
        "scheduledUtc": "2025-11-11 14:05Z"
      },
      "arrival": {
        "airport": "Amsterdam Schiphol",
        "code": "AMS",
        "timezone": "Europe/Amsterdam",
        "gmtOffset": 1,
        "scheduledUtc": "2025-11-12 04:20Z"
      }
    }
  ]
}

Setup

  1. Install dependencies:

    npm install
  2. Configure environment variables (.env):

    PORT=3000
    RAPIDAPI_KEY=your_rapidapi_key_here
    RAPIDAPI_HOST=aerodatabox.p.rapidapi.com

    Get your RapidAPI key: AeroDataBox on RapidAPI

  3. Run the server:

    npm run start:dev

Error Codes

Code Description
400 Invalid flightDate format or rate limit exceeded
401 Missing or invalid RapidAPI key
403 AeroDataBox plan restriction
404 No flights found (returns {"results": []})
502 Upstream API error
503 Service unavailable

Production API

https://jetlag-be.vercel.app/api/flights/:flightNumber?flightDate=YYYY-MM-DD

Example:

https://jetlag-be.vercel.app/api/flights/KL856?flightDate=2025-11-11

Tech Stack

  • NestJS - Backend framework
  • AeroDataBox - Flight data provider
  • airport-timezone - Timezone & GMT offset lookup

License

MIT

About

IST-TECH hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors