Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Localisation

Burak Ozdemir edited this page May 26, 2017 · 2 revisions

All Skyscanner services are localised by market, language and currency, so these three parameters must be added to every request.

To get currencies,

use OzdemirBurak\SkyScanner\Localisation\Currency;

$currency = new Currency($apiKey = 'your-api-key');
$currencies = $currency->get();

It will return data something like below.

array:154 [
  0 => {#313
    +"Code": "AED"
    +"Symbol": "د.إ.‏"
    +"ThousandsSeparator": ","
    +"DecimalSeparator": "."
    +"SymbolOnLeft": true
    +"SpaceBetweenAmountAndSymbol": true
    +"RoundingCoefficient": 0
    +"DecimalDigits": 2
  }
  ...
]

To get locales,

use OzdemirBurak\SkyScanner\Localisation\Locale;

$locale = new Locale($apiKey = 'your-api-key');
$locales = $locale->get();

It will return data something like below.

array:43 [
  0 => {#313
    +"Code": "ar-AE"
    +"Name": "العربية (الإمارات العربية المتحدة)"
  }
  ...
]

To get markets,

use OzdemirBurak\SkyScanner\Localisation\Market;

$market = new Market($apiKey = 'your-api-key', $locale = 'en-GB'));
$countries = $market->get();

It will return data something like below.

array:233 [
  0 => {#313
    +"Code": "AD"
    +"Name": "Andorra"
  }
  ...
]

For more information, you can check the official documentation.

Clone this wiki locally