Welcome to the official documentation for the Airport API! This API provides detailed information on airports and airlines in India, such as airport codes, locations, types, and airlines operating in India.
Base URL: https://aerokey-api.vercel.app
Author: Abhishek Jain
Request:
GET /v1/airports
Response:
{ "total": 1000, "airports": [...], "message": "Success", "status": 200 }
This endpoint retrieves a list of all airports.
Request:
GET /v1/airports/code/:code
Response:
{ "airport_code": "DEL", "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "state_name": "Delhi", "airport_type": "International", "pincode": "110037", "state_code": "DL", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airport not found", "status": 404 }
This endpoint allows you to retrieve information for a specific airport by its airport code.
Request:
GET /v1/airports/name/:name
Response:
{ "airport_code": "DEL", "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "state_name": "Delhi", "airport_type": "International", "pincode": "110037", "state_code": "DL", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airport not found", "status": 404 }
This endpoint allows you to retrieve information for a specific airport by its name.
Request:
GET /v1/airports/city/:city
Response:
{ "airport_code": "DEL", "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "state_name": "Delhi", "airport_type": "International", "pincode": "110037", "state_code": "DL", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airport not found", "status": 404 }
This endpoint allows you to retrieve information for a specific airport by its city.
Request:
GET /v1/airports/state/:state
Response:
[ { "airport_code": "BOM", "airport_name": "Chhatrapati Shivaji Maharaj International Airport", "city_name": "Mumbai", "state_name": "Maharashtra", "airport_type": "International", "pincode": "400099", "state_code": "MH", "message": "Success", "status": 200 }, ... ]
Error Message (if no airports found):
{ "message": "No airports found in this state", "status": 404 }
This endpoint allows you to retrieve airports in a specific state.
Request:
GET /v1/airports/pincode/:pincode
Response:
{ "airport_code": "BLR", "airport_name": "Kempegowda International Airport", "city_name": "Bengaluru", "state_name": "Karnataka", "airport_type": "International", "pincode": "560300", "state_code": "KA", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airport not found", "status": 404 }
This endpoint allows you to retrieve information for a specific airport by its pincode.
Request:
GET /v1/airports/statecode/:statecode
Response:
[ { "airport_code": "DEL", "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "state_name": "Delhi", "airport_type": "International", "pincode": "110037", "state_code": "DL", "message": "Success", "status": 200 }, ... ]
Error Message (if no airports found):
{ "message": "No airports found for this state code", "status": 404 }
This endpoint allows you to retrieve airports in a specific state code.
Request:
GET /v1/airports/airporttype/:airporttype
Response:
[ { "airport_code": "DEL", "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "state_name": "Delhi", "airport_type": "International", "pincode": "110037", "state_code": "DL", "message": "Success", "status": 200 }, ... ]
Error Message (if no airports found):
{ "message": "No airports found", "status": 404 }
This endpoint allows you to retrieve airports based on their type (e.g., International, Domestic).
Request:
GET /v1/airlines
Response:
{ "airlines": [...] }
This endpoint retrieves a list of all airlines.
Request:
GET /v1/airlines/code/:iata
Response:
{ "iata_code": "AI", "airline_name": "Air India", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airline not found", "status": 404 }
This endpoint allows you to retrieve an airline's information by its IATA code.
Request:
GET /v1/airlines/name/:name
Response:
{ "iata_code": "AI", "airline_name": "Air India", "message": "Success", "status": 200 }
Error Message (if not found):
{ "message": "Airline not found", "status": 404 }
This endpoint allows you to retrieve an airline's information by its name.