Skip to content

sharpapi/php-utility-airports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SharpAPI GitHub cover

Utility Airports API for PHP

âš¡ Access global airports database - 30,000+ airports with filtering and flight duration calculator

Latest Version on Packagist Total Downloads

Check the full documentation on the Utility Airports API for PHP API page.


Quick Links

Resource Link
Main API Documentation Authorization, Webhooks, Polling & More
Postman Documentation View Docs
Product Details SharpAPI.com
SDK Libraries GitHub - SharpAPI SDKs

Requirements

  • PHP >= 8.0

Installation

Step 1. Install the package via Composer:

composer require sharpapi/php-utility-airports

Step 2. Visit SharpAPI to get your API key.


What it does

Access global airports database - 30,000+ airports with filtering and flight duration calculator

Note: This is a synchronous utility endpoint that returns data immediately (no async polling required).


Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use SharpAPI\UtilityAirports\AirportsClient;
use GuzzleHttp\Exception\GuzzleException;

$apiKey = 'your_api_key_here';
$client = new AirportsClient(apiKey: $apiKey);

try {
    // List airports
    $airports = $client->listAirports([
        'country' => 'US',
        'per_page' => 10
    ]);

    // Get specific airport by IATA
    $airport = $client->getAirportByIata('JFK');

    print_r($airport);
} catch (GuzzleException $e) {
    echo "API error: " . $e->getMessage();
}

Example Response

{
    "data": [
        {
            "id": "1ef266de-5a6c-67d6-86a1-06bb2780ed98",
            "icao": "00AA",
            "iata": "",
            "lid": "00AA",
            "name": "Aero B Ranch Airport",
            "city": "Leoti",
            "subdivision": "Kansas",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 3435,
            "latitude": 38.7,
            "longitude": -101.47
        },
        {
            "id": "1ef266de-5a8e-6f02-ba5c-06bb2780ed98",
            "icao": "00AK",
            "iata": "",
            "lid": "00AK",
            "name": "Lowell Field",
            "city": "Anchor Point",
            "subdivision": "Alaska",
            "country": "US",
            "timezone": "America/Anchorage",
            "elevation": 252,
            "latitude": 59.95,
            "longitude": -151.69
        },
        {
            "id": "1ef266de-5a93-63ae-b408-06bb2780ed98",
            "icao": "00AL",
            "iata": "",
            "lid": "00AL",
            "name": "Epps Airpark",
            "city": "Harvest",
            "subdivision": "Alabama",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 820,
            "latitude": 34.86,
            "longitude": -86.77
        },
        {
            "id": "1ef266de-5a97-6166-bced-06bb2780ed98",
            "icao": "00AN",
            "iata": "",
            "lid": "00AN",
            "name": "Katmai Lodge Airport",
            "city": "King Salmon",
            "subdivision": "Alaska",
            "country": "US",
            "timezone": "America/Anchorage",
            "elevation": 80,
            "latitude": 59.09,
            "longitude": -156.46
        },
        {
            "id": "1ef266de-5a9a-6578-b79f-06bb2780ed98",
            "icao": "00AR",
            "iata": "",
            "lid": "00AR",
            "name": "Arland Airport",
            "city": "Bennington",
            "subdivision": "Kansas",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 1352,
            "latitude": 38.97,
            "longitude": -97.6
        },
        {
            "id": "1ef266de-5a9d-6a5c-8cd4-06bb2780ed98",
            "icao": "00AS",
            "iata": "",
            "lid": "00AS",
            "name": "Fulton Airport",
            "city": "Alex",
            "subdivision": "Oklahoma",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 1100,
            "latitude": 34.94,
            "longitude": -97.82
        },
        {
            "id": "1ef266de-5aa0-6c5c-91b1-06bb2780ed98",
            "icao": "00CA",
            "iata": "",
            "lid": "00CA",
            "name": "Goldstone /Gts/ Airport",
            "city": "Barstow",
            "subdivision": "California",
            "country": "US",
            "timezone": "America/Los_Angeles",
            "elevation": 3038,
            "latitude": 35.35,
            "longitude": -116.89
        },
        {
            "id": "1ef266de-5aa3-6d80-a6d9-06bb2780ed98",
            "icao": "00CL",
            "iata": "",
            "lid": "00CL",
            "name": "Williams Ag Airport",
            "city": "Biggs",
            "subdivision": "California",
            "country": "US",
            "timezone": "America/Los_Angeles",
            "elevation": 87,
            "latitude": 39.43,
            "longitude": -121.76
        },
        {
            "id": "1ef266de-5aa6-681e-873c-06bb2780ed98",
            "icao": "00FA",
            "iata": "",
            "lid": "00FA",
            "name": "Grass Patch Airport",
            "city": "Bushnell",
            "subdivision": "Florida",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 53,
            "latitude": 28.65,
            "longitude": -82.22
        },
        {
            "id": "1ef266de-5aa9-683e-9f64-06bb2780ed98",
            "icao": "00FL",
            "iata": "",
            "lid": "00FL",
            "name": "River Oak Airport",
            "city": "Okeechobee",
            "subdivision": "Florida",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 35,
            "latitude": 27.23,
            "longitude": -80.97
        },
        {
            "id": "1ef266de-5aac-6624-ad2a-06bb2780ed98",
            "icao": "00GA",
            "iata": "",
            "lid": "00GA",
            "name": "Lt World Airport",
            "city": "Lithonia",
            "subdivision": "Georgia",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 700,
            "latitude": 33.77,
            "longitude": -84.07
        },
        {
            "id": "1ef266de-5aaf-6414-b9b6-06bb2780ed98",
            "icao": "00ID",
            "iata": "",
            "lid": "00ID",
            "name": "Delta Shores Airport",
            "city": "Clark Fork",
            "subdivision": "Idaho",
            "country": "US",
            "timezone": "America/Los_Angeles",
            "elevation": 2064,
            "latitude": 48.15,
            "longitude": -116.21
        },
        {
            "id": "1ef266de-5ab2-63da-9d73-06bb2780ed98",
            "icao": "00IG",
            "iata": "",
            "lid": "00IG",
            "name": "Goltl Airport",
            "city": "Mcdonald",
            "subdivision": "Kansas",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 3359,
            "latitude": 39.72,
            "longitude": -101.4
        },
        {
            "id": "1ef266de-5ab5-603a-8621-06bb2780ed98",
            "icao": "00IL",
            "iata": "",
            "lid": "00IL",
            "name": "Hammer Airport",
            "city": "Polo",
            "subdivision": "Illinois",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 840,
            "latitude": 41.98,
            "longitude": -89.56
        },
        {
            "id": "1ef266de-5ab7-6ed4-b9b7-06bb2780ed98",
            "icao": "00IS",
            "iata": "",
            "lid": "00IS",
            "name": "Hayenga's Cant Find Farms Airport",
            "city": "Kings",
            "subdivision": "Illinois",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 820,
            "latitude": 40.03,
            "longitude": -89.12
        },
        {
            "id": "1ef266de-5aba-6a1c-ae17-06bb2780ed98",
            "icao": "00KS",
            "iata": "",
            "lid": "00KS",
            "name": "Hayden Farm Airport",
            "city": "Gardner",
            "subdivision": "Kansas",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 1100,
            "latitude": 38.73,
            "longitude": -94.93
        },
        {
            "id": "1ef266de-5abd-6abe-80fb-06bb2780ed98",
            "icao": "00KY",
            "iata": "",
            "lid": "00KY",
            "name": "Robbins Roost Airport",
            "city": "Stanford",
            "subdivision": "Kentucky",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 1265,
            "latitude": 37.41,
            "longitude": -84.62
        },
        {
            "id": "1ef266de-5ac0-6782-acb9-06bb2780ed98",
            "icao": "00LS",
            "iata": "",
            "lid": "00LS",
            "name": "Lejeune Airport",
            "city": "Esterwood",
            "subdivision": "Louisiana",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 12,
            "latitude": 30.14,
            "longitude": -92.43
        },
        {
            "id": "1ef266de-5ac3-620c-9932-06bb2780ed98",
            "icao": "00MD",
            "iata": "",
            "lid": "00MD",
            "name": "Slater Field",
            "city": "Federalsburg",
            "subdivision": "Maryland",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 45,
            "latitude": 38.76,
            "longitude": -75.75
        },
        {
            "id": "1ef266de-5ac5-6f70-879b-06bb2780ed98",
            "icao": "00MN",
            "iata": "",
            "lid": "00MN",
            "name": "Battle Lake Municipal Airport",
            "city": "Battle Lake",
            "subdivision": "Minnesota",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 1365,
            "latitude": 46.3,
            "longitude": -95.7
        },
        {
            "id": "1ef266de-5ac8-6ad6-b894-06bb2780ed98",
            "icao": "00NC",
            "iata": "",
            "lid": "00NC",
            "name": "North Raleigh Airport",
            "city": "Louisburg",
            "subdivision": "North Carolina",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 348,
            "latitude": 36.09,
            "longitude": -78.37
        },
        {
            "id": "1ef266de-5acb-67f4-9d80-06bb2780ed98",
            "icao": "00NY",
            "iata": "",
            "lid": "00NY",
            "name": "Weiss Airfield",
            "city": "West Bloomfield",
            "subdivision": "New York",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 1000,
            "latitude": 42.9,
            "longitude": -77.5
        },
        {
            "id": "1ef266de-5ace-6968-8dfe-06bb2780ed98",
            "icao": "00OK",
            "iata": "",
            "lid": "00OK",
            "name": "Gull Bay Landing Airport",
            "city": "Sandsprings",
            "subdivision": "Oklahoma",
            "country": "US",
            "timezone": "America/Chicago",
            "elevation": 960,
            "latitude": 36.2,
            "longitude": -96.22
        },
        {
            "id": "1ef266de-5ad1-6906-8051-06bb2780ed98",
            "icao": "00PN",
            "iata": "",
            "lid": "00PN",
            "name": "Ferrell Field",
            "city": "Mercer",
            "subdivision": "Pennsylvania",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 1301,
            "latitude": 41.3,
            "longitude": -80.21
        },
        {
            "id": "1ef266de-5ad4-6660-bae6-06bb2780ed98",
            "icao": "00SC",
            "iata": "",
            "lid": "00SC",
            "name": "Flying O Airport",
            "city": "Sumter",
            "subdivision": "South Carolina",
            "country": "US",
            "timezone": "America/New_York",
            "elevation": 150,
            "latitude": 34.01,
            "longitude": -80.27
        }
    ],
    "links": {
        "first": "https://sharpapi.com/api/v1/airports?page=1",
        "last": "https://sharpapi.com/api/v1/airports?page=1128",
        "prev": null,
        "next": "https://sharpapi.com/api/v1/airports?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1128,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=6",
                "label": "6",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=7",
                "label": "7",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=8",
                "label": "8",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=9",
                "label": "9",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=10",
                "label": "10",
                "active": false
            },
            {
                "url": null,
                "label": "...",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=1127",
                "label": "1127",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=1128",
                "label": "1128",
                "active": false
            },
            {
                "url": "https://sharpapi.com/api/v1/airports?page=2",
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://sharpapi.com/api/v1/airports",
        "per_page": 25,
        "to": 25,
        "total": 28186
    }
}

Changelog

Please see CHANGELOG for more information on what has changed recently.


Credits


License

License: MIT

The MIT License (MIT). Please see License File for more information.


Social Media

🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:

About

SharpAPI PHP Client - php-utility-airports

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages