Building a Request

Our API is a collection of 'RESTful' web services. You interact with our resources by sending an HTTP message to a URL. The URL determines the resource and the HTTP method defines the type of action.

URLs

All URLs conform to this pattern:

Code snippet: URL pattern

https://{hostname} /{version} /{area} /{root resource name} [/{resource key}] [/{sub-resource name} [/{sub-resource key}]* ][?{option_key}={option_value}]
URL component Explanation
hostname The hostname determines whether you access the test or production environment
Test:  api-test.lufthansa.com
Production: api.lufthansa.com
version New versions of services may be introduced with additional features. The version number allows you to select a particular service version.
area The API is separated into 'resource areas'
  • References
  • Operations
  • Offers
  • Orders
  • Profiles
  • Fulfillments
root resource name The desired resource, generally a plural-form noun representing a class of object (e.g. ‘airports’)
resource key A particular instance of the root resource, for example the airport 'FRA' (Frankfurt).
sub-resource name Sometimes a root resource is split into smaller components or different views. These are sub-resources. For example, flightstatus has the subresources arrivals, departures, and city pairs.
sub-resource key The key to a particular instance of a sub-resource.
option_key
option_value
Some methods allow further restrictions on the dataset with query parameters. These take the form of a key-value pair, for example lang=en.

HTTP method

The HTTP method (GET, PUT, POST, DELETE) defines what you want to do with the resource. Currently only the GET method is supported.

Access Token

Access to our resources is controlled by authorization tokens. You must send a valid token in the http authorization header with every request.

Code snippet: Curl

curl -H "Authorization: Bearer b2d5h7n4chvpun2f4pu7jh36" -H "Accept: application/xml" https://api.lufthansa.com/v1/references/airports/FRA

Visit our API Playground (io/docs) to try some real examples.