Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jpmens/airportsd

IATA airport code lookup server
https://github.com/jpmens/airportsd

airports ansible api c http iata

Last synced: 2 months ago
JSON representation

IATA airport code lookup server

Awesome Lists containing this project

README

        

AIRPORTSD(8) AIRPORTSD(8)

NAME
airportsd - IATA airport code lookup server

SYNOPSIS
airportsd [-v]

DESCRIPTION
airportsd is an HTTP-accessible IATA airport code lookup daemon. We
created this as a service students can use on lab machines for
developing an Ansible lookup plugin during trainings.

When running on a tty the program will output brief debugging
information on startup, and when it’s queried.

The (currently hard-coded) CDB database must exist and be readable by
the owner of the airportsd process.

EXAMPLE

$ curl -i http://127.0.0.1:8812/lookup?iata=bcn
HTTP/1.1 200 OK
Date: Wed, 26 Mar 2024 22:17:20 GMT
Connection: close
Content-Type: application/json
Content-Length: 216
{
"id": "4004",
"iata": "BCN",
"cc": "ES",
"city": "Barcelona",
"lat": "41.2971",
"lon": "2.07846",
"name": "Josep Tarradellas Barcelona-El Prat Airport",
"type": "large_airport",
"emoji": "πŸ‡ͺπŸ‡Έ"
}

ENDPOINTS
All airportsd API endpoints are obtained via GET requests.

lookup
This endpoint expects iata query parameter with a case insensitive
3-letter IATA airport code; the key is looked up in the database and
the JSON data or HTTP status code 404 are returned.

OPTIONS
airportsd understands the following global options.

-v show version information and exit

ENVIRONMENT
AIRPORTSD_IP
optionally sets the listen address for airportsd; defaults to
127.0.0.1 and we strongly recommend this is not changed to
anything other than a loopback address.

AIRPORTSD_PORT
optionally sets the TCP listen port to something other than the
default 8812.

FILES
/usr/local/share/airports.cdb
the database file to query.

REQUIREMENTS
freebsd

$ pkg install libmicrohttpd tinycdb

$ cat > config.mk <

AUTHOR
Jan-Piet Mens

User Manuals AIRPORTSD(8)