Skip to content

digitalhen/tsa-times

Repository files navigation

NYC Airport Security Wait Times

Live TSA security checkpoint wait times for JFK, Newark (EWR), and LaGuardia (LGA) airports.

Live site: https://tsa-wait-times-production.up.railway.app

Features

  • Real-time wait times for all terminals at JFK, Newark, and LaGuardia
  • Airline search — type your airline to find your terminal and current wait time
  • Historical trends — chart with 5-minute smoothed data, filterable by airport, terminal, and queue type (General / TSA Pre)
  • System overview — NYC-wide average and per-airport comparison at a glance
  • Clickable terminal cards — click any terminal to filter the chart
  • Shareable URLs — airport, terminal, and time range selections persist in query strings
  • Dynamic OG image — social previews show live wait times when shared
  • Auto-refresh — data updates every 60 seconds
  • Background scraper — collects data every minute for historical analysis

Data Source

Wait times are fetched from the Port Authority's GraphQL API (api.jfkairport.com/graphql), which serves real-time security checkpoint data for all three NYC-area airports.

Tech Stack

  • Next.js 16 (App Router, TypeScript)
  • SQLite (via better-sqlite3) for historical data storage
  • Recharts for data visualization
  • Tailwind CSS for styling
  • Railway for hosting with persistent volume for the database

Development

npm install
npm run dev

The app runs at http://localhost:3000. The background scraper starts automatically and collects data into data/wait-times.db.

Deployment

Deployed on Railway with a persistent volume mounted at /data for SQLite storage. The TZ environment variable is set to America/New_York.

railway up

API Routes

Route Description
GET /api/current Live wait times from all 3 airports
GET /api/history?airport=JFK&hours=24 Historical data with optional filters
GET /api/scrape Trigger a manual data collection
GET /api/stats?hours=24 Aggregate stats and hourly averages
GET /api/health Health check endpoint
GET /og Dynamic Open Graph image with live data

About

Live TSA security checkpoint wait times dashboard for JFK, Newark, and LaGuardia with historical trends

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages