{"id":17714628,"url":"https://github.com/mrjackwills/adsbdb","last_synced_at":"2025-03-05T22:15:08.404Z","repository":{"id":47985809,"uuid":"490022966","full_name":"mrjackwills/adsbdb","owner":"mrjackwills","description":"public api for aircraft, airlines, \u0026 flightroutes","archived":false,"fork":false,"pushed_at":"2024-09-06T15:51:16.000Z","size":1112,"stargazers_count":121,"open_issues_count":15,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-09-06T18:54:11.684Z","etag":null,"topics":["adsbd","aircraft","async","axum","rust","tokio"],"latest_commit_sha":null,"homepage":"https://adsbdb.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrjackwills.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-08T18:22:47.000Z","updated_at":"2024-09-06T15:51:18.000Z","dependencies_parsed_at":"2024-10-22T21:54:19.971Z","dependency_job_id":null,"html_url":"https://github.com/mrjackwills/adsbdb","commit_stats":{"total_commits":405,"total_committers":1,"mean_commits":405.0,"dds":0.0,"last_synced_commit":"d96c2c34fe7c1123b5548f5d90ba84f25e62cb39"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fadsbdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fadsbdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fadsbdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fadsbdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrjackwills","download_url":"https://codeload.github.com/mrjackwills/adsbdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242108401,"owners_count":20072971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adsbd","aircraft","async","axum","rust","tokio"],"created_at":"2024-10-25T11:16:28.157Z","updated_at":"2025-03-05T22:15:08.370Z","avatar_url":"https://github.com/mrjackwills.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg src='./.github/logo.svg' width='125px'/\u003e\n\t\u003ch1 align=\"center\"\u003e\u003ca href='https://api.adsbdb.com' target='_blank' rel='noopener noreferrer'\u003eapi.adsbdb.com\u003c/a\u003e\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\tpublic aircraft, airline, and flightroute api\u003cbr\u003e\n\tBuilt in \u003ca href='https://www.rust-lang.org/' target='_blank' rel='noopener noreferrer'\u003eRust\u003c/a\u003e,\n\twith \u003ca href='https://github.com/tokio-rs/axum' target='_blank' rel='noopener noreferrer'\u003eaxum\u003c/a\u003e,\n\tfor \u003ca href='https://www.docker.com/' target='_blank' rel='noopener noreferrer'\u003eDocker\u003c/a\u003e,\n\tusing \u003ca href='https://www.postgresql.org/' target='_blank' rel='noopener noreferrer'\u003ePostgreSQL\u003c/a\u003e\n\t\u0026 \u003ca href='https://www.redis.io/' target='_blank' rel='noopener noreferrer'\u003eRedis\u003c/a\u003e \n\t\u003cbr\u003e\n\t\u003csub\u003e See typescript branch for original typescript version\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\n\tcheck \u003ca href='https://twitter.com/adsbdb' target='_blank' rel='noopener noreferrer'\u003eadsbdb twitter\u003c/a\u003e for any status updates,\n\tand please report any incorrect data to the \u003ca href=\"https://github.com/mrjackwills/adsbdb/issues/new/choose\" target='_blank' rel='noopener noreferrer'\u003eissues page\u003c/a\u003e, with the \u003cstrong\u003eData\u003c/strong\u003e tag.\n\t\u003cbr\u003e\n\tWith thanks to;\n\t\u003cli\u003e\n\t\t\u003ca href=\"http://planebase.biz/\" target='_blank' rel='noopener noreferrer'\u003ePlaneBase\u003c/a\u003e for the aircraft data.\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\tThe 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.\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003ca href=\"https://github.com/guillaumemichel/icao-nnumber_converter\" target='_blank' rel='noopener noreferrer'\u003eGuillaume Michel\u003c/a\u003e, for the icao to n-number conversion \n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003ca href='https://www.airport-data.com' target='_blank' rel='noopener noreferrer'\u003eairport-data\u003c/a\u003e for aircraft photographs\n\t\u003c/li\u003e\n\u003c/p\u003e\n\u003chr\u003e\n\n\n## GET Routes\n\n```https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S || REGISTRATION]```\n```json\n{\n\t\"response\":{\n\t\t\"aircraft\":{\n\t\t\t\"type\": string,\n\t\t\t\"icao_type\": string,\n\t\t\t\"manufacturer\": string,\n\t\t\t\"mode_s\": string,\n\t\t\t\"registration\": string,\n\t\t\t\"registered_owner_country_iso_name\": string,\n\t\t\t\"registered_owner_country_name\": string,\n\t\t\t\"registered_owner_operator_flag_code\": string || null,\n\t\t\t\"registered_owner\": string,\n\t\t\t\"url_photo\": string || null,\n\t\t\t\"url_photo_thumbnail\": string || null\n\t\t}\n\t}\n}\n\n```\n\nUnknown aircraft return status 404 with\n```json\n{ \"response\": \"unknown aircraft\"}\n```\n---\n\n\n```https://api.adsbdb.com/v[semver.major]/callsign/[CALLSIGN]```\n```json\n{\n\t\"response\": {\n\t\t\"flightroute\":{\n\t\t\t\"callsign\": string,\n\n\t\t\t\"callsign_icao\": string || null,\n\t\t\t\"callsign_iata\": string || null,\n\n\t\t\t\"airline\": {\n\t\t\t\t\"name\": string,\n\t\t\t\t\"icao\": string,\n\t\t\t\t\"iata\": string || null,\n\t\t\t\t\"country\": string,\n\t\t\t\t\"country_iso\": string,\n\t\t\t\t\"callsign\": string || null\n\t\t\t} || null,\n\n\t\t\t\"origin\": {\n\t\t\t\t\"country_iso_name\": string,\n\t\t\t\t\"country_name\": string,\n\t\t\t\t\"elevation\": number,\n\t\t\t\t\"iata_code\": string,\n\t\t\t\t\"icao_code\": string,\n\t\t\t\t\"latitude\": number,\n\t\t\t\t\"longitude\": number,\n\t\t\t\t\"municipality\": string,\n\t\t\t\t\"name\": string,\n\t\t\t},\n\n\t\t\t\"destination\": {\n\t\t\t\t\"country_iso_name\": string,\n\t\t\t\t\"country_name\": string,\n\t\t\t\t\"elevation\": number,\n\t\t\t\t\"iata_code\": string,\n\t\t\t\t\"icao_code\": string,\n\t\t\t\t\"latitude\": number,\n\t\t\t\t\"longitude\": number,\n\t\t\t\t\"municipality\": string,\n\t\t\t\t\"name\": string,\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nFor a small number of flightroutes, midpoints are also included\n```json\n\t{\n\t\t\"midpoint\": {\n\t\t\t\t\"country_iso_name\": string,\n\t\t\t\t\"country_name\": string,\n\t\t\t\t\"elevation\": number,\n\t\t\t\t\"iata_code\": string,\n\t\t\t\t\"icao_code\": string,\n\t\t\t\t\"latitude\": number,\n\t\t\t\t\"longitude\": number,\n\t\t\t\t\"municipality\": string,\n\t\t\t\t\"name\": string,\n\t\t\t}\n\t}\n```\n\nUnknown callsign return status 404 with\n```json\n{ \"response\": \"unknown callsign\"}\n```\n---\n\n```https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S || REGISTRATION]?callsign=[CALLSIGN]``` \n\n```json\n{\n\t\"response\": {\n\t\t\n\t\t\"aircraft\":{\n\t\t\t\"type\": string,\n\t\t\t\"icao_type\": string,\n\t\t\t\"manufacturer\": string,\n\t\t\t\"mode_s\": string,\n\t\t\t\"registration\": string,\n\t\t\t\"registered_owner_country_iso_name\": string,\n\t\t\t\"registered_owner_country_name\": string,\n\t\t\t\"registered_owner_operator_flag_code\": string || null,\n\t\t\t\"registered_owner\": string,\n\t\t\t\"url_photo\": string || null,\n\t\t\t\"url_photo_thumbnail\": string || null\n\t\t},\n\n\t\t\"flightroute\":{\n\t\t\t\"callsign\": string,\n\n\t\t\t\"callsign_icao\": string || null,\n\t\t\t\"callsign_iata\": string || null,\n\n\t\t\t\"airline\": {\n\t\t\t\t\"name\": string,\n\t\t\t\t\"icao\": string,\n\t\t\t\t\"iata\": string || null,\n\t\t\t\t\"country\": string,\n\t\t\t\t\"country_iso\": string,\n\t\t\t\t\"callsign\": string || null\n\t\t\t} || null,\n\n\t\t\t\"origin\": {\n\t\t\t\t\"country_iso_name\": string,\n\t\t\t\t\"country_name\": string,\n\t\t\t\t\"elevation\": number,\n\t\t\t\t\"iata_code\": string,\n\t\t\t\t\"icao_code\": string,\n\t\t\t\t\"latitude\": number,\n\t\t\t\t\"longitude\": number,\n\t\t\t\t\"municipality\": string,\n\t\t\t\t\"name\": string,\n\t\t\t},\n\n\t\t\t\"destination\": {\n\t\t\t\t\"country_iso_name\": string,\n\t\t\t\t\"country_name\": string,\n\t\t\t\t\"elevation\": number,\n\t\t\t\t\"iata_code\": string,\n\t\t\t\t\"icao_code\": string,\n\t\t\t\t\"latitude\": number,\n\t\t\t\t\"longitude\": number,\n\t\t\t\t\"municipality\": string,\n\t\t\t\t\"name\": string,\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nIf an unknown callsign is provided as a query param, but the aircraft is known, response will be status 200 with just aircraft\n\n---\n\n```https://api.adsbdb.com/v[semver.major]/airline/[AIRLINE_ICAO || AIRLINE_IATA ]```\n```json\n{\n\t\"response\":{\n\t\t[\n\t\t\t{\n\t\t\t\t\"name\": string,\n\t\t\t\t\"icao\": string,\n\t\t\t\t\"iata\": string || null,\n\t\t\t\t\"country\": string,\n\t\t\t\t\"country_iso\": string,\n\t\t\t\t\"callsign\": string || null\n\t\t\t},\n\t\t\t...\n\t\t]\n\t}\n}\n\n```\n\nUnknown airline return status 404 with\n```json\n{ \"response\": \"unknown airline\"}\n```\n---\n\nConvert from MODE-S string to N-Number string\n```https://api.adsbdb.com/v[semver.major]/mode-s/[MODE_S]```\n```json\n{ \"response\": string }\n\n```\n---\n\nConvert from N-Number string to Mode_S string\n```https://api.adsbdb.com/v[semver.major]/n-number/[N-NUMBER]```\n```json\n{ \"response\": string }\n\n```\n\n## PATCH Routes\n\nWhen `env.allow_update` and `env.argon_hash` are correctly set, and the PATCH request contains a valid `Authorization` header, Aircraft and Callsign can be modified.\n\n\n```https://api.adsbdb.com/v[semver.major]/aircraft/[MODE_S]```\n\n```\n\t{\n\t\t\"type\": string,\n\t\t\"icao_type\": string,\n\t\t\"manufacturer\": string,\n\t\t\"mode_s\": string,\n\t\t\"registration\": string,\n\t\t\"registered_owner_country_iso_name\": string,\n\t\t\"registered_owner_country_name\": string,\n\t\t\"registered_owner_operator_flag_code\": string || null,\n\t\t\"registered_owner\": string,\n\t\t\"url_photo\": string || null,\n\t\t\"url_photo_thumbnail\": string || null\n\t}\n```\nWarning: `mode_s`, `url_photo`, and `url_photo_thumbnail` cannot be modified.\n\n---\n\n```https://api.adsbdb.com/v[semver.major]/callsign/[CALLSIGN]```\n\n```\n\t{\n\t\t\"origin\": string,\n\t\t\"destination\": string\n\t}\n```\nWarning: Both `origin` and `destination` need to be valid ICAO airport codes.\n\n---\n\n## Download\n\nSee \u003ca href=\"https://github.com/mrjackwills/adsbdb/releases\" target='_blank' rel='noopener noreferrer'\u003ereleases\u003c/a\u003e\n\ndownload one liner\n\n```bash\nwget https://www.github.com/mrjackwills/adsbdb/releases/latest/download/adsbdb_linux_x86_64.tar.gz \u0026\u0026\ntar xzvf adsbdb_linux_x86_64.tar.gz adsbdb\n```\n\n### Run\n\nOperate docker compose containers via\n\n```bash\n./run.sh\n```\n\n\n### Build\n\n```bash\ncargo build --release\n```\n\u003cstrike\u003e\nBuild using \u003ca href='https://github.com/cross-rs/cross' target='_blank' rel='noopener noreferrer'\u003ecross\u003c/a\u003e, for x86_64 linux musl targets, in order to run in an Alpine based container\n\n```bash\ncross build --target x86_64-unknown-linux-musl --release\n```\n\u003c/strike\u003e\n\n\n\n## Tests\n\nRequires both postgres, seeded with data, and redis, operational\n\n```bash\n# Watch\ncargo watch -q -c -w src/ -x 'test  -- --test-threads=1 --nocapture'\n\n# Run all \ncargo test -- --test-threads=1 --nocapture\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjackwills%2Fadsbdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrjackwills%2Fadsbdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjackwills%2Fadsbdb/lists"}