The Taiwan–Japan air passenger statistics page (a tool page in Chinese) is the first analysis page I made from government open data. The question is simple: after the pandemic, are Taiwanese people travelling abroad again? And has travel to Japan recovered faster than airport passenger numbers overall?
Two datasets, two worlds
- The Civil Aeronautics Administration (CAA): "operating volume of air transport by airport", a dataset on Taiwan's government open data platform under the Open Government Data License, version 1. The file is not a CSV but an ODS spreadsheet; the "CSV" the dataset page offers is really just an index (four columns: name, version, time, path), and the real file URL is in the last column.
- The Japan National Tourism Organization (JNTO): statistics on visitor arrivals to Japan, one xlsx with the number of people for every month and every nationality since 2003, free to use with attribution.
The processing script is a Python file (scripts/build-aviation-stats.py) that outputs a 32 KB JSON into the repo. The page itself calls no external API at request time.
Different definitions, so only trends are compared
This is the easiest place in the whole thing to get wrong. The CAA's "passenger count" includes arrivals, departures and transit, a round trip counts as 2, and foreigners count too; JNTO only counts people "entering Japan", by passport nationality, and a trip counts as 1. Dividing one number by the other gives a ratio that looks reasonable and means nothing.
So the page only shows an index with 2019 as 100: in 2025, international plus cross-strait passengers at Taiwan's airports were 97.5% of 2019, and Taiwanese visitors to Japan were 138% of 2019. The two lines differ a lot, but this data cannot explain why (airport numbers cannot be split into "Taiwanese going to other countries"), so the page draws no causal conclusion.
I checked the numbers against the news: JNTO's figures of 670,445 Taiwanese visitors in June 2026 and 763,806 in July match the "670,000 in June, a single-month record in July" announced by the tourism organization.
The bug I caught: a cumulative table taken for another set of airports
Sheet "5-1" of the CAA ODS is the table of airports for the current month, but below it there is another table, "January to the current month cumulative", with identical airport names. My first version filtered only on "the name ends with airport" and took both tables, so 16 airports became 33 rows, and the sum was 11 times the nationwide total.
What caught it was not me looking at the screen but a unit test: "the airports add up to the nationwide total for the month". The fix is to stop when an airport repeats, and I also added a self-check in the script: if the sum does not match the "total" row, it errors out and writes nothing. The lesson is ordinary but practical: government spreadsheets are made for people to read, and it is common to find several tables hidden in one worksheet; a check that "the parts add up to the total" is more reliable than eyeballing afterwards.
A similar trap: in the CAA's annual table, this year's row is "January to the latest month, cumulative" rather than the full year, and putting it straight into a year-by-year comparison draws a last year that looks like a crash. So only full years are taken from the annual data.
Why the monthly data keeps growing
The CAA's open data only provides the latest month's airport numbers, with no history file. Each time the script runs it "merges" the new month into the existing JSON, so the monthly data starts in October 2025 and gains one month each time it is rerun in mid-month. JNTO's xlsx itself holds the whole history, so it is recomputed in full each time.
Charts: pure SVG with zero JavaScript
Both line charts are SVG output by Server Components: the monthly visitors-to-Japan overlay before and after the pandemic, and the recovery index with 2019 = 100. The accent color goes only to "this year" and "Taiwanese visitors to Japan"; the other lines are told apart by text color and dashes. A few small touches:
- Months that have not happened yet use
nullto break the line, not 0 (filling 0 would draw a dive). - The labels at the end of the lines are sorted by height and kept at least 11 units apart, so text does not overlap when two lines are close.
- The viewBox is 360 wide, so on a phone the text is almost 1:1 and does not shrink to unreadable.
Not done yet
This page uses only two datasets. Next I plan to use the same approach with the Ministry of the Interior's village-level population (overlaid on the election map), and Kaohsiung's traffic accident data.