I have worked it out by looking at the code of the VACENTRAL Module without installing it with Composer
the code is as follows -: YOU MUST USE A VAILD API KEY and not the ‘ZZZZZZZZZZZZZZZ’
<?php
/**
* Class and Function List:
* Function list:
* Classes list:
*/
/** \file vacentral.php
* \brief Text getting data from Vacentral using Curl
* \details This Script is used tinstead of Composer installation
* \author Leslie Jarrett
* \version 1.0
* \date 2025
* \copyright 2025 Leslie Jarrett
*/
//
// GET AIRPORT INFORMATION FROM VACENTRAL
//
// The following URl string is required to get Airport Information
//
// https://api.vacentral.net/api/airports/[ICAO]?apiKey=[API_KEY]
//
// Where you replace [ICAO] with the Airport code you want to get data forr
//
// and replace [API_KEY] with your user API Key string
//
// Below is a worked example for the airport EGEW
// Using my own API KEY which is then hidden from the code
//
// set up your API KEY
//
$ApiKey = ‘zzzzzzzzzzzzzzzzzzzzzzzzzzz’;
//
// set up the Airport ICAO code
//
$AirportIcao = ‘EGEW’;
//
// set up the first part of the CURL URl
//
$AirportApiUrl = ‘https://api.vacentral.net/api/airports/’;
//
// add in the Airport Icao Code
//
$AirportApiUrl = $AirportApiUrl.$AirportIcao;
//
// add in the API Key
//
$AirportApiUrl = $AirportApiUrl.‘?apiKey=’.$ApiKey;
//
// now process the call to the API using Curl
//
// set the api curl handle
//
$AirportApiHandle = curl_init();
//
// Will return the response, if false it prints the response
//
curl_setopt($AirportApiHandle, CURLOPT_RETURNTRANSFER, true);
//
// Set the url
//
curl_setopt($AirportApiHandle, CURLOPT_URL,$AirportApiUrl);
//
// Execute the session and store the contents in $AirporApiRaw
//
$AirporApiRaw =curl_exec($AirportApiHandle,);
//
// Closing the session
//
curl_close($AirportApiHandle);
//
// upack the Json data to PHP array
//
$AirportData = json_decode($AirporApiRaw, true);
//
// the array $AirportData wwill have the following fields
//
// array(10) {
// [“icao”]=>
// string(4) “EGEW”
// [“iata”]=>
// string(3) “WRY”
// [“name”]=>
// string(15) “Westray Airport”
// [“city”]=>
// string(7) “Westray”
// [“country”]=>
// string(2) “GB”
// [“region”]=>
// string(6) “GB-SCT”
// [“tz”]=>
// string(13) “Europe/London”
// [“elevation”]=>
// int(29)
// [“lat”]=>
// float(59.3502998352)
// [“lon”]=>
// float(-2.9500000477)
// }
?>