GithubHelp home page GithubHelp logo

abhyuditjain / adsbdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrjackwills/adsbdb

0.0 1.0 0.0 512 KB

public aircraft & flightroute api

Home Page: https://adsbdb.com

License: MIT License

Shell 9.97% JavaScript 0.51% Rust 80.42% HTML 5.12% Dockerfile 3.99%

adsbdb's Introduction

public aircraft & flightroute api

Built in Rust for Docker, using PostgreSQL & Redis
See typescript branch for original typescript version


Please report any incorrect data to the issues page, with the Data tag.

With thanks to;

  • PlaneBase for the aircraft data.
  • The flight route data is the work of David Taylor, Edinburgh and Jim Mason, Glasgow, and may not be copied, published, or incorporated into other databases without the explicit permission of David J Taylor, Edinburgh.
  • Guillaume Michel, for the icao to n-number conversion

  • Routes

    https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S]

    {
    	"response":{
    		"aircraft":{
    			"type": string,
    			"icao_type": string,
    			"manufacturer": string,
    			"mode_s": string,
    			"n_number": string,
    			"registered_owner_country_iso_name": string,
    			"registered_owner_country_name": string,
    			"registered_owner_operator_flag_code": string,
    			"registered_owner": string,
    			"url_photo":string || null,
    			"url_photo_thumbnail":string || null
    		}
    	}
    }
    

    Unknown aircraft return status 404 with

    { "response": "unknown aircraft"}

    Convert from MODE-S string to N-Number string https://api.adsbdb.com/v[semver.major]/mode-s/[MODE_S]

    {
    	"response": string
    }
    

    Convert from N-Number string to Mode_S string https://api.adsbdb.com/v[semver.major]/n-number/[N-NUMBER]

    {
    	"response": string
    }
    

    https://api.adsbdb.com/v[semver.major]/callsign/[CALLSIGN]

    {
    	"response": {
    		"flightroute":{
    			"callsign": string,
    			"origin_airport_country_iso_name": string,
    			"origin_airport_country_name": string,
    			"origin_airport_elevation": number,
    			"origin_airport_iata_code": string,
    			"origin_airport_icao_code": string,
    			"origin_airport_latitude": number,
    			"origin_airport_longitude": number,
    			"origin_airport_municipality": string,
    			"origin_airport_name": string,
    
    			"destination_airport_country_iso_name": string,
    			"destination_airport_country_name": string,
    			"destination_airport_elevation": number,
    			"destination_airport_iata_code": string,
    			"destination_airport_icao_code": string,
    			"destination_airport_latitude": number,
    			"destination_airport_longitude": number,
    			"destination_airport_municipality": string,
    			"destination_airport_name": string
    		}
    	}
    }

    For a small number of flightroutes, midpoints are also included

    {
    	"midpoint_airport_country_iso_name": string,
    	"midpoint_airport_country_name": string,
    	"midpoint_airport_elevation": number,
    	"midpoint_airport_iata_code": string,
    	"midpoint_airport_icao_code": string,
    	"midpoint_airport_latitude": number,
    	"midpoint_airport_longitude": number,
    	"midpoint_airport_municipality": string,
    	"midpoint_airport_name": string
    }

    Unknown callsign return status 404 with

    { "response": "unknown callsign"}

    https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S]?callsign=[CALLSIGN]

    {
    	"response": {
    		"aircraft":{
    			"type": string,
    			"icao_type": string,
    			"manufacturer": string,
    			"mode_s": string,
    			"n_number": string,
    			"registered_owner_country_iso_name": string,
    			"registered_owner_country_name": string,
    			"registered_owner_operator_flag_code": string,
    			"registered_owner": string,
    			"url_photo":string || null,
    			"url_photo_thumbnail":string || null
    		},
    		"flightroute":{
    			"callsign": string,
    			"origin_airport_country_iso_name": string,
    			"origin_airport_country_name": string,
    			"origin_airport_elevation": number,
    			"origin_airport_iata_code": string,
    			"origin_airport_icao_code": string,
    			"origin_airport_latitude": number,
    			"origin_airport_longitude": number,
    			"origin_airport_municipality": string,
    			"origin_airport_name": string,
    			"destination_airport_country_iso_name": string,
    			"destination_airport_country_name": string,
    			"destination_airport_elevation": number,
    			"destination_airport_iata_code": string,
    			"destination_airport_icao_code": string,
    			"destination_airport_latitude": number,
    			"destination_airport_longitude": number,
    			"destination_airport_municipality": string,
    			"destination_airport_name": string
    		}
    	}
    }

    If an unknown callsign is provided as a query param, but the aircraft is known, response will be status 200 with just aircraft


    Download

    See releases

    download (x86_64_musl one liner)

    wget https://www.github.com/mrjackwills/adsbdb/releases/latest/download/adsbdb_linux_x86_64_musl.tar.gz &&
    tar xzvf adsbdb_linux_x86_64_musl.tar.gz adsbdb

    Run

    Operate docker compose containers via

    ./run.sh

    Tests

    Requires postgres & redis to both be operational and seeded with valid data

    # Watch
    cargo watch -q -c -w src/ -x 'test  -- --test-threads=1 --nocapture'
    
    # Run all 
    cargo test -- --test-threads=1 --nocapture

    adsbdb's People

    Contributors

    mrjackwills avatar

    Watchers

    James Cloos avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.