Skip to content

craftkeg/flyfreq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlyFreq ✈️

A flight assistant for the developer's frequent travel. Track recurring routes, compare travel patterns, and find the cheapest weeks to fly.

Node 18+ License: MIT

What it does

FlyFreq fetches one-way flight prices from Google Flights (via SerpApi), pairs them into round-trips across multiple weekly patterns, and renders everything in a clean dark-mode dashboard.

Two built-in profiles:

  • Commute — PHX ↔ Bay Area (SFO/SJC), 2-night patterns (Mon–Wed, Tue–Thu, Wed–Fri, Sun–Tue)
  • Home — PHX ↔ UK (LHR/MAN), holiday trips (4 nights to 3 weeks)

Dashboard features:

  • Sparkline price chart across 26 weeks with nonstop overlay
  • Filter by airport, stops, departure/return time, and trip length
  • All flight options shown per week (not just the cheapest)
  • Click any route to open Google Flights for that leg
  • Profile switcher with contextual descriptions

Quick start

# 1. Clone
git clone https://github.com/craftkeg/flyfreq.git
cd flyfreq

# 2. Add your SerpApi key
echo "SERPAPI_KEY=your_key_here" > .env

# 3. Run
node freqfly.js

The dashboard opens automatically in your browser.

How it works

freqfly.js          →  flights_data.js  →  freqfly.html
(Node fetcher)         (generated data)     (viewer)
  1. freqfly.js hits SerpApi for each route × pattern × week, caches responses for 24h in .freqfly_cache/
  2. Writes all results to flights_data.js as window.FREQFLY_DATA
  3. freqfly.html reads that data and renders the dashboard — no server needed, just open the file

Configuration

Edit the PROFILES array in freqfly.js to add your own routes and patterns:

const PROFILES = [
  {
    name: 'Commute',
    desc: 'PHX → Bay Area weekly round-trips · cheapest by calendar week',
    routes: [['PHX', 'SFO'], ['PHX', 'SJC']],
    patterns: [
      { out: 0, ret: 2, nights: 2, label: 'Mon–Wed' },  // 0 = Monday
      { out: 6, ret: 1, nights: 2, label: 'Sun–Tue' },  // 6 = Sunday
    ],
  },
]
  • out — departure day offset from Monday (0=Mon, 6=Sun)
  • nights — trip duration
  • WEEKS_AHEAD — how many weeks to scan (default: 26)

Requirements

  • Node 18+ (uses built-in fetch)
  • SerpApi keyget one here (free tier: 100 searches/month)

License

MIT

About

A flight assistant for the developer's frequent travel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors