Rob van der Woude's Scripting Pages

Airplane Registration Lookup

Version 2.14

Release date 2020-07-04

 

This is a (relatively) simple PowerShell demo script to lookup aircraft data by entering its registration number.
The script uses Airport-data.com's API to provide a photograph of the airplane, and a link to more data.
Enter a registration number in the input field, e.g. N1944S, and click the "Search" button to search for its data.
Note that dashes are critical, depending on the country of registration, e.g. N1944S, OK-NUL and PH-PBB will work, but N-1944S, OKNUL and PHPBB won't.
If a match is found on Airport-data.com, a thumbnail of the first matching photo will be shown in the GUI, and a button "View photo on Airport-data.com".
Click the button "View photo on Airport-data.com" to view more photographs and registration data on Airport-data.com's website.
Note that the author of this script is in no way associated with Airport-data.com.
If, on the other hand, no match was found on Airport-data.com, and an extension script for that registration was installed, AirRegGUI.ps1 will use the extension to search either an online or a downloaded aircraft registry database.
If the extension for the prefix isn't installed, or if no match is found, AirRegGUI.ps1 will look for the OpenSky Network extension, and if available use that to try and find the aircraft.
Note that this may add another minute to the search!
If a match is found in the online or local database, the aircraft's manufacturer and model will be shown in the GUI, and a button "Search on Google".
An alternative search engine can be specified on the command line with the optional -SearchEngine switch.
Click the "Help" button or press the F1 key for help.
Click "Yes" to open this web page, or "No" to return to the main screen.
Run this script with the /? or -Help command line switch for help on command line arguments, or in PowerShell Get-Help './AirRegGUI.ps1' -Full.

 

Extensions

As of version 2.10, AirRegGUI.ps1 can be extended with local and online database lookup scripts.

These extension scripts should be located in AirRegGUI.ps1's parent folder.
The naming convention for these extension scripts is AirRegXXCmd.ps1, where XX is the prefix of the aircraft registrations, e.g. PH for the Netherlands, N for the US, TF for Iceland, etc.
If working with local database files, these will be stored in a subdirectory XX.
Besides "national" extensions, the AirRegOpenSkyCmd.ps1 extension can be used as a last resort, to search for an aircraft with any prefix. This will add about a minute to the total search time.

So when extensions are installed for the US (N), the Netherlands (PH), Iceland (TF) and OpenSky (all prefixes), the directory tree would look like this:

  AirRegGUI.ps1
  AirRegNCmd.ps1
  AirRegOpenSkyCmd.ps1
  AirRegPHCmd.ps1
  AirRegTFCmd.ps1
  N\
     ACFTREF.txt
     MASTER.txt
  OpenSkyNetwork\
     aircraftDatabase.csv
  PH\
     2020-02-10 Aircraft registrations.xlsx

Note the absence of a subdirectory TF.
This subdirectory is not required because AirRegTFCmd.ps1 uses an online database.

All extension scripts available will be included in AirRegGUI's download ZIP file.

You will need to download the local database files yourself, links are provided here.
If you see an extension script mentioned here that you do not have yet, redownload AirRegGUI.
Make sure to update the downloaded databases every now and then, to keep the registrations up-to-date.

 

Online and downloadable databases
Country Registration
prefix
Script Database
name ver release download link updates relevant files file format
All   AirRegOpenSkyCmd.ps1 1.00 2020-05-15 OpenSky Network monthly aircraftDatabase.csv CSV (*.csv)
Australia VH AirRegVHCmd.ps1 1.00 2020-05-19 Civil Aviation Safety Authority annual acrftreg.csv CSV (*.csv)
Austria OE AirRegOECmd.ps1 1.01 2021-01-05 Austro Control Austrian Aircraft Register annual Gesamt_yyyy_EN.pdf PDF (*.pdf)
Belgium OO & O AirRegOOCmd.ps1 1.00 2021-01-07 Pascal Brugier's online Belgian aircraft registration database online
Brasil 1 PP,PR..PU AirRegPPCmd.ps1
AirRegPRCmd.ps1
AirRegPSCmd.ps1
AirRegPTCmd.ps1
AirRegPUCmd.ps1
1.01 2020-07-24 Consultas ao Registro Aeronáutico Brasileiro online
Canada C AirRegCCmd.ps1 1.00 2020-05-10 Canadian Civil Aircraft Register monthly carscurr.txt CSV (*.txt)
France F AirRegFCmd.ps1 1.00 2020-05-16 Agence Nationale des Titres Sécurisés monthly export.csv CSV (*.csv)
Iceland TF AirRegTFCmd.ps1 1.00 2020-05-09 Icelandic Transport Authority Aircraft Registry online
Ireland EI AirRegEICmd.ps1 1.00 2020-05-10 Irish Aviation Authority monthly dd-month-yyyy.xlsx Excel (*.xlsx)
Lithuania LY AirRegLYCmd.ps1 1.00 2021-01-05 Register of Civil Aircraft of the Republic of Lithuania annual Lietuvos-Respublikoje-registruotu-orlaiviu-sarasas.pdf 2 PDF (*.pdf)
Netherlands PH AirRegPHCmd.ps1 1.03 2021-01-06 Inspectie Leefomgeving en Transport monthly "yyyy-MM-dd Aircraft registrations.xlsx" Excel (*.xlsx)
New Zealand ZK AirRegZKCmd.ps1 1.00 2020-05-19 Civil Aviation Authority, Aviation Security Service unknown AircraftRegisterExport.tab tab-delimited (*.tab)
Switzerland HB AirRegHBCmd.ps1 1.00 2021-08-17 Federal Office of Civil Aviation FOCA monthly "Swiss Aircraft Register.csv" CSV (*.csv)
United States N AirRegNCmd.ps1 1.00 2020-05-09 Federal Aviation Administration annual ACFTREF.txt, MASTER.txt CSV (*.txt)
Online and downloadable databases
Country
Prefix
Script
Version
Release Date
Database
File(s)
All AirRegOpenSkyCmd.ps1
1.00
2020-05-15
OpenSky Network
aircraftDatabase.csv
Australia
VH
AirRegVHCmd.ps1
1.00
2020-05-19
Civil Aviation Safety Authority
acrftreg.csv
Austria
OE
AirRegOECmd.ps1
1.01
2021-01-05
Austro Control Austrian Aircraft Register
Gesamt_yyyy_EN.pdf
Belgium
OO & O
AirRegOOCmd.ps1
1.00
2021-01-07
Pascal Brugier's online Belgian aircraft registration database
online
Brasil *
PP,PR..PU
AirRegPPCmd.ps1
AirRegPRCmd.ps1
AirRegPSCmd.ps1
AirRegPTCmd.ps1
AirRegPUCmd.ps1
1.01
2020-07-24
Consultas ao Registro Aeronáutico Brasileiro
online
Canada
C
AirRegCCmd.ps1
1.00
2020-05-10
Canadian Civil Aircraft Register
carscurr.txt
France
F
AirRegFCmd.ps1
1.00
2020-05-16
Agence Nationale des Titres Sécurisés
export.csv
Iceland
TF
AirRegTFCmd.ps1
1.00
2020-05-09
Icelandic Transport Authority Aircraft Registry
online
Ireland
EI
AirRegEICmd.ps1
1.00
2020-05-10
Irish Aviation Authority
dd-month-yyyy.xlsx
Lithuania
LY
AirRegLYCmd.ps1
1.00
2021-01-05
Register of Civil Aircraft of the Republic of Lithuania
Lietuvos-Respublikoje-registruotu-orlaiviu-sarasas.pdf 2
Netherlands
PH
AirRegPHCmd.ps1
1.03
2021-01-06
Inspectie Leefomgeving en Transport
"yyyy-MM-dd Aircraft registrations.xlsx"
New Zealand
ZK
AirRegZKCmd.ps1
1.00
2020-05-19
Civil Aviation Authority, Aviation Security Service
AircraftRegisterExport.tab
USA
N
AirRegNCmd.ps1
1.00
2020-05-09
Federal Aviation Administration
ACFTREF.txt, MASTER.txt

 

Notes: 1 AirRegPRCmd.ps1 .. AirRegPUCmd.ps1 are almost identical helper scripts, required because Brasil uses multiple prefixes.
2 Sorry, this is not the correct spelling for the file name, but so far I failed to generate the correct Cyrillic characters.
3 Reading Excel files requires Excel.
Reading PDF files requires GhostScript.

 

Credits

API courtesy of Airport-data.com

Downloadable and online databases courtesy of national aircraft registry agencies

Downloadable OpenSky Network database courtesy of OpenSky Network

Created in Visual Studio Community 2019 with a trial version of Ironman Software's PowerShell Pro Tools Suite

Hide console window by Anthony on StackOverflow.com

Capturing Enter key (as a work-around for the form's AcceptButton not working as expected) by sodawillow on StackOverflow.com

Use of Shown event (to make sure the GUI is visible before starting an optional immediate search) by Matthias Schippling on StackOverflow.com

Embedded icon based on code by Theo on StackOverflow.com
Airplane icon image courtesy of Icons8.com

 

Change History

Version Release Date
(yyyy-mm-dd)
Changes
2.14 2020-07-04
  • Added an airplane icon, embedded in the script as well as stand-alone to use for shortcuts.
2.13 2020-05-16
  • Corrected an error in the help text displayed when clicking the Help button or pressing the F1 key.
2.12 2020-05-15
  • Added the option to search a downloaded OpenSky Network aircraft database, if AirRegOpenSkyCmd.ps1 is installed
  • Removed redundant "legacy" help text block, all help text now is "comment based help", i.e. it can be viewed using PowerShell's Get-Help cmdlet.
2.11 2020-05-10
  • Some minor bug-fixes
  • Some minor modifications in the help text
2.10 2020-05-08
  • Can now be extended with local and online search extensions, that will be used if no match is found on Airport-data.com
  • New -SearchEngine parameter to choose an alternative search engine in case no match is found on Airport-data.com
  • New -Debug switch to allow debugging this script as well as its extension scripts
  • Improved help text, with either /? or -Help switch
  • Improved command line handling
2.01 2020-05-01
  • Optional command line switch -Hide or /Hide to hide the console
  • Improved command line help text
  • Improved command line handling
2.00 2020-04-30
  • Optional command line input
  • Textbox input in GUI
  • Results presented in GUI and optionally in default browser
1.00 2020-04-22 Initial "proof of concept" version
  • Command line input
  • Results presented in GUI and optionally in default browser



As of version 2.00

AirRegGUI.ps1 (PowerShell)

replaces AirReg.hta (VBScript/HTA).

The latter is still available

but no longer maintained.


 

Download version 2.14 of the Airplane Registration Lookup:

 

Checksums:
File name: airreg.zip
MD5: 2­e­8­1­7­1­c­a­e­2­6­1­5­b­b­a­b­d­6­a­b­6­0­5­2­6­a­9­a­f­2­2­
SHA1: 9­9­c­8­1­9­7­a­3­3­c­0­7­4­f­e­2­9­6­8­7­e­4­a­b­2­3­6­6­e­c­a­4­7­5­5­5­a­8­2­

 

 

 


page last uploaded: 2021-08-17, 15:56