An API to gather information from JetPhotos and FlightRadar24.
See the documentation for query parameters.
Clone
git clone https://github.com/macsencasaus/jetapi.git
Then
go run ./cmd/api
Will automatically serve on port :8080.
For now, only one query string is available which is the registration of the aircraft under the /api
fixed path.
For example:
http://localhost:8080/api?reg=g-xlea
This will return information from both sites including images and prior flights for the aircraft with the registration g-xlea
!
Works best with commercial airliners. GA aircraft may cause JSON encoding errors due to the variability in FlightRadar's page. Registrations not found also return JSON encoding errors.
You may also specify the port using the -addr
flag:
go run ./cmd/api -addr=:4000
Will start the server on port 4000
.