Boarding Pass Parser

The 2-D barcodes found on boarding passes encode a large amount of interesting flight and passenger data. I wrote a parser to process the output from a scan of a boarding pass barcode.

Scan of a US Airways boarding pass, prominently showing a PDF417 2-D barcode.

I also wrote a JSON API for the boarding pass parser. Place the raw barcode data text into the following URL, and it’ll return the parsed barcode in JSON format (example):

https://www.flighthistorian.com/boarding-pass/json/BARCODE_DATA

If you need a callback function, use the following structure (example):

https://www.flighthistorian.com/boarding-pass/json/CALLBACK/BARCODE_DATA

Technical Details

The boarding pass parser is written as part of Flight Historian, a Ruby on Rails application.

Boarding pass barcodes are in International Air Transport Association (IATA) Bar-Coded Boarding Pass (BCBP) format—a compact text string which can contain details for one or more flights for a given passenger.

The implemented code is located in the BoardingPass class in my bogardpd/flight_log project.

Tags: