This is an unofficial PHP SDK for the Skyscanner API to support Flights, Car Hire, Hotels, Localisation, and Places services.
Currently, all of the services are implemented. Also tested all off the services except the Hotels one since could not find any valid API keys, and had no luck with contacting anyone from Skyscanner.
Via Composer
$ composer require ozdemirburak/skyscanner-php
For PHP 7.0 and below, use ~1.0
instead.
Please see the wiki for more detailed information about the methods and the parameters.
You can find a simple demonstration of how to use the methods below, or check the tests for more advanced examples.
use OzdemirBurak\SkyScanner\Travel\Flights\LivePricing;
$pricing = new LivePricing($apiKey = 'your-api-key');
$pricing->setParameters([
'adults' => 1,
'country' => 'GB',
'currency' => 'GBP',
'destinationPlace' => 'IST',
'locale' => 'en-GB',
'originPlace' => 'LHR',
'outboundDate' => date('Y-m-d', strtotime('+1 week')),
'stops' => 0
]);
$flights = $pricing->getFlights($onlyFirstAgentPerItinerary = true);
use OzdemirBurak\SkyScanner\Travel\Flights\BrowseCache;
$cache = new BrowseCache($apiKey = 'your-api-key');
$cache->setParameters([
'country' => 'TR',
'currency' => 'TRY',
'destinationPlace' => 'IST',
'locale' => 'tr-TR',
'originPlace' => 'LHR',
'outboundPartialDate' => date('Y-m-d', strtotime('+1 week')),
]);
$quotes = $cache->getPrices()['Quotes'];
use OzdemirBurak\SkyScanner\Travel\CarHire\LivePricing;
$pricing = new LivePricing($apiKey = 'your-api-key');
$pricing->setParameters([
'country' => 'GB',
'currency' => 'GBP',
'dropoffplace' => 'ADB',
'dropoffdatetime' => date('Y-m-d\TH:i', strtotime('+2 week')),
'locale' => 'en-GB',
'pickupplace' => 'IST',
'pickupdatetime' => date('Y-m-d\TH:i', strtotime('+1 week')),
'driverage' => 21
]);
$cars = $pricing->getCars();
use OzdemirBurak\SkyScanner\Travel\Hotels\LivePricing;
$pricing = new LivePricing($apiKey = 'your-api-key');
$pricing->setParameters([
'country' => 'TR',
'currency' => 'TRY',
'entity_id' => 27544008,
'checkin_date' => date('Y-m-d', strtotime('+1 week')),
'checkout_date' => date('Y-m-d', strtotime('+2 week')),
'locale' => 'tr-TR'
]);
$hotels = $pricing->getHotels();
use OzdemirBurak\SkyScanner\Localisation\Currency;
$currency = new Currency($apiKey = 'your-api-key');
$currencies = $currency->get();
use OzdemirBurak\SkyScanner\Localisation\Locale;
$locale = new Locale($apiKey = 'your-api-key');
$locales = $locale->get();
use OzdemirBurak\SkyScanner\Localisation\Market;
$market = new Market($apiKey = 'your-api-key'));
$market->setLocale('en-GB');
$countries = $market->get();
use OzdemirBurak\SkyScanner\PlacesService;
$places = new PlacesService($apiKey = 'your-api-key');
$geoCatalog = $places->get();
$list = $places->getList('UK', 'GBP', 'en-GB', 'istanbul');
$information = $places->getInformation('UK', 'GBP', 'en-GB', 'CDG-sky');
$hotels = $places->getHotels('UK', 'EUR', 'en-GB', 'paris');
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.