code

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="http://code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
    <title>Nearest Airport </title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" type="text/css">
</head>

<body>
    <div class="container">
        <br>

        <h1>Nearest Airport</h1>

        <div class="table-responsive">
            <table class="table table-striped" id="table">
                <thead>
                    <tr>
						<th>Airport-Code</th>
						<th>Latitude</th>
						<th>Longitude</th>
						<th>Airport-Name</th>
						<th>Proximity</th>
						<th>City Code</th>
						<th>Country Code</th>
						<th>LocationType</th>
                    </tr>
                </thead>

                <tbody id="tbody">
                </tbody>
            </table>
        </div>
        <pre class="pre-scrollable">
		</pre>
    </div>
	<script type="text/javascript">
			
	    var host = 'api.lufthansa.com';
		var url = 'https://'+host+'/v1/references/airports/nearest/';

		var latitude = "51.5";
		var longitude = "-0.142";
		
		var bearer_token = "hpq47zn2b8mmn4p7hb3yuzqj";
		
		url += latitude + "," + longitude;

		(function doGet() {
			$.ajax({
				type: 'GET',
				url: url ,
				dataType: 'xml',
				headers: {
					accept: "application/xml",
					authorization:"Bearer "+bearer_token
				}
			}).done(function(data) {

				$("pre").text(data.documentElement.outerHTML);
				
				var airportSummary = data.getElementsByTagName('Airport');

				for (var i = 0; i < airportSummary.length; i++) {
		

					$("table").find('tbody').append($('<tr id=' + i + '>'));
					var row = document.getElementById(i);					

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('AirportCode')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('Latitude')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('Longitude')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('Name')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('Value')[0].childNodes[0].nodeValue;
					x.innerHTML += airportSummary[i].getElementsByTagName('UOM')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('CityCode')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('CountryCode')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = airportSummary[i].getElementsByTagName('LocationType')[0].childNodes[0].nodeValue;

				}
			})
		})()
    </script>
</body>
</html>
Offers Operations Reference Data oAuth