Skip to content

Statistics

TravStats turns your flight log into numbers in three places:

  1. Dashboard widgets — at-a-glance summary above the map
  2. Advanced Stats page (/stats) — the deep dive: 50+ metrics across five sections, with year-comparison and a year heatmap
  3. Top-K cards — airline ranking, country ranking, route master, inline on Advanced Stats

All numbers are computed server-side from the flights table. Rate- limited, per-user, scoped to flights with status: flown or historical for distance/time metrics; planned and cancelled flights are counted only where it makes sense (totals, status pie).

The bar above the map shows:

  • Total flights — count of all flights regardless of status
  • Total distance — great-circle sum across flown + historical legs
  • Total flight time — sum of arrival − departure (timezone-aware, see time semantics for the contract)
  • Countries visited — distinct ISO country codes touched
  • Airlines flown — distinct (normalised) airline operators
  • Cost (this year) — if you’ve entered prices anywhere

Each tile links to the relevant Advanced Stats section.

Click Stats in the nav (or click any dashboard tile). Five sections, top to bottom:

The same six tiles as the dashboard, plus year filter + comparison.

Pick a year from the dropdown to scope every stat below to that year; toggle “compare with…” to display delta values vs. another year.

  • Flights by month — bar chart, 12 months
  • Flights by year — column chart over your full history
  • Distance by year — same axis, distance instead of count
  • Day-of-week — radial chart, busiest weekday for departures
  • Total km
  • Average distance per flight
  • Longest single flight (with route + date link)
  • Shortest single flight
  • Distance distribution histogram
  • Status pie (flown / planned / cancelled / historical)
  • Category pie (business / leisure / family / commute / unassigned)
  • Aircraft type bar chart (if you’ve tagged aircraft)

The lighthearted metrics from funStats:

  • Timezone hopper — distinct IANA timezones visited
  • Early bird / Afternoon / Night owl — flights by departure hour bucket
  • Weekend warrior — count + percentage of flights on Sat/Sun
  • Loyalty score — % of flights with your most-flown airline
  • Short-haul king — count of flights under 500 km
  • Long-haul pilot — count of flights ≥ 5,000 km
  • Fastest day — busiest single day on record
  • CO2 footprint in kg, and as elephants (1 elephant ≈ 4,000 kg)
  • Milestone year — the year with most flights
  • Route master — your most-flown route + count

Spend metrics, computed from businessStats:

  • Cost per km / per flight hour — only across flights with a recorded price; bookings count once even if they produced multiple legs
  • Total cost in your currency
  • Seat class distribution — % economy / premium / business / first
  • Most common category
  • Airport diversity — distinct airports visited
  • Average flight duration — hours
  • Busiest month

The “interesting trivia” metrics from uniqueStats:

  • Time travellers — flights where local arrival hour < local departure hour
  • Equator crossings — North↔South hemisphere transitions
  • Arctic flights — any leg crossing 66.5°N
  • Ocean crossings — flights > 5,000 km (heuristic, no actual coastline check)
  • Highest airport — by altitude in metres
  • Northernmost / southernmost point
  • Longest travel chain — consecutive same-airport hand-offs within 24 h
  • Fastest route — highest average ground speed (capped at 1,200 km/h to ignore bad data)
  • Most countries in a single day

Top 20 airports by visit count, with arrows for most departed, most arrived, and first/last visit dates.

  • Window / aisle / middle distribution
  • Row range histogram (front, middle, rear thirds)
  • Seat consistency score (% of times you got the same letter)

A GitHub-style yearly calendar grid: each cell is a day, shaded by the number of flights that day. Hover for tooltip with airlines + IATA codes; click a date to scroll to that day’s flights in the table.

The year picker at the top lets you flip between any year you have flights in.

A “Generate flight certificate” button on Advanced Stats lets you download a one-page PDF summarising the selected year — total flights, distance, top route, top airline. Useful as a screenshot-able year-in- review or to print as a memento.

All endpoints sit under /api/v1/stats:

EndpointReturns
GET /summaryThe headline numbers — total flights/distance/time/cost, status pie, airline pie
GET /routesPer-route counts for the top-N table
GET /funThe Fun section metrics (funStats)
GET /businessThe Business section metrics (businessStats)
GET /uniqueThe Unique section metrics (uniqueStats)
GET /seatsSeat-class + position distributions
GET /airlinesPer-airline aggregations (count, distance, hours)
GET /countriesPer-country counts of arrivals/departures

All accept fromDate, toDate, and a year parameter (with optional compareYear) — the same scoping the UI applies. Authentication is via cookie (UI) or PAT with read scope (API).

The full request/response shapes are in REST API, and the OpenAPI spec at /api-docs for live exploration.

  • Distance uses great-circle, not actual flight path. No jet-stream rerouting, no waypoint-based correction. Real flown distance is typically 1–3 % higher
  • Timezone-aware calculations need the airport’s IANA timezone in the cached airport database. Coverage is good (>95 % of commercial IATA airports) but private/general-aviation strips may fall back to “skip rather than guess”
  • CO2 figures are rough. 0.25 kg/km short-haul, 0.20 kg/km long-haul, single-cabin assumption. Don’t use for offset certification — use a dedicated calculator like myclimate.org
  • No multi-user aggregates. Every stat is scoped to your own flights. There’s no instance-wide “all users’ totals” dashboard; multi-user privacy is the design intent