A simple API, written in Node.js with the Express framework, which allows you to identify airports, airlines and aircraft by their IATA code.
This is used by my IATA Code Decoder extension for Raycast.
The data in the API is cached version of the airport, airline and aircraft data from the Duffel API. We use a cached copy for speed because the Duffel API does not allow you to view all records in one response - you can only see up to 200 at a time.
The cached data is updated regularly thanks to the power of GitHub Actions 👼
- Make sure you're running Node.js v18 (v18.7.0 is recommended).
- Install the dependencies by running
npm install
. - Start the application by running
npm run dev
. You'll see a message once the app is ready to go. - Hit https://localhost:4000/airports?query=LHR in your browser. You'll see information about Heathrow airport 🥳
The cached data is updated regularly and committed to the repository thanks to the power of GitHub Actions. You can also do this locally yourself.
- Make sure you're running Node.js v18 (v18.7.0 is recommended).
- Install the dependencies by running
npm install
. - Set your Duffel access token. Make a copy of the example
.env
file withcp .env.example .env
, and then edit the resulting.env
file. - Run
npm run generate-airports && rpm run generate-airlines && npm run generate-aircraft
. Commit the result.
- Build the Docker image with
docker build . -t timrogers/iata-code-decoder-api
- Start a container using your built Docker image by running
docker run -d -p 4000:4000 timrogers/iata-code-decoder-api
- Hit https://localhost:4000/airports?query=LHR in your browser. You'll see information about Heathrow airport 🥳
- To stop your container - because you're done or because you want to rebuild from step 1, run
docker kill
with the container ID returned fromdocker run
.