{"id":20767758,"url":"https://github.com/dmnsgn/airports-data","last_synced_at":"2025-04-30T11:22:02.356Z","repository":{"id":57174978,"uuid":"152733624","full_name":"dmnsgn/airports-data","owner":"dmnsgn","description":"Airports data: static, dynamic and custom dump.","archived":false,"fork":false,"pushed_at":"2018-12-12T21:56:18.000Z","size":398,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T22:32:51.638Z","etag":null,"topics":["airport","airports","cli","data","database","json"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dmnsgn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-12T10:21:15.000Z","updated_at":"2023-04-29T13:28:58.000Z","dependencies_parsed_at":"2022-09-03T11:01:03.888Z","dependency_job_id":null,"html_url":"https://github.com/dmnsgn/airports-data","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fairports-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fairports-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fairports-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fairports-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmnsgn","download_url":"https://codeload.github.com/dmnsgn/airports-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251689009,"owners_count":21627815,"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":["airport","airports","cli","data","database","json"],"created_at":"2024-11-17T11:33:16.510Z","updated_at":"2025-04-30T11:22:02.334Z","avatar_url":"https://github.com/dmnsgn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# airports-data [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n[![npm version](https://badge.fury.io/js/airports-data.svg)](https://www.npmjs.com/package/airports-data)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nAirports data: static, dynamic and custom dump. Data from [OpenFlights Airports Database](https://openflights.org/data.html#airport).\n\n## Installation\n\n```bash\nnpm install airports-data\n```\n\n[![NPM](https://nodei.co/npm/airports-data.png)](https://nodei.co/npm/airports-data/)\n\n## Usage\n\n```js\nconst fs = require(\"fs\");\nconst getAirportsData = require(\"airports-data\");\n\nprocess.on(\"unhandledRejection\", err =\u003e {\n  console.error(err);\n  process.exit(1);\n});\n\nasync function dumpData() {\n  const data = await getAirportsData({\n    dynamic: true,\n    keys: [\"name\", \"iata\"]\n  });\n  fs.writeFileSync(\"airports.json\", JSON.stringify(data));\n}\n\ndumpData();\n```\n\n## API\n\n### `getAirportsData(options): Promise\u003cAirportData[]\u003e`\n\n| Option              | Type                 | Default   | Description                                                                                                                          |\n| ------------------- | -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| **options**         | object?              |           |                                                                                                                                      |\n| **options.dynamic** | boolean?             | false     | Request the latest data online.                                                                                                      |\n| **options.keys**    | string?[] \\| string? | undefined | Apply a simple filtering to the loaded data (both statically and dynamically). Array of strings or string with comma separated keys. |\n\n## CLI\n\n```\nUsage\n\t$ airports-data\n\nOptions\n\t--dynamic, -d  Get data from https://openflights.org/data.html#airport instead of the local dump [Default: false]\n\t--keys, -k  Keys to include [Default:\n\t\tid\n\t\tname\n\t\tcity\n\t\tcountry\n\t\tiata\n\t\ticao\n\t\tlatitude\n\t\tlongitude\n\t\taltitude\n\t\ttimezone\n\t\tdst\n\t\ttz\n\t\ttype\n\t\tsource\n\t]\n\nExamples\n\t$ airports-data\n\t[..., {\"id\":1382,\"name\":\"Charles de Gaulle International Airport\",\"city\":\"Paris\",\"country\":\"France\",\"iata\":\"CDG\",\"icao\":\"LFPG\",\"latitude\":49.0127983093,\"longitude\":2.54999995232,\"altitude\":392,\"timezone\":1,\"dst\":\"E\",\"tz\":\"Europe/Paris\",\"type\":\"airport\",\"source\":\"OurAirports\"}, ...]\n\t$ airports-data --keys name,iata\n\t[..., {\"name\":\"Charles de Gaulle International Airport\",\"iata\":\"CDG\"}, ...]\n```\n\n## Data\n\n| Key       | Description                                                                                                                                                                      |\n| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| id        | Unique OpenFlights identifier for this airport.                                                                                                                                  |\n| name      | Name of airport. May or may not contain the City name.                                                                                                                           |\n| city      | Main city served by airport. May be spelled differently from Name.                                                                                                               |\n| country   | Country or territory where airport is located. See countries.dat to cross-reference to ISO 3166-1 codes.                                                                         |\n| iata      | 3-letter IATA code. null if not assigned/unknown.                                                                                                                                |\n| icao      | 4-letter ICAO code. null if not assigned.                                                                                                                                        |\n| latitude  | Decimal degrees, usually to six significant digits. Negative is South, positive is North.                                                                                        |\n| longitude | Decimal degrees, usually to six significant digits. Negative is West, positive is East.                                                                                          |\n| altitude  | In feet.                                                                                                                                                                         |\n| timezone  | Hours offset from UTC. Fractional hours are expressed as decimals, eg. India is 5.5.                                                                                             |\n| dst       | Daylight savings time. One of E (Europe), A (US/Canada), S (South America), O (Australia), Z (New Zealand), N (None) or U (Unknown).                                             |\n| tz        | Timezone in \"tz\" (Olson) format, eg. \"America/Los_Angeles\".                                                                                                                      |\n| type      | Type of the airport. Value \"airport\" for air terminals, \"station\" for train stations, \"port\" for ferry terminals and \"unknown\" if not known.                                     |\n| source    | Source of this data. \"OurAirports\" for data sourced from OurAirports, \"Legacy\" for old data not matched to OurAirports (mostly DAFIF), \"User\" for unverified user contributions. |\n\n## License\n\nMIT. See [license file](https://github.com/dmnsgn/airports-data/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fairports-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmnsgn%2Fairports-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fairports-data/lists"}