Guides

How to use apikey

You need to use the apikey to autheticate your application when calling APIs. Here's guide on how to get the apikey generated for you.

Now, let's get the apikey and use it to perform some actual requests.

Navigate to MyApps and click on your app to expand its details. Under property Consumer Key you'll see your apikey which you should use to authenticate your app. Copy it to a clipboard.

When working with RESTful services you can use a number of tools, like cURL, Postman etc. Here we'll describe how to request data with the apikey using built in interactive documentation as well as make the same requests with cURL. The request we are going to describe is getting list of all available airports.

 

Navigate to APIs page. This is the home page for all the documentation. Here is some short description on each API:

  • Core API - endpoints with core fuctionality like get list of all airports, cities, countries, currencies, routes etc.
  • Discount API - returns available discounts
  • Geolocation API - enables geolocation functionality, like get default airport based on IP address, get default nationality etc.
  • Farefinder API - you can use it to find the cheapest connections between airports.
  • Timetable API - use it to get information about scheduled flights, schedule period etc. 
  • Flightinfo API - returns detailed information about flights status at current day
  • Aggregate API - use it to get aggregated data from other APIs (Core and Geolocation) in one call

 

We'll be looking for all airports enepoint - this can be found in Core API.
What you see here is the whole list of available endpoints in the API. Notice all endpoints have meaningful name and helpful description. Click on getAirports.  

Your documentation page should look similar to this. Please notice endpoint's detailed description about parameters, security, content type etc. Before you send this reqeust you need to insert you API Key to authenticate yourself. Plece where you can do this was marked with a red box. Click on it.

Fill the form with following values:

- Name: apikey
- Value: your Consumer Key value that was copied to the clipboard
- Select Query option and click OK.

Now when everything is ready you can click on Send this request button and admire the results - list of all available airports. Congratulations, you've just performed your first request. You can see what happen behind the scenes by clicking on tab cURL

curl -X GET "https://apigateway.ryanair.com/pub/v1/core/3/airports?apikey={apikey}"

Notice that tool for testing the endpoint has added your apikey in query as a parameter.

You can go ahead and run this command in your command line. Now let's see some interesting information returned by the endpoint:

[
  {
    "iataCode": "HAU",
    "name": "Haugesund",
    "seoName": "haugesund",
    "coordinates": {
      "longitude": 5.20836,
      "latitude": 59.3453
    },
    "base": false,
    "countryCode": "no",
    "regionCode": "HAUSGESUND",
    "cityCode": "HAUGESUND",
    "currencyCode": "NOK",
    "routes": [
      "airport:AGP",
      "city:MALAGA",
      "airport:ALC",
      "country:es",
      "city:BENIDORM",
      "region:COSTA_BLANCA",
      "region:COSTA_DE_SOL"
    ],
    "seasonalRoutes": [],
    "categories": [
      "FAM",
      "FST",
      "CUL"
    ],
    "priority": 162
  },
...
}

Please read trough the JSON object. Important property for a developer is iataCode - three letter airport code. This code is used in API calls to identify an airport.

Where to go next?

Go to example of getting information about flights schedules - How to use Timetable API