
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
wikipedia-airport-scraper
Advanced tools
Get airport codes and flight connections from Wikipedia airport pages
A small Node.js script to scrape info about airports and their destinations from Wikipedia pages. When provided with the full HTML of any airport page on the English language Wikipedia, it will extract:
It is left to any script that uses this to:
en.wikipedia.org pages, grab responses and rate limit those requests where necessaryRight now, this script doesn't provide any way to look up basic data found on airline pages and as such can't help you to link names to codes. Sunch functionality might be added in the future.
Here's a very simple example that gets data for Brussels Airport from the wikipedia url:
import got from 'got' // Or any other package that requests a HTML page
import write from 'write' // Or any other package that writes data to a local file
import scrape from 'wikipedia-airport-scraper'
// Get the HTML from the page and pass it to the script
const data = await got('https://en.wikipedia.org/wiki/Brussels_Airport').then((response) => scrape(response.body))
// Write out the scraped data
const outputPath = new URL('./data.json', import.meta.url).pathname
await write(outputPath, JSON.stringify(data, null, 2))
The data (simplified to show only one airline and one destination) then looks like this:
{
"name": "Brussels Airport",
"iataCode": "BRU",
"icaoCode": "EBBR",
"coordinates": {
"latitude": 50.901389,
"longitude": 4.484444
},
"flights": [
{
"airline": {
"name": "Aegean Airlines",
"link": "Aegean_Airlines"
},
"destination": {
"shortName": "Athens",
"fullName": "Athens International Airport",
"link": "Athens_International_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
It's obvious but probably deserves to be said: the output of this script can only be as good as the Wikipedia page that it uses as input. YMMV.
Two different but related airlines might be mapped to the same link (and ultimately IATA code) by Wikipedia. Here's part of the output from Kansai International Airport that shows All Nippon Airways and ANA Wings with a different name but the same link, in this case serving the same route. For now, the script will not recognise this as a duplicate.
{
"flights": [
{
"airline": {
"name": "All Nippon Airways",
"link": "All_Nippon_Airways"
},
"destination": {
"shortName": "Naha",
"fullName": "Naha Airport",
"link": "Naha_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
},
{
"airline": {
"name": "ANA Wings",
"link": "All_Nippon_Airways"
},
"destination": {
"shortName": "Naha",
"fullName": "Naha Airport",
"link": "Naha_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
null as will the fullName field. Here's part of the output from Ignatyevo Airport that shows Zeya as a destination airport with no Wikipedia page to link to:{
"flights": [
{
"airline": {
"name": "Angara Airlines",
"link": "Angara_Airlines"
},
"destination": {
"shortName": "Zeya",
"fullName": null,
"link": null,
"isCharter": false,
"isSeasonal": true,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
FAQs
Get airport codes and flight connections from Wikipedia airport pages
We found that wikipedia-airport-scraper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.