diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..92efddfc --- /dev/null +++ b/404.html @@ -0,0 +1,1524 @@ + + + + + + + + + + + + + + + + + + + + + + + Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/API-Keys/authorization/index.html b/API-Keys/authorization/index.html new file mode 100644 index 00000000..f81e0d4c --- /dev/null +++ b/API-Keys/authorization/index.html @@ -0,0 +1,1910 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Authorization - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Authorizing your application

+

Amadeus for Developers uses OAuth to authenticate access requests. OAuth generates an access token which grants the client permission to access a protected resource.

+

The method to acquire a token is called grant. There are different types of OAuth grants. Amadeus for Developers uses the Client Credentials Grant.

+

Requesting an access token

+

Once you have created an app and received your API Key and API Secret, you can generate an access token by sending a POST request to the authorization server:

+

https://test.api.amadeus.com/v1/security/oauth2/token/

+
+

Information

+

Remember that your API Key and API Secret should be kept private. Read more about best practices for secure API key storage.

+
+

The body of the request is encoded as x-www-form-urlencoded, where the keys and values are encoded in key-value tuples separated by '&', with a '=' between +the key and the value:

+ + + + + + + + + + + + + + + + + + + + + +
KeyValue
grant_typeThe value client_credentials
client_idThe API Key for the application
client_secretThe API Secret for the application
+

Specify the type of the request using the content-type HTTP header with the value application/x-www-form-urlencoded.

+

The following example uses cURL to request a new token:

+

1
+2
+3
curl "https://test.api.amadeus.com/v1/security/oauth2/token" \
+     -H "Content-Type: application/x-www-form-urlencoded" \
+     -d "grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}"
+
+Note that the -X POST parameter is not needed in the cURL command. As we are sending a body, cURL sends the request as POST automatically.

+

Response

+

The authorization server will respond with a JSON object:

+

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
{
+    "type": "amadeusOAuth2Token",
+    "username": "foo@bar.com",
+    "application_name": "BetaTest_foobar",
+    "client_id": "3sY9VNvXIjyJYd5mmOtOzJLuL1BzJBBp",
+    "token_type": "Bearer",
+    "access_token": "CpjU0sEenniHCgPDrndzOSWFk5mN",
+    "expires_in": 1799,
+    "state": "approved",
+    "scope": ""
+}
+
+The response will contain the following parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
typeThe type of resource. The value will be amadeusOAuth2Token.
usernameYour username (email address).
application_nameThe name of your application.
client_idThe API Key for your application
token_typeThe type of token issued by the authentication server. The value will be Bearer.
access_tokenThe token to authenticate your requests.
expires_inThe number of seconds until the token expires.
stateThe status of your request. Values can be approved or expired.
+

Using the token

+

Once the token has been retrieved, you can authenticate your requests to Amadeus Self-Service APIs.

+

Each API call must contain the authorization HTTP header with the value Bearer {access_token}, where acess_token is the token you have just retrieved.

+

The following example is a call to the Flight Check-in Links API to retrieve the check-in URL for Iberia (IB):

+
1
+2
curl "https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airline=IB" \
+     -H "Authorization: Bearer CpjU0sEenniHCgPDrndzOSWFk5mN"
+
+

Managing tokens from your source code

+

To retrieve a token using your favourite programming language, send a POST request and parse the JSON response as in the cURL examples above.

+

There are different strategies to maintain your token updated, like checking the time remaining until expiration before each API call or capturing the unauthorized error when the token expires. In both cases, you must request a new token.

+

To simplify managing the authentication process, you can use the Amadeus for Developers SDKs available on GitHub. The SDKs +automatically fetch and store the access_token and set the headers in all API +calls.

+

Example of initializing the client and authenticating with the Node SDK:

+
1
+2
+3
+4
+5
+6
var Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: '[API Key]',
+  clientSecret: '[API Secret]'
+});
+
+

You can then call the API. The following example is a call to the Flight Check-in Links API to retrieve the check-in URL for Iberia (IB):

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: '[API Key]',
+  clientSecret: '[API Secret]'
+});
+
+amadeus.referenceData.urls.checkinLinks.get({
+  airlineCode : 'IB'
+}).then(function(response){
+  console.log(response.data);
+}).catch(function(responseError){
+  console.log(responseError.code);
+});
+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/API-Keys/index.html b/API-Keys/index.html new file mode 100644 index 00000000..a69e2c7e --- /dev/null +++ b/API-Keys/index.html @@ -0,0 +1,1642 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + API keys - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

API keys

+

To start working with our Self-Service APIs, you need to register your application with us to obtain API keys. In this section we describe how to authorize your application and move it to production.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/API-Keys/moving-to-production/index.html b/API-Keys/moving-to-production/index.html new file mode 100644 index 00000000..19cf3d98 --- /dev/null +++ b/API-Keys/moving-to-production/index.html @@ -0,0 +1,1882 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Production - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Moving your application to production

+

When your application is ready to be deployed to the Real World™, you can request your Production Key and access the Production Environment.

+

Requesting a production key

+

To request a production key, you must complete the following steps:

+
    +
  1. Sign in to your account and enter My Self-Service Workspace.
  2. +
  3. Select the application to move to Production and click Get Production environment :
  4. +
+

request_prod

+
    +
  1. Complete the form with your personal information, billing address, and app information.
  2. +
  3. Indicate whether your application uses Flight Create Orders in the checkbox at the bottom of the form. This API has special access requirements detailed below in the Moving to Production with Flight Create Orders section of this guide.
  4. +
  5. Select your preferred method of payment (credit card or bank transfer) and provide the required billing information.
  6. +
  7. Sign the Terms of Service agreement provided on Docusign.
  8. +
+

Once these steps are completed, your application status will be pending:

+

pending

+

You will receive a notification that your application is validated and the status will change to live. This usually occurs within 72 hours. Note that the validation period applies to your first production application. Subsequent applications will be validated automatically.

+

live

+
+

Production keys are valid for all Self-Service APIs except Flight Create Orders API, which has special requirements. See the Moving to Production with Flight Create Orders of this guide for more information.

+
+

Remember that once you exceed your free transactions threshold, you will be billed automatically for your transactions every month. You can manage and track your app usage in My Self-Service Workspace.

+

Using the production key

+

Once you have a production key, you can make the following changes to your source code:

+
    +
  • Update the base URL for your API calls to point to https://api.amadeus.com.
  • +
  • Update your API key and API secret with the new production keys.
  • +
+

If you are using Amadeus for Developers SDKs, add hostname='production' to the Client together with your API key and API secret as shown below example in python SDK:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='REPLACE_BY_YOUR_API_KEY',
+    client_secret='REPLACE_BY_YOUR_API_SECRET',
+    hostname='production'
+)
+
+try:
+    response = amadeus.shopping.flight_offers_search.get(
+        originLocationCode='MAD',
+        destinationLocationCode='ATH',
+        departureDate='2022-11-01',
+        adults=1)
+    print(response.data)
+except ResponseError as error:
+    print(error)
+
+

Video Tutorial

+

You can check the step by step process in this video tutorial of How to move to production from Get Started series.

+

+

Moving to production with the Flight Create Orders API

+

Applications using Flight Create Orders must meet special requirements before moving to Production. The requirements are detailed in the following section.

+

Requirements

+
    +
  1. +

    You have a ticket issuance agreement with a consolidator. Only certified + travel agents can issue flight tickets. Non-certified businesses must issue + tickets via an airline consolidator (an entity that acts as a host agency + for non-certified agents). The Amadeus for Developers team can assist you in finding a consolidator in your region.

    +
  2. +
  3. +

    There are no restrictions in your country. Though we are working to make Self-Service flight booking available worldwide, Flight Create Orders API is currently not available to companies in the following countries:

    +
  4. +
+

Algeria, Bangladesh, Bhutan, Bulgaria, Croatia, Egypt, Finland, Iceland, +Iran, Iraq, Jordan, Kuwait, Kosovo, Lebanon, Libya, Madagascar, Maldives, +Montenegro, Morocco, Nepal, Pakistan, Palestine, Qatar, Saudi Arabia, Serbia, Sri Lanka, Sudan, Syria, Tahiti, Tunisia, United Arab Emirates and +Yemen

+
    +
  1. You comply with local regulations . Flight booking is subject to local + regulations and many areas (notably, California and France) have special + requirements.
  2. +
+

Contact us for questions about the above requirements or assistance with local regulations and airline consolidators in your region.

+

If you meet the above requirements, you are ready to move your application +to production.

+

Adding Flight Create Orders to a production app

+

To add Flight Create Orders to an application currently in production, select the app in the My Apps section of your Self-Service Workspace and click API requests:

+

request_prod_booking

+

Then request production access to Flight Create Orders by clicking the Request button located under Actions:

+

request_prod_booking_list

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/api-rate-limits/index.html b/api-rate-limits/index.html new file mode 100644 index 00000000..df575bbd --- /dev/null +++ b/api-rate-limits/index.html @@ -0,0 +1,1837 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Rate limits - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Rate limits

+

Rate limits per API

+

Amadeus Self-Service APIs have two types of rate limits in place to protect against abuse by third parties.

+

Artificial Intelligence and Partners' APIs

+

Artificial intelligence APIs and APIs from Amadeus partners' are currently following the rate limits below.

+ + + + + + + + + + + + + + +
Test and Production
20 transactions per second, per user
No more than 1 request every 50ms
+

List of APIs with the above rate limits:

+ +

The other APIs

+

The rest of Self-Service APIs apart from Artificial intelligence and Partners' APIs are below rate limits per environment.

+ + + + + + + + + + + + + + + + + +
TestProduction
10 transactions per second, per user40 transactions per second, per user
No more than 1 request every 100ms
+

Rate limits Examples

+

To manage the rate limits in APIs, there are mainly two options: +- Use an external library +- Build a request queue from scratch

+

The right choice depends on your resources and requisites.

+

Check out the rate limits examples in Node, Python and Java using the respective Amadeus SDKs.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/assets/favicon.png b/assets/favicon.png new file mode 100644 index 00000000..2638fd72 Binary files /dev/null and b/assets/favicon.png differ diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 00000000..1cf13b9f Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.aecac24b.min.js b/assets/javascripts/bundle.aecac24b.min.js new file mode 100644 index 00000000..464603d8 --- /dev/null +++ b/assets/javascripts/bundle.aecac24b.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var wi=Object.create;var ur=Object.defineProperty;var Si=Object.getOwnPropertyDescriptor;var Ti=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,Oi=Object.getPrototypeOf,dr=Object.prototype.hasOwnProperty,Zr=Object.prototype.propertyIsEnumerable;var Xr=(e,t,r)=>t in e?ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))dr.call(t,r)&&Xr(e,r,t[r]);if(kt)for(var r of kt(t))Zr.call(t,r)&&Xr(e,r,t[r]);return e};var eo=(e,t)=>{var r={};for(var o in e)dr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&kt)for(var o of kt(e))t.indexOf(o)<0&&Zr.call(e,o)&&(r[o]=e[o]);return r};var hr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Mi=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ti(t))!dr.call(e,n)&&n!==r&&ur(e,n,{get:()=>t[n],enumerable:!(o=Si(t,n))||o.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?wi(Oi(e)):{},Mi(t||!e||!e.__esModule?ur(r,"default",{value:e,enumerable:!0}):r,e));var ro=hr((br,to)=>{(function(e,t){typeof br=="object"&&typeof to!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(br,function(){"use strict";function e(r){var o=!0,n=!1,i=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function a(C){return!!(C&&C!==document&&C.nodeName!=="HTML"&&C.nodeName!=="BODY"&&"classList"in C&&"contains"in C.classList)}function c(C){var it=C.type,Ne=C.tagName;return!!(Ne==="INPUT"&&s[it]&&!C.readOnly||Ne==="TEXTAREA"&&!C.readOnly||C.isContentEditable)}function p(C){C.classList.contains("focus-visible")||(C.classList.add("focus-visible"),C.setAttribute("data-focus-visible-added",""))}function l(C){C.hasAttribute("data-focus-visible-added")&&(C.classList.remove("focus-visible"),C.removeAttribute("data-focus-visible-added"))}function f(C){C.metaKey||C.altKey||C.ctrlKey||(a(r.activeElement)&&p(r.activeElement),o=!0)}function u(C){o=!1}function d(C){a(C.target)&&(o||c(C.target))&&p(C.target)}function v(C){a(C.target)&&(C.target.classList.contains("focus-visible")||C.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(C.target))}function b(C){document.visibilityState==="hidden"&&(n&&(o=!0),z())}function z(){document.addEventListener("mousemove",G),document.addEventListener("mousedown",G),document.addEventListener("mouseup",G),document.addEventListener("pointermove",G),document.addEventListener("pointerdown",G),document.addEventListener("pointerup",G),document.addEventListener("touchmove",G),document.addEventListener("touchstart",G),document.addEventListener("touchend",G)}function K(){document.removeEventListener("mousemove",G),document.removeEventListener("mousedown",G),document.removeEventListener("mouseup",G),document.removeEventListener("pointermove",G),document.removeEventListener("pointerdown",G),document.removeEventListener("pointerup",G),document.removeEventListener("touchmove",G),document.removeEventListener("touchstart",G),document.removeEventListener("touchend",G)}function G(C){C.target.nodeName&&C.target.nodeName.toLowerCase()==="html"||(o=!1,K())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",b,!0),z(),r.addEventListener("focus",d,!0),r.addEventListener("blur",v,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var Vr=hr((Ot,Dr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Ot=="object"&&typeof Dr=="object"?Dr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Ot=="object"?Ot.ClipboardJS=r():t.ClipboardJS=r()})(Ot,function(){return function(){var e={686:function(o,n,i){"use strict";i.d(n,{default:function(){return Ei}});var s=i(279),a=i.n(s),c=i(370),p=i.n(c),l=i(817),f=i.n(l);function u(U){try{return document.execCommand(U)}catch(O){return!1}}var d=function(O){var S=f()(O);return u("cut"),S},v=d;function b(U){var O=document.documentElement.getAttribute("dir")==="rtl",S=document.createElement("textarea");S.style.fontSize="12pt",S.style.border="0",S.style.padding="0",S.style.margin="0",S.style.position="absolute",S.style[O?"right":"left"]="-9999px";var $=window.pageYOffset||document.documentElement.scrollTop;return S.style.top="".concat($,"px"),S.setAttribute("readonly",""),S.value=U,S}var z=function(O,S){var $=b(O);S.container.appendChild($);var F=f()($);return u("copy"),$.remove(),F},K=function(O){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},$="";return typeof O=="string"?$=z(O,S):O instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(O==null?void 0:O.type)?$=z(O.value,S):($=f()(O),u("copy")),$},G=K;function C(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(S){return typeof S}:C=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},C(U)}var it=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=O.action,$=S===void 0?"copy":S,F=O.container,Q=O.target,_e=O.text;if($!=="copy"&&$!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Q!==void 0)if(Q&&C(Q)==="object"&&Q.nodeType===1){if($==="copy"&&Q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if($==="cut"&&(Q.hasAttribute("readonly")||Q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(_e)return G(_e,{container:F});if(Q)return $==="cut"?v(Q):G(Q,{container:F})},Ne=it;function Pe(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(S){return typeof S}:Pe=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},Pe(U)}function ui(U,O){if(!(U instanceof O))throw new TypeError("Cannot call a class as a function")}function Jr(U,O){for(var S=0;S0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof F.action=="function"?F.action:this.defaultAction,this.target=typeof F.target=="function"?F.target:this.defaultTarget,this.text=typeof F.text=="function"?F.text:this.defaultText,this.container=Pe(F.container)==="object"?F.container:document.body}},{key:"listenClick",value:function(F){var Q=this;this.listener=p()(F,"click",function(_e){return Q.onClick(_e)})}},{key:"onClick",value:function(F){var Q=F.delegateTarget||F.currentTarget,_e=this.action(Q)||"copy",Ct=Ne({action:_e,container:this.container,target:this.target(Q),text:this.text(Q)});this.emit(Ct?"success":"error",{action:_e,text:Ct,trigger:Q,clearSelection:function(){Q&&Q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(F){return fr("action",F)}},{key:"defaultTarget",value:function(F){var Q=fr("target",F);if(Q)return document.querySelector(Q)}},{key:"defaultText",value:function(F){return fr("text",F)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(F){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return G(F,Q)}},{key:"cut",value:function(F){return v(F)}},{key:"isSupported",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Q=typeof F=="string"?[F]:F,_e=!!document.queryCommandSupported;return Q.forEach(function(Ct){_e=_e&&!!document.queryCommandSupported(Ct)}),_e}}]),S}(a()),Ei=yi},828:function(o){var n=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function s(a,c){for(;a&&a.nodeType!==n;){if(typeof a.matches=="function"&&a.matches(c))return a;a=a.parentNode}}o.exports=s},438:function(o,n,i){var s=i(828);function a(l,f,u,d,v){var b=p.apply(this,arguments);return l.addEventListener(u,b,v),{destroy:function(){l.removeEventListener(u,b,v)}}}function c(l,f,u,d,v){return typeof l.addEventListener=="function"?a.apply(null,arguments):typeof u=="function"?a.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(b){return a(b,f,u,d,v)}))}function p(l,f,u,d){return function(v){v.delegateTarget=s(v.target,f),v.delegateTarget&&d.call(l,v)}}o.exports=c},879:function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var s=Object.prototype.toString.call(i);return i!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var s=Object.prototype.toString.call(i);return s==="[object Function]"}},370:function(o,n,i){var s=i(879),a=i(438);function c(u,d,v){if(!u&&!d&&!v)throw new Error("Missing required arguments");if(!s.string(d))throw new TypeError("Second argument must be a String");if(!s.fn(v))throw new TypeError("Third argument must be a Function");if(s.node(u))return p(u,d,v);if(s.nodeList(u))return l(u,d,v);if(s.string(u))return f(u,d,v);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(u,d,v){return u.addEventListener(d,v),{destroy:function(){u.removeEventListener(d,v)}}}function l(u,d,v){return Array.prototype.forEach.call(u,function(b){b.addEventListener(d,v)}),{destroy:function(){Array.prototype.forEach.call(u,function(b){b.removeEventListener(d,v)})}}}function f(u,d,v){return a(document.body,u,d,v)}o.exports=c},817:function(o){function n(i){var s;if(i.nodeName==="SELECT")i.focus(),s=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var a=i.hasAttribute("readonly");a||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),a||i.removeAttribute("readonly"),s=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),p=document.createRange();p.selectNodeContents(i),c.removeAllRanges(),c.addRange(p),s=c.toString()}return s}o.exports=n},279:function(o){function n(){}n.prototype={on:function(i,s,a){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:s,ctx:a}),this},once:function(i,s,a){var c=this;function p(){c.off(i,p),s.apply(a,arguments)}return p._=s,this.on(i,p,a)},emit:function(i){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[i]||[]).slice(),c=0,p=a.length;for(c;c{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Ha=/["'&<>]/;Un.exports=$a;function $a(e){var t=""+e,r=Ha.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],s;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||a(u,d)})})}function a(u,d){try{c(o[u](d))}catch(v){f(i[0][3],v)}}function c(u){u.value instanceof Ze?Promise.resolve(u.value.v).then(p,l):f(i[0][2],u)}function p(u){a("next",u)}function l(u){a("throw",u)}function f(u,d){u(d),i.shift(),i.length&&a(i[0][0],i[0][1])}}function io(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof we=="function"?we(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(s){return new Promise(function(a,c){s=e[i](s),n(a,c,s.done,s.value)})}}function n(i,s,a,c){Promise.resolve(c).then(function(p){i({value:p,done:a})},s)}}function k(e){return typeof e=="function"}function at(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Rt=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(o,n){return n+1+") "+o.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function De(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ie=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=we(s),c=a.next();!c.done;c=a.next()){var p=c.value;p.remove(this)}}catch(b){t={error:b}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else s.remove(this);var l=this.initialTeardown;if(k(l))try{l()}catch(b){i=b instanceof Rt?b.errors:[b]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=we(f),d=u.next();!d.done;d=u.next()){var v=d.value;try{ao(v)}catch(b){i=i!=null?i:[],b instanceof Rt?i=D(D([],N(i)),N(b.errors)):i.push(b)}}}catch(b){o={error:b}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new Rt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ao(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&De(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&De(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var gr=Ie.EMPTY;function Pt(e){return e instanceof Ie||e&&"closed"in e&&k(e.remove)&&k(e.add)&&k(e.unsubscribe)}function ao(e){k(e)?e():e.unsubscribe()}var Ae={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,s=n.isStopped,a=n.observers;return i||s?gr:(this.currentObservers=null,a.push(r),new Ie(function(){o.currentObservers=null,De(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,s=o.isStopped;n?r.error(i):s&&r.complete()},t.prototype.asObservable=function(){var r=new P;return r.source=this,r},t.create=function(r,o){return new ho(r,o)},t}(P);var ho=function(e){ie(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:gr},t}(x);var yt={now:function(){return(yt.delegate||Date).now()},delegate:void 0};var Et=function(e){ie(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=yt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,s=o._infiniteTimeWindow,a=o._timestampProvider,c=o._windowTime;n||(i.push(r),!s&&i.push(a.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,s=n._buffer,a=s.slice(),c=0;c0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=lt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var s=r.actions;o!=null&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==o&&(lt.cancelAnimationFrame(o),r._scheduled=void 0)},t}(jt);var go=function(e){ie(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o=this._scheduled;this._scheduled=void 0;var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t}(Wt);var Oe=new go(vo);var L=new P(function(e){return e.complete()});function Ut(e){return e&&k(e.schedule)}function Or(e){return e[e.length-1]}function Qe(e){return k(Or(e))?e.pop():void 0}function Me(e){return Ut(Or(e))?e.pop():void 0}function Nt(e,t){return typeof Or(e)=="number"?e.pop():t}var mt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Dt(e){return k(e==null?void 0:e.then)}function Vt(e){return k(e[pt])}function zt(e){return Symbol.asyncIterator&&k(e==null?void 0:e[Symbol.asyncIterator])}function qt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Pi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kt=Pi();function Qt(e){return k(e==null?void 0:e[Kt])}function Yt(e){return no(this,arguments,function(){var r,o,n,i;return $t(this,function(s){switch(s.label){case 0:r=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Ze(r.read())];case 3:return o=s.sent(),n=o.value,i=o.done,i?[4,Ze(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Ze(n)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Bt(e){return k(e==null?void 0:e.getReader)}function I(e){if(e instanceof P)return e;if(e!=null){if(Vt(e))return Ii(e);if(mt(e))return Fi(e);if(Dt(e))return ji(e);if(zt(e))return xo(e);if(Qt(e))return Wi(e);if(Bt(e))return Ui(e)}throw qt(e)}function Ii(e){return new P(function(t){var r=e[pt]();if(k(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Fi(e){return new P(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?M(function(n,i){return e(n,i,o)}):ue,xe(1),r?He(t):Io(function(){return new Jt}))}}function Fo(){for(var e=[],t=0;t=2,!0))}function le(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new x}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,c=a===void 0?!0:a;return function(p){var l,f,u,d=0,v=!1,b=!1,z=function(){f==null||f.unsubscribe(),f=void 0},K=function(){z(),l=u=void 0,v=b=!1},G=function(){var C=l;K(),C==null||C.unsubscribe()};return g(function(C,it){d++,!b&&!v&&z();var Ne=u=u!=null?u:r();it.add(function(){d--,d===0&&!b&&!v&&(f=Hr(G,c))}),Ne.subscribe(it),!l&&d>0&&(l=new tt({next:function(Pe){return Ne.next(Pe)},error:function(Pe){b=!0,z(),f=Hr(K,n,Pe),Ne.error(Pe)},complete:function(){v=!0,z(),f=Hr(K,s),Ne.complete()}}),I(C).subscribe(l))})(p)}}function Hr(e,t){for(var r=[],o=2;oe.next(document)),e}function q(e,t=document){return Array.from(t.querySelectorAll(e))}function W(e,t=document){let r=ce(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function ce(e,t=document){return t.querySelector(e)||void 0}function Re(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}var na=_(h(document.body,"focusin"),h(document.body,"focusout")).pipe(ke(1),V(void 0),m(()=>Re()||document.body),J(1));function Zt(e){return na.pipe(m(t=>e.contains(t)),X())}function Je(e){return{x:e.offsetLeft,y:e.offsetTop}}function No(e){return _(h(window,"load"),h(window,"resize")).pipe(Ce(0,Oe),m(()=>Je(e)),V(Je(e)))}function er(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return _(h(e,"scroll"),h(window,"resize")).pipe(Ce(0,Oe),m(()=>er(e)),V(er(e)))}function Do(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Do(e,r)}function T(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]!="undefined"&&(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Do(o,n);return o}function tr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function ht(e){let t=T("script",{src:e});return H(()=>(document.head.appendChild(t),_(h(t,"load"),h(t,"error").pipe(E(()=>Mr(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),A(()=>document.head.removeChild(t)),xe(1))))}var Vo=new x,ia=H(()=>typeof ResizeObserver=="undefined"?ht("https://unpkg.com/resize-observer-polyfill"):j(void 0)).pipe(m(()=>new ResizeObserver(e=>{for(let t of e)Vo.next(t)})),E(e=>_(Ve,j(e)).pipe(A(()=>e.disconnect()))),J(1));function he(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ye(e){return ia.pipe(w(t=>t.observe(e)),E(t=>Vo.pipe(M(({target:r})=>r===e),A(()=>t.unobserve(e)),m(()=>he(e)))),V(he(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function zo(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var qo=new x,aa=H(()=>j(new IntersectionObserver(e=>{for(let t of e)qo.next(t)},{threshold:0}))).pipe(E(e=>_(Ve,j(e)).pipe(A(()=>e.disconnect()))),J(1));function rr(e){return aa.pipe(w(t=>t.observe(e)),E(t=>qo.pipe(M(({target:r})=>r===e),A(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function Ko(e,t=16){return dt(e).pipe(m(({y:r})=>{let o=he(e),n=bt(e);return r>=n.height-o.height-t}),X())}var or={drawer:W("[data-md-toggle=drawer]"),search:W("[data-md-toggle=search]")};function Qo(e){return or[e].checked}function Ke(e,t){or[e].checked!==t&&or[e].click()}function We(e){let t=or[e];return h(t,"change").pipe(m(()=>t.checked),V(t.checked))}function sa(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function ca(){return _(h(window,"compositionstart").pipe(m(()=>!0)),h(window,"compositionend").pipe(m(()=>!1))).pipe(V(!1))}function Yo(){let e=h(window,"keydown").pipe(M(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:Qo("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),M(({mode:t,type:r})=>{if(t==="global"){let o=Re();if(typeof o!="undefined")return!sa(o,r)}return!0}),le());return ca().pipe(E(t=>t?L:e))}function pe(){return new URL(location.href)}function ot(e,t=!1){if(te("navigation.instant")&&!t){let r=T("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function Bo(){return new x}function Go(){return location.hash.slice(1)}function nr(e){let t=T("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function pa(e){return _(h(window,"hashchange"),e).pipe(m(Go),V(Go()),M(t=>t.length>0),J(1))}function Jo(e){return pa(e).pipe(m(t=>ce(`[id="${t}"]`)),M(t=>typeof t!="undefined"))}function Fr(e){let t=matchMedia(e);return Xt(r=>t.addListener(()=>r(t.matches))).pipe(V(t.matches))}function Xo(){let e=matchMedia("print");return _(h(window,"beforeprint").pipe(m(()=>!0)),h(window,"afterprint").pipe(m(()=>!1))).pipe(V(e.matches))}function jr(e,t){return e.pipe(E(r=>r?t():L))}function ir(e,t){return new P(r=>{let o=new XMLHttpRequest;o.open("GET",`${e}`),o.responseType="blob",o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network Error"))}),o.addEventListener("abort",()=>{r.error(new Error("Request aborted"))}),typeof(t==null?void 0:t.progress$)!="undefined"&&(o.addEventListener("progress",n=>{t.progress$.next(n.loaded/n.total*100)}),t.progress$.next(5)),o.send()})}function Ue(e,t){return ir(e,t).pipe(E(r=>r.text()),m(r=>JSON.parse(r)),J(1))}function Zo(e,t){let r=new DOMParser;return ir(e,t).pipe(E(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),J(1))}function en(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function tn(){return _(h(window,"scroll",{passive:!0}),h(window,"resize",{passive:!0})).pipe(m(en),V(en()))}function rn(){return{width:innerWidth,height:innerHeight}}function on(){return h(window,"resize",{passive:!0}).pipe(m(rn),V(rn()))}function nn(){return B([tn(),on()]).pipe(m(([e,t])=>({offset:e,size:t})),J(1))}function ar(e,{viewport$:t,header$:r}){let o=t.pipe(ee("size")),n=B([o,r]).pipe(m(()=>Je(e)));return B([r,t,n]).pipe(m(([{height:i},{offset:s,size:a},{x:c,y:p}])=>({offset:{x:s.x-c,y:s.y-p+i},size:a})))}function la(e){return h(e,"message",t=>t.data)}function ma(e){let t=new x;return t.subscribe(r=>e.postMessage(r)),t}function an(e,t=new Worker(e)){let r=la(t),o=ma(t),n=new x;n.subscribe(o);let i=o.pipe(Z(),re(!0));return n.pipe(Z(),qe(r.pipe(Y(i))),le())}var fa=W("#__config"),vt=JSON.parse(fa.textContent);vt.base=`${new URL(vt.base,pe())}`;function me(){return vt}function te(e){return vt.features.includes(e)}function be(e,t){return typeof t!="undefined"?vt.translations[e].replace("#",t.toString()):vt.translations[e]}function Ee(e,t=document){return W(`[data-md-component=${e}]`,t)}function oe(e,t=document){return q(`[data-md-component=${e}]`,t)}function ua(e){let t=W(".md-typeset > :first-child",e);return h(t,"click",{once:!0}).pipe(m(()=>W(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function sn(e){if(!te("announce.dismiss")||!e.childElementCount)return L;if(!e.hidden){let t=W(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return H(()=>{let t=new x;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),ua(e).pipe(w(r=>t.next(r)),A(()=>t.complete()),m(r=>R({ref:e},r)))})}function da(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function cn(e,t){let r=new x;return r.subscribe(({hidden:o})=>{e.hidden=o}),da(e,t).pipe(w(o=>r.next(o)),A(()=>r.complete()),m(o=>R({ref:e},o)))}function ha(e,t){let r=H(()=>B([No(e),dt(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:s,height:a}=he(e);return{x:o-i.x+s/2,y:n-i.y+a/2}}));return Zt(e).pipe(E(o=>r.pipe(m(n=>({active:o,offset:n})),xe(+!o||1/0))))}function pn(e,t,{target$:r}){let[o,n]=Array.from(e.children);return H(()=>{let i=new x,s=i.pipe(Z(),re(!0));return i.subscribe({next({offset:a}){e.style.setProperty("--md-tooltip-x",`${a.x}px`),e.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),rr(e).pipe(Y(s)).subscribe(a=>{e.toggleAttribute("data-md-visible",a)}),_(i.pipe(M(({active:a})=>a)),i.pipe(ke(250),M(({active:a})=>!a))).subscribe({next({active:a}){a?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(Ce(16,Oe)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(Pr(125,Oe),M(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?e.style.setProperty("--md-tooltip-0",`${-a}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),h(n,"click").pipe(Y(s),M(a=>!(a.metaKey||a.ctrlKey))).subscribe(a=>{a.stopPropagation(),a.preventDefault()}),h(n,"mousedown").pipe(Y(s),ne(i)).subscribe(([a,{active:c}])=>{var p;if(a.button!==0||a.metaKey||a.ctrlKey)a.preventDefault();else if(c){a.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():(p=Re())==null||p.blur()}}),r.pipe(Y(s),M(a=>a===o),ze(125)).subscribe(()=>e.focus()),ha(e,t).pipe(w(a=>i.next(a)),A(()=>i.complete()),m(a=>R({ref:e},a)))})}function Wr(e){return T("div",{class:"md-tooltip",id:e},T("div",{class:"md-tooltip__inner md-typeset"}))}function ln(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return T("aside",{class:"md-annotation",tabIndex:0},Wr(t),T("a",{href:r,class:"md-annotation__index",tabIndex:-1},T("span",{"data-md-annotation-id":e})))}else return T("aside",{class:"md-annotation",tabIndex:0},Wr(t),T("span",{class:"md-annotation__index",tabIndex:-1},T("span",{"data-md-annotation-id":e})))}function mn(e){return T("button",{class:"md-clipboard md-icon",title:be("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}function Ur(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(c=>!e.terms[c]).reduce((c,p)=>[...c,T("del",null,p)," "],[]).slice(0,-1),i=me(),s=new URL(e.location,i.base);te("search.highlight")&&s.searchParams.set("h",Object.entries(e.terms).filter(([,c])=>c).reduce((c,[p])=>`${c} ${p}`.trim(),""));let{tags:a}=me();return T("a",{href:`${s}`,class:"md-search-result__link",tabIndex:-1},T("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&T("div",{class:"md-search-result__icon md-icon"}),r>0&&T("h1",null,e.title),r<=0&&T("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&e.tags.map(c=>{let p=a?c in a?`md-tag-icon md-tag--${a[c]}`:"md-tag-icon":"";return T("span",{class:`md-tag ${p}`},c)}),o>0&&n.length>0&&T("p",{class:"md-search-result__terms"},be("search.result.term.missing"),": ",...n)))}function fn(e){let t=e[0].score,r=[...e],o=me(),n=r.findIndex(l=>!`${new URL(l.location,o.base)}`.includes("#")),[i]=r.splice(n,1),s=r.findIndex(l=>l.scoreUr(l,1)),...c.length?[T("details",{class:"md-search-result__more"},T("summary",{tabIndex:-1},T("div",null,c.length>0&&c.length===1?be("search.result.more.one"):be("search.result.more.other",c.length))),...c.map(l=>Ur(l,1)))]:[]];return T("li",{class:"md-search-result__item"},p)}function un(e){return T("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>T("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?tr(r):r)))}function Nr(e){let t=`tabbed-control tabbed-control--${e}`;return T("div",{class:t,hidden:!0},T("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function dn(e){return T("div",{class:"md-typeset__scrollwrap"},T("div",{class:"md-typeset__table"},e))}function ba(e){let t=me(),r=new URL(`../${e.version}/`,t.base);return T("li",{class:"md-version__item"},T("a",{href:`${r}`,class:"md-version__link"},e.title))}function hn(e,t){return T("div",{class:"md-version"},T("button",{class:"md-version__current","aria-label":be("select.version")},t.title),T("ul",{class:"md-version__list"},e.map(ba)))}function va(e){return e.tagName==="CODE"?q(".c, .c1, .cm",e):[e]}function ga(e){let t=[];for(let r of va(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let s;for(;s=/(\(\d+\))(!)?/.exec(i.textContent);){let[,a,c]=s;if(typeof c=="undefined"){let p=i.splitText(s.index);i=p.splitText(a.length),t.push(p)}else{i.textContent=a,t.push(i);break}}}}return t}function bn(e,t){t.append(...Array.from(e.childNodes))}function sr(e,t,{target$:r,print$:o}){let n=t.closest("[id]"),i=n==null?void 0:n.id,s=new Map;for(let a of ga(t)){let[,c]=a.textContent.match(/\((\d+)\)/);ce(`:scope > li:nth-child(${c})`,e)&&(s.set(c,ln(c,i)),a.replaceWith(s.get(c)))}return s.size===0?L:H(()=>{let a=new x,c=a.pipe(Z(),re(!0)),p=[];for(let[l,f]of s)p.push([W(".md-typeset",f),W(`:scope > li:nth-child(${l})`,e)]);return o.pipe(Y(c)).subscribe(l=>{e.hidden=!l,e.classList.toggle("md-annotation-list",l);for(let[f,u]of p)l?bn(f,u):bn(u,f)}),_(...[...s].map(([,l])=>pn(l,t,{target$:r}))).pipe(A(()=>a.complete()),le())})}function vn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return vn(t)}}function gn(e,t){return H(()=>{let r=vn(e);return typeof r!="undefined"?sr(r,e,t):L})}var yn=Ht(Vr());var xa=0;function En(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return En(t)}}function xn(e){return ye(e).pipe(m(({width:t})=>({scrollable:bt(e).width>t})),ee("scrollable"))}function wn(e,t){let{matches:r}=matchMedia("(hover)"),o=H(()=>{let n=new x;if(n.subscribe(({scrollable:s})=>{s&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}),yn.default.isSupported()&&(e.closest(".copy")||te("content.code.copy")&&!e.closest(".no-copy"))){let s=e.closest("pre");s.id=`__code_${xa++}`,s.insertBefore(mn(s.id),e)}let i=e.closest(".highlight");if(i instanceof HTMLElement){let s=En(i);if(typeof s!="undefined"&&(i.classList.contains("annotate")||te("content.code.annotate"))){let a=sr(s,e,t);return xn(e).pipe(w(c=>n.next(c)),A(()=>n.complete()),m(c=>R({ref:e},c)),qe(ye(i).pipe(m(({width:c,height:p})=>c&&p),X(),E(c=>c?a:L))))}}return xn(e).pipe(w(s=>n.next(s)),A(()=>n.complete()),m(s=>R({ref:e},s)))});return te("content.lazy")?rr(e).pipe(M(n=>n),xe(1),E(()=>o)):o}function ya(e,{target$:t,print$:r}){let o=!0;return _(t.pipe(m(n=>n.closest("details:not([open])")),M(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(M(n=>n||!o),w(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Sn(e,t){return H(()=>{let r=new x;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),ya(e,t).pipe(w(o=>r.next(o)),A(()=>r.complete()),m(o=>R({ref:e},o)))})}var Tn=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel rect,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel rect{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color);stroke-width:.05rem}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}g #flowchart-circleEnd,g #flowchart-circleStart,g #flowchart-crossEnd,g #flowchart-crossStart,g #flowchart-pointEnd,g #flowchart-pointStart{stroke:none}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs #classDiagram-compositionEnd,defs #classDiagram-compositionStart,defs #classDiagram-dependencyEnd,defs #classDiagram-dependencyStart,defs #classDiagram-extensionEnd,defs #classDiagram-extensionStart{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs #classDiagram-aggregationEnd,defs #classDiagram-aggregationStart{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.attributeBoxEven,.attributeBoxOdd{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}.actor{fill:var(--md-mermaid-sequence-actor-bg-color);stroke:var(--md-mermaid-sequence-actor-border-color)}text.actor>tspan{fill:var(--md-mermaid-sequence-actor-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-mermaid-sequence-actor-line-color)}.actor-man circle,.actor-man line{fill:var(--md-mermaid-sequence-actorman-bg-color);stroke:var(--md-mermaid-sequence-actorman-line-color)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-sequence-message-line-color)}.note{fill:var(--md-mermaid-sequence-note-bg-color);stroke:var(--md-mermaid-sequence-note-border-color)}.loopText,.loopText>tspan,.messageText,.noteText>tspan{stroke:none;font-family:var(--md-mermaid-font-family)!important}.messageText{fill:var(--md-mermaid-sequence-message-fg-color)}.loopText,.loopText>tspan{fill:var(--md-mermaid-sequence-loop-fg-color)}.noteText>tspan{fill:var(--md-mermaid-sequence-note-fg-color)}#arrowhead path{fill:var(--md-mermaid-sequence-message-line-color);stroke:none}.loopLine{fill:var(--md-mermaid-sequence-loop-bg-color);stroke:var(--md-mermaid-sequence-loop-border-color)}.labelBox{fill:var(--md-mermaid-sequence-label-bg-color);stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-sequence-label-fg-color);font-family:var(--md-mermaid-font-family)}.sequenceNumber{fill:var(--md-mermaid-sequence-number-fg-color)}rect.rect{fill:var(--md-mermaid-sequence-box-bg-color);stroke:none}rect.rect+text.text{fill:var(--md-mermaid-sequence-box-fg-color)}defs #sequencenumber{fill:var(--md-mermaid-sequence-number-bg-color)!important}";var zr,wa=0;function Sa(){return typeof mermaid=="undefined"||mermaid instanceof Element?ht("https://unpkg.com/mermaid@9.4.3/dist/mermaid.min.js"):j(void 0)}function On(e){return e.classList.remove("mermaid"),zr||(zr=Sa().pipe(w(()=>mermaid.initialize({startOnLoad:!1,themeCSS:Tn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),J(1))),zr.subscribe(()=>{e.classList.add("mermaid");let t=`__mermaid_${wa++}`,r=T("div",{class:"mermaid"}),o=e.textContent;mermaid.mermaidAPI.render(t,o,(n,i)=>{let s=r.attachShadow({mode:"closed"});s.innerHTML=n,e.replaceWith(r),i==null||i(s)})}),zr.pipe(m(()=>({ref:e})))}var Mn=T("table");function Ln(e){return e.replaceWith(Mn),Mn.replaceWith(dn(e)),j({ref:e})}function Ta(e){let t=q(":scope > input",e),r=t.find(o=>o.checked)||t[0];return _(...t.map(o=>h(o,"change").pipe(m(()=>W(`label[for="${o.id}"]`))))).pipe(V(W(`label[for="${r.id}"]`)),m(o=>({active:o})))}function _n(e,{viewport$:t}){let r=Nr("prev");e.append(r);let o=Nr("next");e.append(o);let n=W(".tabbed-labels",e);return H(()=>{let i=new x,s=i.pipe(Z(),re(!0));return B([i,ye(e)]).pipe(Ce(1,Oe),Y(s)).subscribe({next([{active:a},c]){let p=Je(a),{width:l}=he(a);e.style.setProperty("--md-indicator-x",`${p.x}px`),e.style.setProperty("--md-indicator-width",`${l}px`);let f=er(n);(p.xf.x+c.width)&&n.scrollTo({left:Math.max(0,p.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),B([dt(n),ye(n)]).pipe(Y(s)).subscribe(([a,c])=>{let p=bt(n);r.hidden=a.x<16,o.hidden=a.x>p.width-c.width-16}),_(h(r,"click").pipe(m(()=>-1)),h(o,"click").pipe(m(()=>1))).pipe(Y(s)).subscribe(a=>{let{width:c}=he(n);n.scrollBy({left:c*a,behavior:"smooth"})}),te("content.tabs.link")&&i.pipe(je(1),ne(t)).subscribe(([{active:a},{offset:c}])=>{let p=a.innerText.trim();if(a.hasAttribute("data-md-switching"))a.removeAttribute("data-md-switching");else{let l=e.offsetTop-c.y;for(let u of q("[data-tabs]"))for(let d of q(":scope > input",u)){let v=W(`label[for="${d.id}"]`);if(v!==a&&v.innerText.trim()===p){v.setAttribute("data-md-switching",""),d.click();break}}window.scrollTo({top:e.offsetTop-l});let f=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([p,...f])])}}),i.pipe(Y(s)).subscribe(()=>{for(let a of q("audio, video",e))a.pause()}),Ta(e).pipe(w(a=>i.next(a)),A(()=>i.complete()),m(a=>R({ref:e},a)))}).pipe(rt(ae))}function An(e,{viewport$:t,target$:r,print$:o}){return _(...q(".annotate:not(.highlight)",e).map(n=>gn(n,{target$:r,print$:o})),...q("pre:not(.mermaid) > code",e).map(n=>wn(n,{target$:r,print$:o})),...q("pre.mermaid",e).map(n=>On(n)),...q("table:not([class])",e).map(n=>Ln(n)),...q("details",e).map(n=>Sn(n,{target$:r,print$:o})),...q("[data-tabs]",e).map(n=>_n(n,{viewport$:t})))}function Oa(e,{alert$:t}){return t.pipe(E(r=>_(j(!0),j(!1).pipe(ze(2e3))).pipe(m(o=>({message:r,active:o})))))}function Cn(e,t){let r=W(".md-typeset",e);return H(()=>{let o=new x;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),Oa(e,t).pipe(w(n=>o.next(n)),A(()=>o.complete()),m(n=>R({ref:e},n)))})}function Ma({viewport$:e}){if(!te("header.autohide"))return j(!1);let t=e.pipe(m(({offset:{y:n}})=>n),Le(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),X()),o=We("search");return B([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),X(),E(n=>n?r:j(!1)),V(!1))}function kn(e,t){return H(()=>B([ye(e),Ma(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),X((r,o)=>r.height===o.height&&r.hidden===o.hidden),J(1))}function Hn(e,{header$:t,main$:r}){return H(()=>{let o=new x,n=o.pipe(Z(),re(!0));return o.pipe(ee("active"),Ge(t)).subscribe(([{active:i},{hidden:s}])=>{e.classList.toggle("md-header--shadow",i&&!s),e.hidden=s}),r.subscribe(o),t.pipe(Y(n),m(i=>R({ref:e},i)))})}function La(e,{viewport$:t,header$:r}){return ar(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=he(e);return{active:o>=n}}),ee("active"))}function $n(e,t){return H(()=>{let r=new x;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=ce(".md-content h1");return typeof o=="undefined"?L:La(o,t).pipe(w(n=>r.next(n)),A(()=>r.complete()),m(n=>R({ref:e},n)))})}function Rn(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),X()),n=o.pipe(E(()=>ye(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),ee("bottom"))));return B([o,n,t]).pipe(m(([i,{top:s,bottom:a},{offset:{y:c},size:{height:p}}])=>(p=Math.max(0,p-Math.max(0,s-c,i)-Math.max(0,p+c-a)),{offset:s-i,height:p,active:s-i<=c})),X((i,s)=>i.offset===s.offset&&i.height===s.height&&i.active===s.active))}function _a(e){let t=__md_get("__palette")||{index:e.findIndex(r=>matchMedia(r.getAttribute("data-md-color-media")).matches)};return j(...e).pipe(se(r=>h(r,"change").pipe(m(()=>r))),V(e[Math.max(0,t.index)]),m(r=>({index:e.indexOf(r),color:{scheme:r.getAttribute("data-md-color-scheme"),primary:r.getAttribute("data-md-color-primary"),accent:r.getAttribute("data-md-color-accent")}})),J(1))}function Pn(e){let t=T("meta",{name:"theme-color"});document.head.appendChild(t);let r=T("meta",{name:"color-scheme"});return document.head.appendChild(r),H(()=>{let o=new x;o.subscribe(i=>{document.body.setAttribute("data-md-color-switching","");for(let[s,a]of Object.entries(i.color))document.body.setAttribute(`data-md-color-${s}`,a);for(let s=0;s{let i=Ee("header"),s=window.getComputedStyle(i);return r.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(a=>(+a).toString(16).padStart(2,"0")).join("")})).subscribe(i=>t.content=`#${i}`),o.pipe(Se(ae)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")});let n=q("input",e);return _a(n).pipe(w(i=>o.next(i)),A(()=>o.complete()),m(i=>R({ref:e},i)))})}function In(e,{progress$:t}){return H(()=>{let r=new x;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(w(o=>r.next({value:o})),A(()=>r.complete()),m(o=>({ref:e,value:o})))})}var qr=Ht(Vr());function Aa(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r}function Fn({alert$:e}){qr.default.isSupported()&&new P(t=>{new qr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||Aa(W(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(w(t=>{t.trigger.focus()}),m(()=>be("clipboard.copied"))).subscribe(e)}function Ca(e){if(e.length<2)return[""];let[t,r]=[...e].sort((n,i)=>n.length-i.length).map(n=>n.replace(/[^/]+$/,"")),o=0;if(t===r)o=t.length;else for(;t.charCodeAt(o)===r.charCodeAt(o);)o++;return e.map(n=>n.replace(t.slice(0,o),""))}function cr(e){let t=__md_get("__sitemap",sessionStorage,e);if(t)return j(t);{let r=me();return Zo(new URL("sitemap.xml",e||r.base)).pipe(m(o=>Ca(q("loc",o).map(n=>n.textContent))),de(()=>L),He([]),w(o=>__md_set("__sitemap",o,sessionStorage,e)))}}function jn(e){let t=W("[rel=canonical]",e);t.href=t.href.replace("//localhost:","//127.0.0.1");let r=new Map;for(let o of q(":scope > *",e)){let n=o.outerHTML;for(let i of["href","src"]){let s=o.getAttribute(i);if(s===null)continue;let a=new URL(s,t.href),c=o.cloneNode();c.setAttribute(i,`${a}`),n=c.outerHTML;break}r.set(n,o)}return r}function Wn({location$:e,viewport$:t,progress$:r}){let o=me();if(location.protocol==="file:")return L;let n=cr().pipe(m(l=>l.map(f=>`${new URL(f,o.base)}`))),i=h(document.body,"click").pipe(ne(n),E(([l,f])=>{if(!(l.target instanceof Element))return L;let u=l.target.closest("a");if(u===null)return L;if(u.target||l.metaKey||l.ctrlKey)return L;let d=new URL(u.href);return d.search=d.hash="",f.includes(`${d}`)?(l.preventDefault(),j(new URL(u.href))):L}),le());i.pipe(xe(1)).subscribe(()=>{let l=ce("link[rel=icon]");typeof l!="undefined"&&(l.href=l.href)}),h(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),i.pipe(ne(t)).subscribe(([l,{offset:f}])=>{history.scrollRestoration="manual",history.replaceState(f,""),history.pushState(null,"",l)}),i.subscribe(e);let s=e.pipe(V(pe()),ee("pathname"),je(1),E(l=>ir(l,{progress$:r}).pipe(de(()=>(ot(l,!0),L))))),a=new DOMParser,c=s.pipe(E(l=>l.text()),E(l=>{let f=a.parseFromString(l,"text/html");for(let b of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...te("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let z=ce(b),K=ce(b,f);typeof z!="undefined"&&typeof K!="undefined"&&z.replaceWith(K)}let u=jn(document.head),d=jn(f.head);for(let[b,z]of d)z.getAttribute("rel")==="stylesheet"||z.hasAttribute("src")||(u.has(b)?u.delete(b):document.head.appendChild(z));for(let b of u.values())b.getAttribute("rel")==="stylesheet"||b.hasAttribute("src")||b.remove();let v=Ee("container");return Fe(q("script",v)).pipe(E(b=>{let z=f.createElement("script");if(b.src){for(let K of b.getAttributeNames())z.setAttribute(K,b.getAttribute(K));return b.replaceWith(z),new P(K=>{z.onload=()=>K.complete()})}else return z.textContent=b.textContent,b.replaceWith(z),L}),Z(),re(f))}),le());return h(window,"popstate").pipe(m(pe)).subscribe(e),e.pipe(V(pe()),Le(2,1),M(([l,f])=>l.pathname===f.pathname&&l.hash!==f.hash),m(([,l])=>l)).subscribe(l=>{var f,u;history.state!==null||!l.hash?window.scrollTo(0,(u=(f=history.state)==null?void 0:f.y)!=null?u:0):(history.scrollRestoration="auto",nr(l.hash),history.scrollRestoration="manual")}),e.pipe(Cr(i),V(pe()),Le(2,1),M(([l,f])=>l.pathname===f.pathname&&l.hash===f.hash),m(([,l])=>l)).subscribe(l=>{history.scrollRestoration="auto",nr(l.hash),history.scrollRestoration="manual",history.back()}),c.pipe(ne(e)).subscribe(([,l])=>{var f,u;history.state!==null||!l.hash?window.scrollTo(0,(u=(f=history.state)==null?void 0:f.y)!=null?u:0):nr(l.hash)}),t.pipe(ee("offset"),ke(100)).subscribe(({offset:l})=>{history.replaceState(l,"")}),c}var Dn=Ht(Nn());function Vn(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,s)=>`${i}${s}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return s=>(0,Dn.default)(s).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Mt(e){return e.type===1}function pr(e){return e.type===3}function zn(e,t){let r=an(e);return _(j(location.protocol!=="file:"),We("search")).pipe($e(o=>o),E(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:te("search.suggest")}}})),r}function qn({document$:e}){let t=me(),r=Ue(new URL("../versions.json",t.base)).pipe(de(()=>L)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:s,aliases:a})=>s===i||a.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),E(n=>h(document.body,"click").pipe(M(i=>!i.metaKey&&!i.ctrlKey),ne(o),E(([i,s])=>{if(i.target instanceof Element){let a=i.target.closest("a");if(a&&!a.target&&n.has(a.href)){let c=a.href;return!i.target.closest(".md-version")&&n.get(c)===s?L:(i.preventDefault(),j(c))}}return L}),E(i=>{let{version:s}=n.get(i);return cr(new URL(i)).pipe(m(a=>{let p=pe().href.replace(t.base,"");return a.includes(p.split("#")[0])?new URL(`../${s}/${p}`,t.base):new URL(i)}))})))).subscribe(n=>ot(n,!0)),B([r,o]).subscribe(([n,i])=>{W(".md-header__topic").appendChild(hn(n,i))}),e.pipe(E(()=>o)).subscribe(n=>{var s;let i=__md_get("__outdated",sessionStorage);if(i===null){i=!0;let a=((s=t.version)==null?void 0:s.default)||"latest";Array.isArray(a)||(a=[a]);e:for(let c of a)for(let p of n.aliases)if(new RegExp(c,"i").test(p)){i=!1;break e}__md_set("__outdated",i,sessionStorage)}if(i)for(let a of oe("outdated"))a.hidden=!1})}function Pa(e,{worker$:t}){let{searchParams:r}=pe();r.has("q")&&(Ke("search",!0),e.value=r.get("q"),e.focus(),We("search").pipe($e(i=>!i)).subscribe(()=>{let i=pe();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=Zt(e),n=_(t.pipe($e(Mt)),h(e,"keyup"),o).pipe(m(()=>e.value),X());return B([n,o]).pipe(m(([i,s])=>({value:i,focus:s})),J(1))}function Kn(e,{worker$:t}){let r=new x,o=r.pipe(Z(),re(!0));B([t.pipe($e(Mt)),r],(i,s)=>s).pipe(ee("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(ee("focus")).subscribe(({focus:i})=>{i&&Ke("search",i)}),h(e.form,"reset").pipe(Y(o)).subscribe(()=>e.focus());let n=W("header [for=__search]");return h(n,"click").subscribe(()=>e.focus()),Pa(e,{worker$:t}).pipe(w(i=>r.next(i)),A(()=>r.complete()),m(i=>R({ref:e},i)),J(1))}function Qn(e,{worker$:t,query$:r}){let o=new x,n=Ko(e.parentElement).pipe(M(Boolean)),i=e.parentElement,s=W(":scope > :first-child",e),a=W(":scope > :last-child",e);We("search").subscribe(l=>a.setAttribute("role",l?"list":"presentation")),o.pipe(ne(r),$r(t.pipe($e(Mt)))).subscribe(([{items:l},{value:f}])=>{switch(l.length){case 0:s.textContent=f.length?be("search.result.none"):be("search.result.placeholder");break;case 1:s.textContent=be("search.result.one");break;default:let u=tr(l.length);s.textContent=be("search.result.other",u)}});let c=o.pipe(w(()=>a.innerHTML=""),E(({items:l})=>_(j(...l.slice(0,10)),j(...l.slice(10)).pipe(Le(4),Ir(n),E(([f])=>f)))),m(fn),le());return c.subscribe(l=>a.appendChild(l)),c.pipe(se(l=>{let f=ce("details",l);return typeof f=="undefined"?L:h(f,"toggle").pipe(Y(o),m(()=>f))})).subscribe(l=>{l.open===!1&&l.offsetTop<=i.scrollTop&&i.scrollTo({top:l.offsetTop})}),t.pipe(M(pr),m(({data:l})=>l)).pipe(w(l=>o.next(l)),A(()=>o.complete()),m(l=>R({ref:e},l)))}function Ia(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=pe();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function Yn(e,t){let r=new x,o=r.pipe(Z(),re(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),h(e,"click").pipe(Y(o)).subscribe(n=>n.preventDefault()),Ia(e,t).pipe(w(n=>r.next(n)),A(()=>r.complete()),m(n=>R({ref:e},n)))}function Bn(e,{worker$:t,keyboard$:r}){let o=new x,n=Ee("search-query"),i=_(h(n,"keydown"),h(n,"focus")).pipe(Se(ae),m(()=>n.value),X());return o.pipe(Ge(i),m(([{suggest:a},c])=>{let p=c.split(/([\s-]+)/);if(a!=null&&a.length&&p[p.length-1]){let l=a[a.length-1];l.startsWith(p[p.length-1])&&(p[p.length-1]=l)}else p.length=0;return p})).subscribe(a=>e.innerHTML=a.join("").replace(/\s/g," ")),r.pipe(M(({mode:a})=>a==="search")).subscribe(a=>{switch(a.type){case"ArrowRight":e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText);break}}),t.pipe(M(pr),m(({data:a})=>a)).pipe(w(a=>o.next(a)),A(()=>o.complete()),m(()=>({ref:e})))}function Gn(e,{index$:t,keyboard$:r}){let o=me();try{let n=zn(o.search,t),i=Ee("search-query",e),s=Ee("search-result",e);h(e,"click").pipe(M(({target:c})=>c instanceof Element&&!!c.closest("a"))).subscribe(()=>Ke("search",!1)),r.pipe(M(({mode:c})=>c==="search")).subscribe(c=>{let p=Re();switch(c.type){case"Enter":if(p===i){let l=new Map;for(let f of q(":first-child [href]",s)){let u=f.firstElementChild;l.set(f,parseFloat(u.getAttribute("data-md-score")))}if(l.size){let[[f]]=[...l].sort(([,u],[,d])=>d-u);f.click()}c.claim()}break;case"Escape":case"Tab":Ke("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof p=="undefined")i.focus();else{let l=[i,...q(":not(details) > [href], summary, details[open] [href]",s)],f=Math.max(0,(Math.max(0,l.indexOf(p))+l.length+(c.type==="ArrowUp"?-1:1))%l.length);l[f].focus()}c.claim();break;default:i!==Re()&&i.focus()}}),r.pipe(M(({mode:c})=>c==="global")).subscribe(c=>{switch(c.type){case"f":case"s":case"/":i.focus(),i.select(),c.claim();break}});let a=Kn(i,{worker$:n});return _(a,Qn(s,{worker$:n,query$:a})).pipe(qe(...oe("search-share",e).map(c=>Yn(c,{query$:a})),...oe("search-suggest",e).map(c=>Bn(c,{worker$:n,keyboard$:r}))))}catch(n){return e.hidden=!0,Ve}}function Jn(e,{index$:t,location$:r}){return B([t,r.pipe(V(pe()),M(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>Vn(o.config)(n.searchParams.get("h"))),m(o=>{var s;let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if((s=a.parentElement)!=null&&s.offsetHeight){let c=a.textContent,p=o(c);p.length>c.length&&n.set(a,p)}for(let[a,c]of n){let{childNodes:p}=T("span",null,c);a.replaceWith(...Array.from(p))}return{ref:e,nodes:n}}))}function Fa(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return B([r,t]).pipe(m(([{offset:i,height:s},{offset:{y:a}}])=>(s=s+Math.min(n,Math.max(0,a-i))-n,{height:s,locked:a>=i+n})),X((i,s)=>i.height===s.height&&i.locked===s.locked))}function Kr(e,o){var n=o,{header$:t}=n,r=eo(n,["header$"]);let i=W(".md-sidebar__scrollwrap",e),{y:s}=Je(i);return H(()=>{let a=new x,c=a.pipe(Z(),re(!0)),p=a.pipe(Ce(0,Oe));return p.pipe(ne(t)).subscribe({next([{height:l},{height:f}]){i.style.height=`${l-2*s}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),p.pipe($e()).subscribe(()=>{for(let l of q(".md-nav__link--active[href]",e)){if(!l.clientHeight)continue;let f=l.closest(".md-sidebar__scrollwrap");if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=he(f);f.scrollTo({top:u-d/2})}}}),ge(q("label[tabindex]",e)).pipe(se(l=>h(l,"click").pipe(Se(ae),m(()=>l),Y(c)))).subscribe(l=>{let f=W(`[id="${l.htmlFor}"]`);W(`[aria-labelledby="${l.id}"]`).setAttribute("aria-expanded",`${f.checked}`)}),Fa(e,r).pipe(w(l=>a.next(l)),A(()=>a.complete()),m(l=>R({ref:e},l)))})}function Xn(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return St(Ue(`${r}/releases/latest`).pipe(de(()=>L),m(o=>({version:o.tag_name})),He({})),Ue(r).pipe(de(()=>L),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),He({}))).pipe(m(([o,n])=>R(R({},o),n)))}else{let r=`https://api.github.com/users/${e}`;return Ue(r).pipe(m(o=>({repositories:o.public_repos})),He({}))}}function Zn(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return Ue(r).pipe(de(()=>L),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),He({}))}function ei(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return Xn(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return Zn(r,o)}return L}var ja;function Wa(e){return ja||(ja=H(()=>{let t=__md_get("__source",sessionStorage);if(t)return j(t);if(oe("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return L}return ei(e.href).pipe(w(o=>__md_set("__source",o,sessionStorage)))}).pipe(de(()=>L),M(t=>Object.keys(t).length>0),m(t=>({facts:t})),J(1)))}function ti(e){let t=W(":scope > :last-child",e);return H(()=>{let r=new x;return r.subscribe(({facts:o})=>{t.appendChild(un(o)),t.classList.add("md-source__repository--active")}),Wa(e).pipe(w(o=>r.next(o)),A(()=>r.complete()),m(o=>R({ref:e},o)))})}function Ua(e,{viewport$:t,header$:r}){return ye(document.body).pipe(E(()=>ar(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),ee("hidden"))}function ri(e,t){return H(()=>{let r=new x;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(te("navigation.tabs.sticky")?j({hidden:!1}):Ua(e,t)).pipe(w(o=>r.next(o)),A(()=>r.complete()),m(o=>R({ref:e},o)))})}function Na(e,{viewport$:t,header$:r}){let o=new Map,n=q("[href^=\\#]",e);for(let a of n){let c=decodeURIComponent(a.hash.substring(1)),p=ce(`[id="${c}"]`);typeof p!="undefined"&&o.set(a,p)}let i=r.pipe(ee("height"),m(({height:a})=>{let c=Ee("main"),p=W(":scope > :first-child",c);return a+.8*(p.offsetTop-c.offsetTop)}),le());return ye(document.body).pipe(ee("height"),E(a=>H(()=>{let c=[];return j([...o].reduce((p,[l,f])=>{for(;c.length&&o.get(c[c.length-1]).tagName>=f.tagName;)c.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let d=f.offsetParent;for(;d;d=d.offsetParent)u+=d.offsetTop;return p.set([...c=[...c,l]].reverse(),u)},new Map))}).pipe(m(c=>new Map([...c].sort(([,p],[,l])=>p-l))),Ge(i),E(([c,p])=>t.pipe(kr(([l,f],{offset:{y:u},size:d})=>{let v=u+d.height>=Math.floor(a.height);for(;f.length;){let[,b]=f[0];if(b-p=u&&!v)f=[l.pop(),...f];else break}return[l,f]},[[],[...c]]),X((l,f)=>l[0]===f[0]&&l[1]===f[1])))))).pipe(m(([a,c])=>({prev:a.map(([p])=>p),next:c.map(([p])=>p)})),V({prev:[],next:[]}),Le(2,1),m(([a,c])=>a.prev.length{let i=new x,s=i.pipe(Z(),re(!0));if(i.subscribe(({prev:a,next:c})=>{for(let[p]of c)p.classList.remove("md-nav__link--passed"),p.classList.remove("md-nav__link--active");for(let[p,[l]]of a.entries())l.classList.add("md-nav__link--passed"),l.classList.toggle("md-nav__link--active",p===a.length-1)}),te("toc.follow")){let a=_(t.pipe(ke(1),m(()=>{})),t.pipe(ke(250),m(()=>"smooth")));i.pipe(M(({prev:c})=>c.length>0),Ge(o.pipe(Se(ae))),ne(a)).subscribe(([[{prev:c}],p])=>{let[l]=c[c.length-1];if(l.offsetHeight){let f=zo(l);if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:d}=he(f);f.scrollTo({top:u-d/2,behavior:p})}}})}return te("navigation.tracking")&&t.pipe(Y(s),ee("offset"),ke(250),je(1),Y(n.pipe(je(1))),Tt({delay:250}),ne(i)).subscribe(([,{prev:a}])=>{let c=pe(),p=a[a.length-1];if(p&&p.length){let[l]=p,{hash:f}=new URL(l.href);c.hash!==f&&(c.hash=f,history.replaceState({},"",`${c}`))}else c.hash="",history.replaceState({},"",`${c}`)}),Na(e,{viewport$:t,header$:r}).pipe(w(a=>i.next(a)),A(()=>i.complete()),m(a=>R({ref:e},a)))})}function Da(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:s}})=>s),Le(2,1),m(([s,a])=>s>a&&a>0),X()),i=r.pipe(m(({active:s})=>s));return B([i,n]).pipe(m(([s,a])=>!(s&&a)),X(),Y(o.pipe(je(1))),re(!0),Tt({delay:250}),m(s=>({hidden:s})))}function ni(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new x,s=i.pipe(Z(),re(!0));return i.subscribe({next({hidden:a}){e.hidden=a,a?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(Y(s),ee("height")).subscribe(({height:a})=>{e.style.top=`${a+16}px`}),h(e,"click").subscribe(a=>{a.preventDefault(),window.scrollTo({top:0})}),Da(e,{viewport$:t,main$:o,target$:n}).pipe(w(a=>i.next(a)),A(()=>i.complete()),m(a=>R({ref:e},a)))}function ii({document$:e,tablet$:t}){e.pipe(E(()=>q(".md-toggle--indeterminate")),w(r=>{r.indeterminate=!0,r.checked=!1}),se(r=>h(r,"change").pipe(Rr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ne(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function Va(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function ai({document$:e}){e.pipe(E(()=>q("[data-md-scrollfix]")),w(t=>t.removeAttribute("data-md-scrollfix")),M(Va),se(t=>h(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function si({viewport$:e,tablet$:t}){B([We("search"),t]).pipe(m(([r,o])=>r&&!o),E(r=>j(r).pipe(ze(r?400:100))),ne(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function za(){return location.protocol==="file:"?ht(`${new URL("search/search_index.js",Qr.base)}`).pipe(m(()=>__index),J(1)):Ue(new URL("search/search_index.json",Qr.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var nt=Uo(),_t=Bo(),gt=Jo(_t),Yr=Yo(),Te=nn(),lr=Fr("(min-width: 960px)"),pi=Fr("(min-width: 1220px)"),li=Xo(),Qr=me(),mi=document.forms.namedItem("search")?za():Ve,Br=new x;Fn({alert$:Br});var Gr=new x;te("navigation.instant")&&Wn({location$:_t,viewport$:Te,progress$:Gr}).subscribe(nt);var ci;((ci=Qr.version)==null?void 0:ci.provider)==="mike"&&qn({document$:nt});_(_t,gt).pipe(ze(125)).subscribe(()=>{Ke("drawer",!1),Ke("search",!1)});Yr.pipe(M(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=ce("link[rel=prev]");typeof t!="undefined"&&ot(t);break;case"n":case".":let r=ce("link[rel=next]");typeof r!="undefined"&&ot(r);break;case"Enter":let o=Re();o instanceof HTMLLabelElement&&o.click()}});ii({document$:nt,tablet$:lr});ai({document$:nt});si({viewport$:Te,tablet$:lr});var Xe=kn(Ee("header"),{viewport$:Te}),Lt=nt.pipe(m(()=>Ee("main")),E(e=>Rn(e,{viewport$:Te,header$:Xe})),J(1)),qa=_(...oe("consent").map(e=>cn(e,{target$:gt})),...oe("dialog").map(e=>Cn(e,{alert$:Br})),...oe("header").map(e=>Hn(e,{viewport$:Te,header$:Xe,main$:Lt})),...oe("palette").map(e=>Pn(e)),...oe("progress").map(e=>In(e,{progress$:Gr})),...oe("search").map(e=>Gn(e,{index$:mi,keyboard$:Yr})),...oe("source").map(e=>ti(e))),Ka=H(()=>_(...oe("announce").map(e=>sn(e)),...oe("content").map(e=>An(e,{viewport$:Te,target$:gt,print$:li})),...oe("content").map(e=>te("search.highlight")?Jn(e,{index$:mi,location$:_t}):L),...oe("header-title").map(e=>$n(e,{viewport$:Te,header$:Xe})),...oe("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?jr(pi,()=>Kr(e,{viewport$:Te,header$:Xe,main$:Lt})):jr(lr,()=>Kr(e,{viewport$:Te,header$:Xe,main$:Lt}))),...oe("tabs").map(e=>ri(e,{viewport$:Te,header$:Xe})),...oe("toc").map(e=>oi(e,{viewport$:Te,header$:Xe,main$:Lt,target$:gt})),...oe("top").map(e=>ni(e,{viewport$:Te,header$:Xe,main$:Lt,target$:gt})))),fi=nt.pipe(E(()=>Ka),qe(qa),J(1));fi.subscribe();window.document$=nt;window.location$=_t;window.target$=gt;window.keyboard$=Yr;window.viewport$=Te;window.tablet$=lr;window.screen$=pi;window.print$=li;window.alert$=Br;window.progress$=Gr;window.component$=fi;})(); +//# sourceMappingURL=bundle.aecac24b.min.js.map + diff --git a/assets/javascripts/bundle.aecac24b.min.js.map b/assets/javascripts/bundle.aecac24b.min.js.map new file mode 100644 index 00000000..b1534de5 --- /dev/null +++ b/assets/javascripts/bundle.aecac24b.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/clipboard/dist/clipboard.js", "node_modules/escape-html/index.js", "src/templates/assets/javascripts/bundle.ts", "node_modules/rxjs/node_modules/tslib/tslib.es6.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/EmptyError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/throwIfEmpty.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/first.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/sample.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/templates/assets/javascripts/browser/document/index.ts", "src/templates/assets/javascripts/browser/element/_/index.ts", "src/templates/assets/javascripts/browser/element/focus/index.ts", "src/templates/assets/javascripts/browser/element/offset/_/index.ts", "src/templates/assets/javascripts/browser/element/offset/content/index.ts", "src/templates/assets/javascripts/utilities/h/index.ts", "src/templates/assets/javascripts/utilities/round/index.ts", "src/templates/assets/javascripts/browser/script/index.ts", "src/templates/assets/javascripts/browser/element/size/_/index.ts", "src/templates/assets/javascripts/browser/element/size/content/index.ts", "src/templates/assets/javascripts/browser/element/visibility/index.ts", "src/templates/assets/javascripts/browser/toggle/index.ts", "src/templates/assets/javascripts/browser/keyboard/index.ts", "src/templates/assets/javascripts/browser/location/_/index.ts", "src/templates/assets/javascripts/browser/location/hash/index.ts", "src/templates/assets/javascripts/browser/media/index.ts", "src/templates/assets/javascripts/browser/request/index.ts", "src/templates/assets/javascripts/browser/viewport/offset/index.ts", "src/templates/assets/javascripts/browser/viewport/size/index.ts", "src/templates/assets/javascripts/browser/viewport/_/index.ts", "src/templates/assets/javascripts/browser/viewport/at/index.ts", "src/templates/assets/javascripts/browser/worker/index.ts", "src/templates/assets/javascripts/_/index.ts", "src/templates/assets/javascripts/components/_/index.ts", "src/templates/assets/javascripts/components/announce/index.ts", "src/templates/assets/javascripts/components/consent/index.ts", "src/templates/assets/javascripts/components/content/annotation/_/index.ts", "src/templates/assets/javascripts/templates/tooltip/index.tsx", "src/templates/assets/javascripts/templates/annotation/index.tsx", "src/templates/assets/javascripts/templates/clipboard/index.tsx", "src/templates/assets/javascripts/templates/search/index.tsx", "src/templates/assets/javascripts/templates/source/index.tsx", "src/templates/assets/javascripts/templates/tabbed/index.tsx", "src/templates/assets/javascripts/templates/table/index.tsx", "src/templates/assets/javascripts/templates/version/index.tsx", "src/templates/assets/javascripts/components/content/annotation/list/index.ts", "src/templates/assets/javascripts/components/content/annotation/block/index.ts", "src/templates/assets/javascripts/components/content/code/_/index.ts", "src/templates/assets/javascripts/components/content/details/index.ts", "src/templates/assets/javascripts/components/content/mermaid/index.css", "src/templates/assets/javascripts/components/content/mermaid/index.ts", "src/templates/assets/javascripts/components/content/table/index.ts", "src/templates/assets/javascripts/components/content/tabs/index.ts", "src/templates/assets/javascripts/components/content/_/index.ts", "src/templates/assets/javascripts/components/dialog/index.ts", "src/templates/assets/javascripts/components/header/_/index.ts", "src/templates/assets/javascripts/components/header/title/index.ts", "src/templates/assets/javascripts/components/main/index.ts", "src/templates/assets/javascripts/components/palette/index.ts", "src/templates/assets/javascripts/components/progress/index.ts", "src/templates/assets/javascripts/integrations/clipboard/index.ts", "src/templates/assets/javascripts/integrations/sitemap/index.ts", "src/templates/assets/javascripts/integrations/instant/index.ts", "src/templates/assets/javascripts/integrations/search/highlighter/index.ts", "src/templates/assets/javascripts/integrations/search/worker/message/index.ts", "src/templates/assets/javascripts/integrations/search/worker/_/index.ts", "src/templates/assets/javascripts/integrations/version/index.ts", "src/templates/assets/javascripts/components/search/query/index.ts", "src/templates/assets/javascripts/components/search/result/index.ts", "src/templates/assets/javascripts/components/search/share/index.ts", "src/templates/assets/javascripts/components/search/suggest/index.ts", "src/templates/assets/javascripts/components/search/_/index.ts", "src/templates/assets/javascripts/components/search/highlight/index.ts", "src/templates/assets/javascripts/components/sidebar/index.ts", "src/templates/assets/javascripts/components/source/facts/github/index.ts", "src/templates/assets/javascripts/components/source/facts/gitlab/index.ts", "src/templates/assets/javascripts/components/source/facts/_/index.ts", "src/templates/assets/javascripts/components/source/_/index.ts", "src/templates/assets/javascripts/components/tabs/index.ts", "src/templates/assets/javascripts/components/toc/index.ts", "src/templates/assets/javascripts/components/top/index.ts", "src/templates/assets/javascripts/patches/indeterminate/index.ts", "src/templates/assets/javascripts/patches/scrollfix/index.ts", "src/templates/assets/javascripts/patches/scrolllock/index.ts", "src/templates/assets/javascripts/polyfills/index.ts"], + "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*\n * Copyright (c) 2016-2023 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"focus-visible\"\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getActiveElement,\n getOptionalElement,\n requestJSON,\n setLocation,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchScript,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountAnnounce,\n mountBackToTop,\n mountConsent,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountProgress,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantNavigation,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Functions - @todo refactor\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch search index\n *\n * @returns Search index observable\n */\nfunction fetchSearchIndex(): Observable {\n if (location.protocol === \"file:\") {\n return watchScript(\n `${new URL(\"search/search_index.js\", config.base)}`\n )\n .pipe(\n // @ts-ignore - @todo fix typings\n map(() => __index),\n shareReplay(1)\n )\n } else {\n return requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget(location$)\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? fetchSearchIndex()\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up progress indicator */\nconst progress$ = new Subject()\n\n/* Set up instant navigation, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantNavigation({ location$, viewport$, progress$ })\n .subscribe(document$)\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"link[rel=prev]\")\n if (typeof prev !== \"undefined\")\n setLocation(prev)\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"link[rel=next]\")\n if (typeof next !== \"undefined\")\n setLocation(next)\n break\n\n /* Expand navigation, see https://bit.ly/3ZjG5io */\n case \"Enter\":\n const active = getActiveElement()\n if (active instanceof HTMLLabelElement)\n active.click()\n }\n })\n\n/* Set up patches */\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Consent */\n ...getComponentElements(\"consent\")\n .map(el => mountConsent(el, { target$ })),\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Progress bar */\n ...getComponentElements(\"progress\")\n .map(el => mountProgress(el, { progress$ })),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Announcement bar */\n ...getComponentElements(\"announce\")\n .map(el => mountAnnounce(el)),\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { viewport$, target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, {\n viewport$, header$, main$, target$\n })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.progress$ = progress$ /* Progress indicator subject */\nwindow.component$ = component$ /* Component observable */\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification, subscriber: Subscriber) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification(value: T) {\n return createNotification('N', value, undefined) as NextNotification;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber\n */\nexport class Subscriber extends Subscription implements Observer {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber | Observer; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber | Observer) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver implements Observer {\n constructor(private partialObserver: Partial>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber extends Subscriber {\n constructor(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined),\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent\n * @param subscriber The stopped subscriber\n */\nfunction handleStoppedNotification(notification: ObservableNotification, subscriber: Subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe(fn1: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction,\n ...fns: UnaryFunction[]\n): UnaryFunction;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array>): UnaryFunction {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray(fns: Array>): UnaryFunction {\n if (fns.length === 0) {\n return identity as UnaryFunction;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable\n */\nexport class Observable implements Subscribable {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator | undefined;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new observable\n * @nocollapse\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => {\n return new Observable(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param operator the operator defining the operation to take on the observable\n * @return a new observable with the Operator applied\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift(operator?: Operator): Observable {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * Use it when you have all these Observables, but still nothing is happening.\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {Subscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next a handler for each value emitted by the observable\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void): Promise;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable;\n pipe(op1: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction,\n ...operations: OperatorFunction[]\n ): Observable;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n */\n pipe(...operations: OperatorFunction[]): Observable {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @method toPromise\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver(value: any): value is Observer {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber(value: any): value is Subscriber {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate(\n init: (liftedSource: Observable, subscriber: Subscriber) => (() => void) | void\n): OperatorFunction {\n return (source: Observable) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber, liftedSource: Observable) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n", "import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber extends Subscriber {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n", "import { Subscription } from '../Subscription';\n\ninterface AnimationFrameProvider {\n schedule(callback: FrameRequestCallback): Subscription;\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n delegate:\n | {\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n }\n | undefined;\n}\n\nexport const animationFrameProvider: AnimationFrameProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel: typeof cancelAnimationFrame | undefined = cancelAnimationFrame;\n const { delegate } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request((timestamp) => {\n // Clear the cancel function. The request has been fulfilled, so\n // attempting to cancel the request upon unsubscription would be\n // pointless.\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel?.(handle));\n },\n requestAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.requestAnimationFrame || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.cancelAnimationFrame || cancelAnimationFrame)(...args);\n },\n delegate: undefined,\n};\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject extends Observable implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @nocollapse\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = (destination: Observer, source: Observable): AnonymousSubject => {\n return new AnonymousSubject(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift(operator: Operator): Observable {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable {\n const observable: any = new Observable();\n observable.source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject\n */\nexport class AnonymousSubject extends Subject {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer,\n source?: Observable\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { TimestampProvider } from '../types';\n\ninterface DateTimestampProvider extends TimestampProvider {\n delegate: TimestampProvider | undefined;\n}\n\nexport const dateTimestampProvider: DateTimestampProvider = {\n now() {\n // Use the variable rather than `this` so that the function can be called\n // without being bound to the provider.\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n", "import { Subject } from './Subject';\nimport { TimestampProvider } from './types';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * A variant of {@link Subject} that \"replays\" old values to new subscribers by emitting them when they first subscribe.\n *\n * `ReplaySubject` has an internal buffer that will store a specified number of values that it has observed. Like `Subject`,\n * `ReplaySubject` \"observes\" values by having them passed to its `next` method. When it observes a value, it will store that\n * value for a time determined by the configuration of the `ReplaySubject`, as passed to its constructor.\n *\n * When a new subscriber subscribes to the `ReplaySubject` instance, it will synchronously emit all values in its buffer in\n * a First-In-First-Out (FIFO) manner. The `ReplaySubject` will also complete, if it has observed completion; and it will\n * error if it has observed an error.\n *\n * There are two main configuration items to be concerned with:\n *\n * 1. `bufferSize` - This will determine how many items are stored in the buffer, defaults to infinite.\n * 2. `windowTime` - The amount of time to hold a value in the buffer before removing it from the buffer.\n *\n * Both configurations may exist simultaneously. So if you would like to buffer a maximum of 3 values, as long as the values\n * are less than 2 seconds old, you could do so with a `new ReplaySubject(3, 2000)`.\n *\n * ### Differences with BehaviorSubject\n *\n * `BehaviorSubject` is similar to `new ReplaySubject(1)`, with a couple of exceptions:\n *\n * 1. `BehaviorSubject` comes \"primed\" with a single value upon construction.\n * 2. `ReplaySubject` will replay values, even after observing an error, where `BehaviorSubject` will not.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n * @see {@link shareReplay}\n */\nexport class ReplaySubject extends Subject {\n private _buffer: (T | number)[] = [];\n private _infiniteTimeWindow = true;\n\n /**\n * @param bufferSize The size of the buffer to replay on subscription\n * @param windowTime The amount of time the buffered items will stay buffered\n * @param timestampProvider An object with a `now()` method that provides the current timestamp. This is used to\n * calculate the amount of time something has been buffered.\n */\n constructor(\n private _bufferSize = Infinity,\n private _windowTime = Infinity,\n private _timestampProvider: TimestampProvider = dateTimestampProvider\n ) {\n super();\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n\n next(value: T): void {\n const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._trimBuffer();\n\n const subscription = this._innerSubscribe(subscriber);\n\n const { _infiniteTimeWindow, _buffer } = this;\n // We use a copy here, so reentrant code does not mutate our array while we're\n // emitting it to a new subscriber.\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i] as T);\n }\n\n this._checkFinalizedStatuses(subscriber);\n\n return subscription;\n }\n\n private _trimBuffer() {\n const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;\n // If we don't have an infinite buffer size, and we're over the length,\n // use splice to truncate the old buffer values off. Note that we have to\n // double the size for instances where we're not using an infinite time window\n // because we're storing the values and the timestamps in the same array.\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n\n // Now, if we're not in an infinite time window, remove all values where the time is\n // older than what is allowed.\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n // Search the array for the first timestamp that isn't expired and\n // truncate the buffer up to that point.\n for (let i = 1; i < _buffer.length && (_buffer[i] as number) <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action\n */\nexport class Action extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearIntervalFunction = (handle: TimerHandle) => void;\n\ninterface IntervalProvider {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n delegate:\n | {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n }\n | undefined;\n}\n\nexport const intervalProvider: IntervalProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setInterval(handler: () => void, timeout?: number, ...args) {\n const { delegate } = intervalProvider;\n if (delegate?.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return (delegate?.clearInterval || clearInterval)(handle as any);\n },\n delegate: undefined,\n};\n", "import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncAction extends Action {\n public id: TimerHandle | undefined;\n public state?: T;\n // @ts-ignore: Property has no initializer and is not definitely assigned\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id ?? this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, _id?: TimerHandle, delay: number = 0): TimerHandle {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(_scheduler: AsyncScheduler, id?: TimerHandle, delay: number | null = 0): TimerHandle | undefined {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, _delay: number): any {\n let errored: boolean = false;\n let errorValue: any;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n // HACK: Since code elsewhere is relying on the \"truthiness\" of the\n // return here, we can't have it return \"\" or 0 or false.\n // TODO: Clean this up when we refactor schedulers mid-version-8 or so.\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n\n this.work = this.state = this.scheduler = null!;\n this.pending = false;\n\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null!;\n super.unsubscribe();\n }\n }\n}\n", "import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}. Will be made internal in v8.\n */\nexport class Scheduler implements SchedulerLike {\n public static now: () => number = dateTimestampProvider.now;\n\n constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncScheduler extends Scheduler {\n public actions: Array> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @internal\n */\n public _active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @internal\n */\n public _scheduled: TimerHandle | undefined;\n\n constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {\n super(SchedulerAction, now);\n }\n\n public flush(action: AsyncAction): void {\n const { actions } = this;\n\n if (this._active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this._active = true;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()!)); // exhaust the scheduler queue\n\n this._active = false;\n\n if (error) {\n while ((action = actions.shift()!)) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * Schedule task as if you used setTimeout(task, duration)\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\n\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8.\n */\nexport const async = asyncScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\nimport { animationFrameProvider } from './animationFrameProvider';\nimport { TimerHandle } from './timerHandle';\n\nexport class AnimationFrameAction extends AsyncAction {\n constructor(protected scheduler: AnimationFrameScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle | undefined {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue has no remaining actions with the same async id,\n // cancel the requested animation frame and set the scheduled flag to\n // undefined so the next AnimationFrameAction will request its own.\n const { actions } = scheduler;\n if (id != null && actions[actions.length - 1]?.id !== id) {\n animationFrameProvider.cancelAnimationFrame(id as number);\n scheduler._scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n this._active = true;\n // The async id that effects a call to flush is stored in _scheduled.\n // Before executing an action, it's necessary to check the action's async\n // id to determine whether it's supposed to be executed in the current\n // flush.\n // Previous implementations of this method used a count to determine this,\n // but that was unsound, as actions that are unsubscribed - i.e. cancelled -\n // are removed from the actions array and that can shift actions that are\n // scheduled to be executed in a subsequent flush into positions at which\n // they are executed within the current flush.\n const flushId = this._scheduled;\n this._scheduled = undefined;\n\n const { actions } = this;\n let error: any;\n action = action || actions.shift()!;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n\n this._active = false;\n\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * Perform task when `window.requestAnimationFrame` would fire\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html:
\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\n\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8.\n */\nexport const animationFrame = animationFrameScheduler;\n", "import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * A simple Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n *\n * ![](empty.png)\n *\n * A simple Observable that only emits the complete notification. It can be used\n * for composing with other Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n *\n * Log complete notification\n *\n * ```ts\n * import { EMPTY } from 'rxjs';\n *\n * EMPTY.subscribe({\n * next: () => console.log('Next'),\n * complete: () => console.log('Complete!')\n * });\n *\n * // Outputs\n * // Complete!\n * ```\n *\n * Emit the number 7, then complete\n *\n * ```ts\n * import { EMPTY, startWith } from 'rxjs';\n *\n * const result = EMPTY.pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n *\n * // Outputs\n * // 7\n * ```\n *\n * Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`\n *\n * ```ts\n * import { interval, mergeMap, of, EMPTY } from 'rxjs';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1, print a, b, c (each on its own)\n * // if x % 2 is not equal to 1, nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link NEVER}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const EMPTY = new Observable((subscriber) => subscriber.complete());\n\n/**\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable((subscriber) => scheduler.schedule(() => subscriber.complete()));\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && isFunction(value.schedule);\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\n\nfunction last(arr: T[]): T | undefined {\n return arr[arr.length - 1];\n}\n\nexport function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\n\nexport function popScheduler(args: any[]): SchedulerLike | undefined {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\n\nexport function popNumber(args: any[], defaultValue: number): number {\n return typeof last(args) === 'number' ? args.pop()! : defaultValue;\n}\n", "export const isArrayLike = ((x: any): x is ArrayLike => x && typeof x.length === 'number' && typeof x !== 'function');", "import { isFunction } from \"./isFunction\";\n\n/**\n * Tests to see if the object is \"thennable\".\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike {\n return isFunction(value?.then);\n}\n", "import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable {\n return isFunction(input[Symbol_observable]);\n}\n", "import { isFunction } from './isFunction';\n\nexport function isAsyncIterable(obj: any): obj is AsyncIterable {\n return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);\n}\n", "/**\n * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.\n * @param input The object that was passed.\n */\nexport function createInvalidObservableTypeError(input: any) {\n // TODO: We should create error codes that can be looked up, so this can be less verbose.\n return new TypeError(\n `You provided ${\n input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`\n } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`\n );\n}\n", "export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n", "import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable {\n return isFunction(input?.[Symbol_iterator]);\n}\n", "import { ReadableStreamLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport async function* readableStreamLikeToAsyncGenerator(readableStream: ReadableStreamLike): AsyncGenerator {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n return;\n }\n yield value!;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function isReadableStreamLike(obj: any): obj is ReadableStreamLike {\n // We don't want to use instanceof checks because they would return\n // false for instances from another Realm, like an

+

Managing API rate limits

+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/mock-server/index.html b/developer-tools/mock-server/index.html new file mode 100644 index 00000000..7fc433e5 --- /dev/null +++ b/developer-tools/mock-server/index.html @@ -0,0 +1,1814 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mock Server - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Mock Server

+ +

Build a Mock Server with Postman

+

Mock servers can be used as a tool for testing APIs. They simulate the behavior of a real server allowing developers to test their applications without calling the real service.

+

Let's say that you want to build the frontend of your travel application without consuming your free quota to call the Amadeus for Developers APIs. In this tutorial show you how to build a mock server.

+

Prerequisites

+ +

Let's now check step-by-step to create a mock server.

+

1. Save a request and response example

+

For the sake of the tutorial we will show you how to create a mock server for the Travel Recommendations API. We will make one request to the Amadeus API and then we will mock the request and response. To learn how to make an API call with Postman, please check this step-by-step guide.

+

Open your Postman application and generate your Amadeus access token as described in the guide above. Then go to Amadeus for Developers > Trip > Artificial Intelligenge > GET Travel Recommendations and make an API call.

+

Click on Save Response > Save as example, and in the same directory you will see the example that you just saved within your collection.

+

1

+

2. Add the API and example in a new collection

+

In Postman, you always need to create a mock server for a whole collection. That's why in this case you will create a new collection to contain only the API we are going to mock.

+

Let's create a new Postman collection. On the top left of your screen click New > Collection and you will see the new collection with the name New Collection. Feel free to give another name, in our case is called Mock - Travel Recommendations.

+

Now you are able to add the Travel Recommendations API to the collection. To do so, duplicate the GET Travel Recommendations API, which can be found at the collection Amadeus for Developers > Trip > Artificial Intelligenge > GET Travel Recommendations and drag & drop it your new collection. Your workspace will now look like:

+

2

+

3. Build the mock server

+

In order to create a mock server go to New > Mock Server > Select an existing collection and choose the collection you just created.

+

In the next step you can see several options to configure your server. Give a name and click the Create a Mock Server button.

+

3

+

The mock server generates a URL in which your requests will be sent to. Make sure to copy the URL because you will need it for the next step.

+

4

+

For this tutorial you built a public mock server, which means that anyone with access to the URL will be able to perform requests. If you want to keep it private, you will have to get a Postman API key and pass it to the request headers.

+

4. Send a request to the mock server

+

On the top left click on New > HTTP Request and create a GET request. For the base URL use the mock server's one, and contatenate the same path and parameters from the saved example. The full request now looks like:

+

GET https://3492878a-5eb2-4837-b97b-b5e2669a18e9.mock.pstmn.io/v1/reference-data/recommended-locations?cityCodes=PAR&travelerCountryCode=FR

+

Perform the API request and you will get as response, the one that we saved earlier.

+

5

+

You can also paste the full URL in your browser and get the results, since it's a public mock server.

+

6

+

Congratulations! You've created a mock server in Postman. You can now use this server in your code to mock several requests, successful responses and error messages according to your development needs.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/node/index.html b/developer-tools/node/index.html new file mode 100644 index 00000000..363f2652 --- /dev/null +++ b/developer-tools/node/index.html @@ -0,0 +1,1970 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Node - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Node

+

Node SDK

+

Amadeus Node SDK for Self-service APIs is available with npm(node package manager) and Amadeus for Developers team is continuously updating with new APIs and features.

+

You can refer to the amadeus-node or Amadeus npm package for more details on the changelog.

+

Installation

+

This module has been tested using Node LTS versions. You can install it using Yarn or NPM.

+
npm install amadeus --save
+
+

Getting Started

+

To make your first API call, you will need to register for an Amadeus Developers Account and set up your first application.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
var Amadeus = require('amadeus');
+var amadeus = new Amadeus({
+  clientId: 'REPLACE_BY_YOUR_API_KEY',
+  clientSecret: 'REPLACE_BY_YOUR_API_SECRET'
+});
+
+amadeus.shopping.flightOffersSearch.get({
+    originLocationCode: 'SYD',
+    destinationLocationCode: 'BKK',
+    departureDate: '2022-10-21',
+    adults: '2'
+}).then(function(response){
+  console.log(response.data);
+}).catch(function(responseError){
+  console.log(responseError.code);
+});
+
+

Initialization

+

The client can be initialized directly as below. Your credentials client Id and Client Secret can be found on the Amadeus dashboard.

+
1
+2
+3
+4
+5
// Initialize using parameters
+var amadeus = new Amadeus({
+  clientId: 'REPLACE_BY_YOUR_API_KEY',
+  clientSecret: 'REPLACE_BY_YOUR_API_SECRET'
+});
+
+
+

Warning

+

Remember that hardcoding your credentials is not the best practice due to the potential exposure to others. Read more about best practices for secure API key storage.

+
+

Alternatively, you can initialize by setting up environment variables. In Node, we like to use dotenv package.

+
npm install dotenv
+
+

Put your API credentials in .env file:

+
1
+2
AMADEUS_CLIENT_ID=REPLACE_BY_YOUR_API_KEY,
+AMADEUS_CLIENT_SECRET=REPLACE_BY_YOUR_API_SECRET
+
+

Initialize using dotenv package:

+
1
+2
const dotenv = require('dotenv').config();
+var amadeus = new Amadeus();
+
+
+

Important

+

You will also want to add .env to your .gitingore so that your API credentials aren't included in your git repository.

+
+

If you don't want to use another package, you can also simply export your key in terminal directly to initalize.

+

Export your credentials in terminal:

+

1
+2
export AMADEUS_CLIENT_ID="REPLACE_BY_YOUR_API_KEY"
+export AMADEUS_CLIENT_SECRET="REPLACE_BY_YOUR_API_SECRET"
+
+Initialize:

+
var amadeus = new Amadeus();
+
+

Moving to Production

+

By default, the SDK environment is set to test environment. To switch to production (pay-as-you-go) environment, please change the hostname as follows:

+
1
+2
+3
var amadeus = new Amadeus({
+  hostname: 'production'
+});
+
+

Promises

+

Every API call returns a Promise that either resolves or rejects.

+

Every resolved API call returns a Response object containing a body attribute with the raw response. If the API call contained a JSON response, it will parse the JSON into the result attribute. If this data contains a data key, that will be made available in data attribute.

+

For a failed API call, it returns a ResponseErrorobject containing the (parsed or unparsed) response, the request, and an error code.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
amadeus.referenceData.urls.checkinLinks.get({
+  airlineCode: 'BA'
+}).then(function(response){
+  console.log(response.body);   //=> The raw body
+  console.log(response.result); //=> The fully parsed result
+  console.log(response.data);   //=> The data attribute taken from the result
+}).catch(function(error){
+  console.log(error.response); //=> The response object with (un)parsed data
+  console.log(error.response.request); //=> The details of the request made
+  console.log(error.code); //=> A unique error code to identify the type of error
+});
+
+

Pagination

+

If an API endpoint supports pagination, the other pages are available under the .next, .previous, .last and .first methods.

+
1
+2
+3
+4
+5
+6
+7
+8
+9
amadeus.referenceData.locations.get({
+  keyword: 'LON',
+  subType: 'AIRPORT,CITY'
+}).then(function(response){
+  console.log(response.data); // first page
+  return amadeus.next(response);
+}).then(function(nextResponse){
+  console.log(nextResponse.data); // second page
+});
+
+

If a page is not available, the response will resolve to null.

+

Video Tutorial

+

You can also check the video tutorial on how to get started with the Node SDK.

+

+

Managing API rate limits

+

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Node using the Amadeus Node SDK here.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/openapi-generator/index.html b/developer-tools/openapi-generator/index.html new file mode 100644 index 00000000..7e7a0bcc --- /dev/null +++ b/developer-tools/openapi-generator/index.html @@ -0,0 +1,2033 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OpenAPI Generator - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Generating SDKs from Amadeus OpenAPI specification using the OpenAPI Generator

+

The OpenAPI Generator is an open-source project for generating REST API clients, server stubs, documentation and schemas based on the OpenAPI specification.

+

At Amadeus, we are following the contract-first approach to API development, which is at the core of the OpenAPI Generator's design philosophy. In this way, we only need to create or update an OpenAPI specification for a particluar API, and the OpenAPI Generator will automatically generate the SDKs in various programming languages and create the required API documentation.

+

Amadeus OpenAPI specification

+

We have a dedicated GitHub repository where you can find OpenAPI specification files for all our Self-Serving APIs. The OpenAPI Generator can easily consume these files to output a dedicated SDK for any of the languages that it supports.

+

How to create an SDK from Amadeus OpenAPI specification

+

If you are not familiar with the OpenAPI Generator, the following tutorial may help you get started. We will take Ruby as an example and show you the steps to create a turnkey SDK based on the specification for your required Amadeus API. We will use the City Search API in our example.

+

Step 1. Setting up the OpenAPI Generator

+
+

Information

+

The current stable release version of the OpenAPI Generator at the time of writing this document is 6.0.1.

+
+

There are many ways to set up the OpenAPI Generator. To eliminate the need for any system dependencies, we will run the OpenAPI Generator as a Docker container. As a prerequisite to this, we need to install the Docker Desktop on our host and start running it.

+

Step 2. Downloading the OpenAPI specification for the City Search API

+

Navigate to the Amadeus OpenAPI Specification and download the JSON file for the City Search API specification.

+
+

Information

+

You can use both JSON and YAML files with the OpenAPI Generator.

+
+

Step 3. Creating the Ruby SDK for the City Search API

+
+

Information

+

The docker run command uses the openapi-generator-cli image: https://hub.docker.com/r/openapitools/openapi-generator-cli/.

+
+

Navigate to the directory where you downloaded the City Search API specification and run the following command:

+
1
+2
+3
+4
+5
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/CitySearch_v1_swagger_specification.json \
+  -g ruby \
+  -o /local/city_search_ruby
+
+

This command uses the CitySearch_v1_swagger_specification.json as input (-i) located in the current directory (/local/). It generates (-g) a Ruby SDK (indicated by ruby) and outputs (-o) the files to folder city_search_ruby, which is located in the current directory (/local/).

+

Step 4. Enabling usage of the Ruby SDK for the City Search API

+
+

Information

+

Before using the API you will need to get an access token. Please read our Authorization Guide for more information on how to get your token.

+
+

Navigate to the newly created city_search_ruby folder and open the README.md. This file shows the initial instructions on configuring our Ruby SDK for the City Search API.

+

Follow the instructions in the README.md to build the code into a gem and install it locally by running the following command from the city_search_ruby directory:

+
1
+2
gem build ./openapi_client.gemspec
+gem install ./openapi_client-1.0.0.gem
+
+
+

Information

+

You may need to run this command with administrator privileges (sudo).

+
+

Now we have a full-featured Ruby SDK that is ready for production usage.

+

Step 5. Customising the Ruby SDK for the City Search API

+

There are several ways to customise an SDK created by the OpenAPI Generator:

+
    +
  • Using a configuration file
  • +
  • Using command line arguments
  • +
  • Using mustache templates
  • +
+
Configuration file
+

There is a number of configuration options that the OpenAPI Generator supports for Ruby.

+

To apply them, we need to create a JSON file with the required parameters and define it when running the OpenAPI Generator. Let's create a file called config.json with the following contents:

+
1
+2
+3
+4
+5
+6
+7
+8
{
+"gemName": "Amadeus_City_Search",
+"gemSummary": "A ruby wrapper for the Amadeus City Search API", 
+"moduleName": "CitySearch",
+"gemLicense": "MIT",
+"gemVersion": "0.3.1",
+"gemRequiredRubyVersion": "2.1"
+}
+
+

To generate an SDK with these custom parameters, put the config.json file into the same directory as the source OpenAPI specification file and run:

+
1
+2
+3
+4
+5
+6
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/CitySearch_v1_swagger_specification.json \
+  -g ruby \
+  -o /local/city_search_ruby \
+  -c config.json \
+
+
Command line arguments
+

Instead of using a configuration file, we can specify the custom parameters as additional properties, separated by a comma:

+
1
+2
+3
+4
+5
+6
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/CitySearch_v1_swagger_specification.json \
+  -g ruby \
+  -o /local/city_search_ruby \
+- -additional-properties gemVersion=0.3.1,gemName=Amadeus_City_Search
+
+

You can otherwise specify the parameters directly, for example:

+
--git-user-id openapi-generator-user --git-repo-id AmadeusCitySearch
+
+

This command will upload the SDK to a repository AmadeusCitySearch by the user called openapi-generator-user.

+
Mustache template
+

To customise the SDK beyond the custom parameters, we can use mustache templates. The GitHub repository of the OpenAPI Generator contains default mustache templates at tree/master/modules/openapi-generator/src/main/resources/. For our Ruby Client SDK, we will need the api_client_spec template.

+

Download the template and customise it as required. After that, attach the template to the OpenAPI run command as follows:

+
1
+2
+3
+4
+5
+6
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/CitySearch_v1_swagger_specification.json \
+  -g ruby \
+  -o /local/city_search_ruby
+  -t <path-to-template-directory>
+
+

Replace <path-to-template-directory> with the path to the template directory.

+

Step 6. Integrating the Ruby SDK for the City Search API with other libraries

+

Suppose we want to integrate our City Search Ruby SDK into an existing application that already contains many models defined in third-party libraries. One of these models may contain a model whose name is the same as in our City Search Ruby SDK. A solution to this is to add a prefix to all models generated by OpenAPI Generator using the +--model-name-prefix setting. For example:

+
1
+2
+3
+4
+5
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/CitySearch_v1_swagger_specification.json \
+  -g ruby --model-name-prefix Amadeus \
+  -o /local/city_search_ruby
+
+

In this way, all models in our SDK will be prefixed with Amadeus, e.g. AmadeusComponent.

+

Conclusion

+

In this tutorial we have seen how easy it is to generate a basic SDK from our API specification files using the OpenAPI Generator. We took Ruby as an example, but the OpenAPI Generator supports many other languages, so you can easily find a solution that meets your requirements.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/php/index.html b/developer-tools/php/index.html new file mode 100644 index 00000000..00de6e50 --- /dev/null +++ b/developer-tools/php/index.html @@ -0,0 +1,1981 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PHP - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

PHP

+

PHP SDK

+
+

Warning

+

The Amadeus PHP SDK is maintained independently by the developer community and is not supported or maintained by the Amadeus for Developers team.

+
+

Prerequisites

+ +

Installation

+

The PHP SDK has been uploaded to the official PHP package repository.

+
composer require amadeus4dev/amadeus-php
+
+

Making your first API call

+

Request

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
<?php declare(strict_types=1);
+
+use Amadeus\Amadeus;
+use Amadeus\Exceptions\ResponseException;
+
+require __DIR__ . '/vendor/autoload.php'; // include composer autoloader
+
+try {
+    $amadeus = Amadeus::builder("REPLACE_BY_YOUR_API_KEY", "REPLACE_BY_YOUR_API_SECRET")
+        ->build();
+
+    // Flight Offers Search GET
+    $flightOffers = $amadeus->getShopping()->getFlightOffers()->get(
+                        array(
+                            "originLocationCode" => "PAR",
+                            "destinationLocationCode" => "MAD",
+                            "departureDate" => "2023-08-29",
+                            "adults" => 1
+                        )
+                    );
+    print $flightOffers[0];
+
+    // Flight Offers Search POST
+    $body ='{
+              "originDestinations": [
+                {
+                  "id": "1",
+                  "originLocationCode": "PAR",
+                  "destinationLocationCode": "MAD",
+                  "departureDateTimeRange": {
+                    "date": "2023-08-29"
+                  }
+                }
+              ],
+              "travelers": [
+                {
+                  "id": "1",
+                  "travelerType": "ADULT"
+                }
+              ],
+              "sources": [
+                "GDS"
+              ]
+            }';
+    $flightOffers = $amadeus->getShopping()->getFlightOffers()->post($body);
+    print $flightOffers[0];
+} catch (ResponseException $e) {
+    print $e;
+}
+
+

Handling the response

+

Every API call returns a Response object which contains raw response body in string format:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
$locations = $amadeus->getReferenceData()->getLocations()->get(
+                array(
+                    "subType" => "CITY",
+                    "keyword" => "PAR"
+                )
+            );
+
+// The raw response, as a string
+$locations[0]->getResponse()->getResult(); // Include response headers
+$locations[0]->getResponse()->getBody(); //Without response headers
+
+// Directly get response headers as an array
+$locations[0]->getResponse()->getHeadersAsArray();
+
+// Directly get response body as a Json Object
+$locations[0]->getResponse()->getBodyAsJsonObject();
+
+// Directly get the data part of response body
+$locations[0]->getResponse()->getData();
+
+

Arbitrary API calls

+

You can call any API not yet supported by the SDK by making arbitrary calls.

+

For the get endpoints:

+
1
+2
+3
+4
+5
// Make a GET request only using path
+$amadeus->getClient()->getWithOnlyPath("/v1/airport/direct-destinations?departureAirportCode=MAD");
+
+// Make a GET request using path and passed parameters
+$amadeus->getClient()->getWithArrayParams("/v1/airport/direct-destinations", ["departureAirportCode" => "MAD"]);
+
+

For the post endpoints:

+
$amadeus->getClient()->postWithStringBody("/v1/shopping/availability/flight-availabilities", $body);
+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/postman/index.html b/developer-tools/postman/index.html new file mode 100644 index 00000000..6f300e2f --- /dev/null +++ b/developer-tools/postman/index.html @@ -0,0 +1,1892 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Postman collection - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+ +
+ + + +
+
+ + + + + + + +

Self-Service API Postman collection

+

Follow this tutorial to test Amadeus Self-Service APIs using our dedicated Postman collection.

+

Pre-requisites

+

Before you begin, you need to:

+
    +
  • Register your application with Amadeus for Developers as described in Making your first API call.
  • +
  • Create a new Postman account or use your existing Postman account.
  • +
+

Fork the collection

+
    +
  1. Login to Postman.
  2. +
  3. +

    Navigate to the Amadeus for Developers public workspace.

    +

    1

    +
  4. +
  5. +

    Click Fork.

    +
  6. +
  7. +

    Select Amadeus for Developers from the Environment dropdown.

    +

    2

    +
  8. +
  9. +

    Give the fork a name.

    +
  10. +
  11. Select the workspace where you need to fork the collection to.
  12. +
  13. Tick the Watch original collection box to get notified when the collection is updated.
  14. +
  15. Click Fork Collection. You will be taken to the workspace that you selected previously.
  16. +
+

Fork the environment

+
    +
  1. +

    Navigate to the Amadeus for Developers public workspace.

    +

    1

    +
  2. +
  3. +

    On the left side bar, click Environments.

    +

    6

    +
  4. +
  5. +

    Select ... beside the Amadeus for Developers envoronment and select Create a fork.

    +

    7

    +
  6. +
  7. +

    Give the fork a name.

    +

    8

    +
  8. +
  9. +

    Select the workspace where you need to fork the collection to.

    +
  10. +
  11. Click Fork Environment. You will be taken to the workspace that you selected previously.
  12. +
+

Generate the access token

+
    +
  1. +

    On the right side bar, set the environment to Amadeus for Developers.

    +

    9

    +
  2. +
  3. +

    On the left side bar, click Environments.

    +

    10

    +
  4. +
  5. +

    Enter you API key and secret values into the Current values of the client_id and client_secret parameters respectively.

    +
  6. +
  7. Click Save.
  8. +
  9. On the left side bar, navigate to Collections.
  10. +
  11. Select the Authorization > Access Granted Client Credentials.
  12. +
  13. Click Send without filling out any parameters.
  14. +
  15. You will receive the access_token value in the response.
  16. +
+
+

Note

+

The token is valid for 30 minutes and you must perform the previous step every 30 minutes to generate a new access token.

+
+

Make an API call

+
    +
  1. Select the required API from the collection by navigating to the required endpoint on the left side bar. For example, Air > Search & Shopping > Flight Offers Search.
  2. +
  3. Do not specify the client_id and client_secret parameters, as the access_token obtained previously is already linked to this API.
  4. +
  5. If required, specify the request parameters. Alternatively, you can try the API without setting any parameters, as we have already preconfigured it to display data for the upcoming month.
  6. +
  7. +

    Click Send to make the call.

    +

    11

    +
  8. +
+

Make our preconfigured scenarios

+

To give you a smooth user experience that emulates the actual workflow of a flight and hotel booking engine, we have included Scenarios in the Air and Hotel categories. A scenario combines all required APIs to achive a certain goal (e.g., book a flight) and uses data from each of the API's responses for calling the next API.

+
    +
  1. Select the required scenario from the collection by navigating to the required category on the left side bar. For example, Air > (Scenario)Basic Flight Booking flow.
  2. +
  3. Refresh the access_token by calling the Authorization API.
  4. +
  5. Make a call to the Flight Offers Search to get the offer as a JSON object.
  6. +
  7. Make a call to the Flight Offers Price to get the the price for the offer retrieved in the previous step. This API will automatically use the JSON object of the flight offer search.
  8. +
  9. Make a call to the Flight Create Orders to create an order for the offer retrieved in the previous steps.
  10. +
+

Visualize API responses

+

Some APIs in our Postman include a visualization to present the results graphically for better understanding and interpretation.

+

To access a visualization of an API:

+
    +
  1. Select the required API from the collection by navigating to the required endpoint on the left side bar. For example, Destination Content > Location > Safe Place.
  2. +
  3. Specify the API parameters.
  4. +
  5. Click Send to make the call.
  6. +
  7. +

    Click Visualize at the bottom of the screen.

    +

    12

    +
  8. +
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/developer-tools/python/index.html b/developer-tools/python/index.html new file mode 100644 index 00000000..e1371193 --- /dev/null +++ b/developer-tools/python/index.html @@ -0,0 +1,2319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Python - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Python

+

Python SDK

+

Installation

+

You can call the Amadeus APIs using the Python SDK. The Python SDK has been uploaded to the official Python package +repository, which makes life easier since +you can install the SDK as a regular Python package.

+

Prerequisites

+ +

First step is to create the environment. Switch to your project repository and type:

+
python3 -m venv .venv
+
+

A new folder .venv will be created with everything necessary inside. Let's activate the isolated environment with the following command:

+
source .venv/bin/activate
+
+

From now on, all packages installed using pip will be located under .venv/lib and not in your global /usr/lib folder.

+

Finally, install the Amadeus SDK as follows:

+
pip install amadeus
+
+

You can also add it to your requirements.txt file and install using:

+
pip install -r requirements.txt
+
+

The virtual environment can be disabled by typing:

+
deactivate
+
+

Your first API call

+

This tutorial will guide you through the process of creating a simple Python application which calls the Airport and Search API using the Amadeus for Developers Python SDK.

+

Request

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
from amadeus import Client, Location, ResponseError
+
+amadeus = Client(
+    client_id='AMADEUS_CLIENT_ID',
+    client_secret='AMADEUS_CLIENT_SECRET'
+)
+
+try:
+    response = amadeus.reference_data.locations.get(
+        keyword='LON',
+        subType=Location.AIRPORT
+    )    
+    print(response.data)
+except ResponseError as error:
+    print(error)
+
+
    +
  • Once you import the amadeus library, you initialize the client by adding your credentials in the builder method. The library can also be initialized without any parameters when the environment variables AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET are present.
  • +
  • The authentication process is handled by the SDK and the access token is renewed every 30 minutes.
  • +
  • The SDK uses namespaced methods to create a match between the APIs and the SDK. In this case, the API GET /v1/reference-data/locations?keyword=LON&subType=AIRPORT is implemented as amadeus.reference_data.locations.get(keyword='LON',subType=Location.AIRPORT).
  • +
+

Handling the response

+

Every API call returns a Response object. If the API call contains a JSON response, it will parse the JSON into the .result attribute. If this data also contains a data key, it will make that available as the .data attribute. The raw body of the response is always available as the .body attribute.

+
1
+2
+3
print(response.body) #=> The raw response, as a string
+print(response.result) #=> The body parsed as JSON, if the result was parsable
+print(response.data) #=> The list of locations, extracted from the JSON
+
+

Arbitrary API calls

+

You can call any API not yet supported by the SDK by making arbitrary calls.

+

For the get endpoints:

+
amadeus.get('/v2/reference-data/urls/checkin-links', airlineCode='BA')
+
+

For the post endpoints:

+
amadeus.post('/v1/shopping/flight-offers/pricing', body)
+
+

Video Tutorial

+

You can also check the video tutorial on how to get started with the Python SDK.

+

+

Managing API rate limits

+

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Python using the Amadeus Python SDK here.

+

Python Async API calls

+

In a synchronous program, each step is completed before moving on to the next one. However, an asynchronous program may not wait for each step to be completed. Asynchronous functions can pause and allow other functions to run while waiting for a result. This enables concurrent execution and gives the feeling of working on multiple tasks at the same time.

+

In this guide we are going to show you how to make async API calls in Python to improve the performance of your Python applications.

+

For all these examples we are going to call the Flight-Checkin Links API.

+

Prerequisites

+

To follow along with the tutorial you will need the followings:

+
    +
  • +

    Python version >= 3.8

    +
  • +
  • +

    Amadeus for Developers API key and API secret: to get one, create a free developer account and set up your first application in your Workspace.

    +
  • +
  • +

    aiohttp: you will use the aiohttp library to make asynchronous API calls. You can install it using the command pip install aiohttp.

    +
  • +
  • +

    requests: you will use the requests library for synchronous requests. You can install it using the command pip install requests.

    +
  • +
  • +

    amadeus: the Amadeus Pthon SDK. You can install it using the command pip install amadeus.

    +
  • +
+

Async API calls with aiohttp

+

aiohttp is a Python library for making asynchronous HTTP requests build top of asyncio. The library provides a simple way of making HTTP requests and handling the responses in a non-blocking way.

+

In the example below you can call the the Amadeus Flight-Checkin link API using the aiohttp library and the code runs in an async way.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
import aiohttp
+import asyncio
+import requests
+
+AUTH_ENDPOINT = "https://test.api.amadeus.com/v1/security/oauth2/token"
+headers = {"Content-Type": "application/x-www-form-urlencoded"}
+data = {"grant_type": "client_credentials",
+        "client_id": 'YOUR_AMADEUS_API_KEY',
+        "client_secret": 'YOUR_AMADEUS_API_SECRET'}
+response = requests.post(AUTH_ENDPOINT,
+                        headers=headers,
+                        data=data)
+access_token = response.json()['access_token']
+
+async def main():
+    headers = {'Authorization': 'Bearer' + ' ' + access_token}
+    flight_search_endpoint = 'https://test.api.amadeus.com/v2/reference-data/urls/checkin-links'
+    parameters = {"airlineCode": 'BA'}
+
+    async with aiohttp.ClientSession() as session:
+
+        for number in range(20):
+            async with session.get(flight_search_endpoint,
+                            params=parameters,
+                            headers=headers) as resp:
+                flights = await resp.json()
+                print(flights)
+
+asyncio.run(main())
+
+

The above code makes POST request to the Authentication API using the requests library. The returned access token is then used in the headers of following requests to make 20 asyncronous API calls.

+

Async API calls with thread executor

+

Since we offer the Python SDK we want to show you how you are able to make async API calls using the SDK. The SDK is built using the requests library which only supports synchronous API calls. This means that when you call an API, your application will block and wait for the response. The solution is to use a thread executor to allow run blocking calls in separate threads, as the example below:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
import asyncio
+import requests
+from amadeus import Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+async def main():
+
+        loop = asyncio.get_event_loop()
+        futures = [
+            loop.run_in_executor(
+                None, 
+                requests.get,
+                amadeus.reference_data.urls.checkin_links.get(
+                airlineCode='BA')
+            )
+            for number in range(20)
+            ]
+        for response in await asyncio.gather(*futures):
+            print(response.status_code)
+
+asyncio.run(main())
+
+

OpenAPI Generator

+

In this tutorial, we'll guide you through the process of making your first API calls using the OpenAPI Generator in Python. To begin, you'll need to retrieve the specification files from the GitHub repository. In this example, you will use the Authorization_v1_swagger_specification.yaml and FlightOffersSearch_v2_swagger_specification.yaml files.

+

Before getting started make sure you check out how to [generate client libraries](../developer-tools/openapi-generator.md{:target="_blank"} with the OpenAPI Generator.

+

Call the Authorization endpoint

+

You will now learn how to call the POST https://test.api.amadeus.com/v1/security/oauth2/token endpoint in order to get the Amadeus access token.

+

Open your terminal and generate the Python client with the following command:

+

1
+2
+3
+4
+5
docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/Authorizaton_v1_swagger_specification.yaml  \
+  -g python \
+  -o /local/auth
+
+In your local directory you will see the folder auth which contains the generated library.

+

You can install the library using pip:

+
pip install openapi-client
+
+

Then create a file auth.py and add the following code to generate an Amadeus access token.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
import openapi_client
+from openapi_client.apis.tags import o_auth2_access_token_api
+from openapi_client.model.amadeus_o_auth2_token import AmadeusOAuth2Token
+
+auth_configuration = openapi_client.Configuration()
+with openapi_client.ApiClient(auth_configuration) as api_client:
+    api_instance = o_auth2_access_token_api.OAuth2AccessTokenApi(api_client)
+
+    body = dict(
+        grant_type="client_credentials",
+        client_id="YOUR_API_KEY",
+        client_secret="YOUR_API_SECRET",
+    )
+    api_response = api_instance.oauth2_token(
+        body=body,
+    )
+
+print(api_response.body['access_token'])
+
+

The code uses the library we have generated to get an OAuth2 access token. With the o_auth2_access_token_api.OAuth2AccessTokenApi() we are able to call the oauth2_token() method.

+

The body of the request is being created by passing the grant_type, client_id and client_secret to the oauth2_token() method. If you want to know more about how to get the access token check the authorization guide.

+

Call the Flight Offers Search API

+

Now let's call the Flight Offers Search API. Since thr OpenAPI Generator works with OAS3 you will have to convert the flight search specification to version 3 using the swagger editor (https://editor.swagger.io/){:target="_blank"}. To do the convertion, navigate to the top menu and select Edit then Convert to OAS 3.

+

The process is the same as above. You need to generate the library:

+
1
+2
+3
+4
+5
  docker run --rm \
+  -v ${PWD}:/local openapitools/openapi-generator-cli generate \
+  -i /local/FlightOffersSearch_v2_swagger_specification.yaml \
+  -g python \
+  -o /local/flights
+
+

and then install it in your environment:

+
pip install openapi-client
+
+

Then create a file flights.py and add the following code:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
import openapi_client
+from openapi_client.apis.tags import shopping_api
+
+flight_configuration = openapi_client.Configuration()
+api_client = openapi_client.ApiClient(flight_configuration)
+api_client.default_headers['Authorization'] = 'Bearer YOUR_ACCESS_TOKEN'
+
+api_instance = shopping_api.ShoppingApi(api_client)
+
+query_params = {
+    'originLocationCode': "MAD",
+    'destinationLocationCode': "BCN",
+    'departureDate': "2023-05-02",
+    'adults': 1,
+    'max': 2
+}
+try:
+    api_response = api_instance.get_flight_offers(
+        query_params=query_params,
+    )
+    print(api_response.body)
+except openapi_client.ApiException as e:
+    print("Exception: %s\n" % e)
+
+

The above code uses the generated library to to search for flight offers. It creates an instance of the shopping_api.ShoppingApi class and setting the default headers to include the access token.

+

Then it is calling the get_flight_offers() method to make the API request.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/code-example/index.html b/examples/code-example/index.html new file mode 100644 index 00000000..5126f4eb --- /dev/null +++ b/examples/code-example/index.html @@ -0,0 +1,10976 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code examples - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Code Examples

+

To help you get up and running with the Amadeus Self-Service APIs as smoothly as possible, we have provided code examples for each SDK and API endpoint. Simply copy and paste these examples into your project to make API requests.

+

If you have any questions or ideas for improvement, don't hesitate to raise an issue or a pull request directly from GitHub examples repository.

+

Travel safety

+

Safe Place

+

By geolocation

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns safety information for a location in Barcelona based on geolocation coordinates
+    '''
+    response = amadeus.safety.safety_rated_locations.get(latitude=41.397158, longitude=2.160873)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// How safe is Barcelona? (based a geo location and a radius)
+amadeus.safety.safetyRatedLocations.get({
+  latitude: 41.397158,
+  longitude: 2.160873
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.SafePlace;
+
+
+public class SafePlace {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.get(Params
+              .with("latitude", "41.39715")
+              .and("longitude", "2.160873"));
+
+       if(safetyScore[0].getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + safetyScore[0].getResponse().getStatusCode());
+               System.exit(-1);
+        }
+      System.out.println(safetyScore[0]);
+    }
+}
+
+
+
+
+

By square

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns safety information in Barcelona within a designated area
+    '''
+    response = amadeus.safety.safety_rated_locations.by_square.get(north=41.397158, west=2.160873,
+                                                                   south=41.394582, east=2.177181)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// How safe is Barcelona? (based on a square)
+amadeus.safety.safetyRatedLocations.bySquare.get({
+  north: 41.397158,
+  west: 2.160873,
+  south: 41.394582,
+  east: 2.177181
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.SafePlace;
+
+
+public class SafePlace {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.bySquare.get(Params
+        .with("north", "41.397158")
+        .and("west", "2.160873")
+        .and("south", "41.394582")
+        .and("east", "2.177181"));
+
+       if(safetyScore[0].getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + safetyScore[0].getResponse().getStatusCode());
+               System.exit(-1);
+    }
+      System.out.println(safetyScore[0]);
+    }
+}
+
+
+
+
+

By Id

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns safety information in Barcelona within a designated area
+    '''
+    response = amadeus.safety.safety_rated_location('Q930400801').get()
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What is the safety information of a location based on it's Id?
+amadeus.safety.safetyRatedLocation('Q930400801').get().then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.SafePlace;
+
+
+public class SafePlace {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      SafePlace safetyScore = amadeus.safety.safetyRatedLocation("Q930400801").get();
+
+       if(safetyScore.getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + safetyScore.getResponse().getStatusCode());
+               System.exit(-1);
+    }
+      System.out.println(safetyScore);
+    }
+}
+
+
+
+
+

Flights

+

Airline Routes

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What are the destinations served by the British Airways (BA)?
+    '''
+    response = amadeus.airline.destinations.get(airlineCode='BA')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
const Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_AMADEUS_API_KEY',
+  clientSecret: 'YOUR_AMADEUS_API_SECRET'
+});
+// Or `var amadeus = new Amadeus()` if the environment variables are set
+
+
+// What are the destinations served by the British Airways (BA)?
+amadeus.airline.destinations.get({airlineCode: 'BA'})
+  .then(response => console.log(response))
+  .catch(err => console.error(err));
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Destination;
+
+// What are the destinations served by the British Airways (BA)?
+public class AirlineRoutes {
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Set query parameters
+    Params params = Params
+        .with("airlineCode", "BA");
+
+    // Run the query
+    Destination[] destinations = amadeus.airline.destinations.get(params);
+
+    if (destinations[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + destinations[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(destinations[0]);
+  }
+}
+
+
+
+
+

Airport Routes

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What are the destinations served by MAD airport?
+    '''
+    response = amadeus.airport.direct_destinations.get(departureAirportCode='MAD')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+    clientId: 'YOUR_API_KEY',
+    clientSecret: 'YOUR_API_SECRET'
+});
+
+// Find all destinations served by CDG Airport
+amadeus.airport.directDestinations.get({
+    departureAirportCode: 'MAD',
+}).catch(function (response) {
+    console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Destination;
+
+public class AirportRoutes {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    Destination[] directDestinations = amadeus.airport.directDestinations.get(
+      Params.with("departureAirportCode", "MAD"));
+
+    if (directDestinations[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + directDestinations[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(directDestinations[0]);
+  }
+}
+
+
+
+
+ +

GET

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Find the cheapest flights from SYD to BKK
+    '''
+    response = amadeus.shopping.flight_offers_search.get(
+        originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-07-01', adults=1)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Find the cheapest flights from SYD to BKK
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'SYD',
+  destinationLocationCode: 'BKK',
+  departureDate: '2022-08-01',
+  adults: '2'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+
+public class FlightOffersSearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(
+                  Params.with("originLocationCode", "SYD")
+                          .and("destinationLocationCode", "BKK")
+                          .and("departureDate", "2022-11-01")
+                          .and("returnDate", "2022-11-08")
+                          .and("adults", 2)
+                          .and("max", 3));
+
+    if (flightOffersSearches[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightOffersSearches[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightOffersSearches[0]);
+  }
+}
+
+
+
+
+

POST

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+json_string = '{ "currencyCode": "ZAR", "originDestinations": [ { "id": "1", "originLocationCode": "JNB", ' \
+              '"destinationLocationCode": "CPT", "departureDateTimeRange": { "date": "2022-07-01", "time": "00:00:00" ' \
+              '} }, { "id": "2", "originLocationCode": "CPT", "destinationLocationCode": "JNB", ' \
+              '"departureDateTimeRange": { "date": "2022-07-29", "time": "00:00:00" } } ], "travelers": [ { "id": ' \
+              '"1", "travelerType": "ADULT" }, { "id": "2", "travelerType": "ADULT" }, { "id": "3", "travelerType": ' \
+              '"HELD_INFANT", "associatedAdultId": "1" } ], "sources": [ "GDS" ], "searchCriteria": { ' \
+              '"excludeAllotments": true, "addOneWayOffers": false, "maxFlightOffers": 10, ' \
+              '"allowAlternativeFareOptions": true, "oneFlightOfferPerDay": true, "additionalInformation": { ' \
+              '"chargeableCheckedBags": true, "brandedFares": true, "fareRules": false }, "pricingOptions": { ' \
+              '"includedCheckedBagsOnly": false }, "flightFilters": { "crossBorderAllowed": true, ' \
+              '"moreOvernightsAllowed": true, "returnToDepartureAirport": true, "railSegmentAllowed": true, ' \
+              '"busSegmentAllowed": true, "carrierRestrictions": { "blacklistedInEUAllowed": true, ' \
+              '"includedCarrierCodes": [ "FA" ] }, "cabinRestrictions": [ { "cabin": "ECONOMY", "coverage": ' \
+              '"MOST_SEGMENTS", "originDestinationIds": [ "2" ] }, { "cabin": "ECONOMY", "coverage": "MOST_SEGMENTS", ' \
+              '"originDestinationIds": [ "1" ] } ], "connectionRestriction": { "airportChangeAllowed": true, ' \
+              '"technicalStopsAllowed": true } } } }'
+
+body = json.loads(json_string)
+try:
+    response = amadeus.shopping.flight_offers_search.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Find the cheapest flights from SYD to BKK
+amadeus.shopping.flightOffersSearch.post(JSON.stringify({
+  "currencyCode": "USD",
+  "originDestinations": [{
+    "id": "1",
+    "originLocationCode": "SYD",
+    "destinationLocationCode": "BKK",
+    "departureDateTimeRange": {
+      "date": "2022-08-01",
+      "time": "10:00:00"
+    }
+  },
+  {
+    "id": "2",
+    "originLocationCode": "BKK",
+    "destinationLocationCode": "SYD",
+    "departureDateTimeRange": {
+      "date": "2022-08-05",
+      "time": "17:00:00"
+    }
+  }
+  ],
+  "travelers": [{
+    "id": "1",
+    "travelerType": "ADULT",
+    "fareOptions": [
+      "STANDARD"
+    ]
+  },
+  {
+    "id": "2",
+    "travelerType": "CHILD",
+    "fareOptions": [
+      "STANDARD"
+    ]
+  }
+  ],
+  "sources": [
+    "GDS"
+  ],
+  "searchCriteria": {
+    "maxFlightOffers": 50,
+    "flightFilters": {
+      "cabinRestrictions": [{
+        "cabin": "BUSINESS",
+        "coverage": "MOST_SEGMENTS",
+        "originDestinationIds": [
+          "1"
+        ]
+      }],
+      "carrierRestrictions": {
+        "excludedCarrierCodes": [
+          "AA",
+          "TP",
+          "AZ"
+        ]
+      }
+    }
+  }
+})).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+
+public class FlightOffersSearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    String body = "{\"currencyCode\":\"USD\",\"originDestinations\":[{\"id\":\"1\",\"originLocationCode\":\"RIO\",\"destinationLocationCode\":\"MAD\",\"departureDateTimeRange\":{\"date\":\"2022-08-01\",\"time\":\"10:00:00\"}},{\"id\":\"2\",\"originLocationCode\":\"MAD\",\"destinationLocationCode\":\"RIO\",\"departureDateTimeRange\":{\"date\":\"2022-08-05\",\"time\":\"17:00:00\"}}],\"travelers\":[{\"id\":\"1\",\"travelerType\":\"ADULT\",\"fareOptions\":[\"STANDARD\"]},{\"id\":\"2\",\"travelerType\":\"CHILD\",\"fareOptions\":[\"STANDARD\"]}],\"sources\":[\"GDS\"],\"searchCriteria\":{\"maxFlightOffers\":2,\"flightFilters\":{\"cabinRestrictions\":[{\"cabin\":\"BUSINESS\",\"coverage\":\"MOST_SEGMENTS\",\"originDestinationIds\":[\"1\"]}],\"carrierRestrictions\":{\"excludedCarrierCodes\":[\"AA\",\"TP\",\"AZ\"]}}}}";
+
+    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.post(body);
+
+    if (flightOffersSearches[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightOffersSearches[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightOffersSearches[0]);
+  }
+}
+
+
+
+
+

Flight Offers Price

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Confirm availability and price from SYD to BKK in summer 2022
+    '''
+    flights = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK',
+                                                        departureDate='2022-07-01', adults=1).data
+    response_one_flight = amadeus.shopping.flight_offers.pricing.post(
+        flights[0])
+    print(response_one_flight.data)
+
+    response_two_flights = amadeus.shopping.flight_offers.pricing.post(
+        flights[0:2])
+    print(response_two_flights.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Confirm availability and price from SYD to BKK in summer 2020
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'MAD',
+  destinationLocationCode: 'ATH',
+  departureDate: '2024-07-01',
+  adults: '1'
+}).then(function (flightOffersSearchResponse) {
+  return amadeus.shopping.flightOffers.pricing.post(
+    JSON.stringify({
+      'data': {
+        'type': 'flight-offers-pricing',
+        'flightOffers': [flightOffersSearchResponse.data[0]]
+      }
+    }), {include: 'credit-card-fees,detailed-fare-rules'} 
+  )
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+import com.amadeus.resources.FlightPrice;
+
+public class FlightOffersPrice {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(
+        Params.with("originLocationCode", "SYD")
+                .and("destinationLocationCode", "BKK")
+                .and("departureDate", "2022-11-01")
+                .and("returnDate", "2022-11-08")
+                .and("adults", 1)
+                .and("max", 2));
+
+    // We price the 2nd flight of the list to confirm the price and the availability
+    FlightPrice flightPricing = amadeus.shopping.flightOffersSearch.pricing.post(
+            flightOffersSearches[1],
+            Params.with("include", "detailed-fare-rules")
+              .and("forceClass", "false")
+          );
+
+    System.out.println(flightPricing.getResponse());
+  }
+}
+
+
+
+
+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus/# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Find cheapest destinations from Madrid
+    '''
+    response = amadeus.shopping.flight_destinations.get(origin='MAD')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Find cheapest destinations from Madrid
+amadeus.shopping.flightDestinations.get({
+  origin: 'MAD'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightDestination;
+
+public class FlightInspirationSearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    FlightDestination[] flightDestinations = amadeus.shopping.flightDestinations.get(Params
+    .with("origin", "MAD"));
+
+    if (flightDestinations[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightDestinations[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightDestinations[0]);
+  }
+}
+
+
+
+
+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Find cheapest dates from Madrid to Munich
+    '''
+    response = amadeus.shopping.flight_dates.get(origin='MAD', destination='MUC')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Find cheapest dates from Madrid to Munich
+amadeus.shopping.flightDates.get({
+  origin: 'MAD',
+  destination: 'MUC'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightDate;
+
+public class FlightCheapestDate {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    FlightDate[] flightDates = amadeus.shopping.flightDates.get(Params
+      .with("origin", "MAD")
+      .and("destination", "MUC"));
+
+    if(flightDates[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + (flightDates[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+    System.out.println((flightDates[0]);
+  }
+}
+
+
+
+
+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    body = {
+        "originDestinations": [
+            {
+                "id": "1",
+                "originLocationCode": "MIA",
+                "destinationLocationCode": "ATL",
+                "departureDateTime": {
+                    "date": "2022-11-01"
+                }
+            }
+        ],
+        "travelers": [
+            {
+                "id": "1",
+                "travelerType": "ADULT"
+            }
+        ],
+        "sources": [
+            "GDS"
+        ]
+    }
+
+    response = amadeus.shopping.availability.flight_availabilities.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+    clientId: 'YOUR_API_KEY',
+    clientSecret: 'YOUR_API_SECRET'
+});
+
+body = JSON.stringify({
+    "originDestinations": [
+        {
+            "id": "1",
+            "originLocationCode": "MIA",
+            "destinationLocationCode": "ATL",
+            "departureDateTime": {
+                "date": "2022-11-01"
+            }
+        }
+    ],
+    "travelers": [
+        {
+            "id": "1",
+            "travelerType": "ADULT"
+        }
+    ],
+    "sources": [
+        "GDS"
+    ]
+})
+
+amadeus.shopping.availability.flightAvailabilities.post(body).then(function (response) {
+    console.log(response);
+}).catch(function (response) {
+    console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Response;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightAvailability;
+
+public class FlightAvailabilities {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    String body = "{\"originDestinations\":[{\"id\":\"1\",\"originLocationCode\":\"ATH\",\"destinationLocationCode\":\"SKG\",\"departureDateTime\":{\"date\":\"2023-08-14\",\"time\":\"21:15:00\"}}],\"travelers\":[{\"id\":\"1\",\"travelerType\":\"ADULT\"}],\"sources\":[\"GDS\"]}";
+
+    FlightAvailability[] flightAvailabilities = amadeus.shopping.availability.flightAvailabilities.post(body);
+
+    if (flightAvailabilities[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightAvailabilities[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightAvailabilities[0]);
+  }
+
+}
+
+
+
+
+

Branded Upsell

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
# Install the Python library from https://pypi.org/project/amadeus
+import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    json_string = '{ "data": { "type": "flight-offers-upselling", "flightOffers": [ { "type": "flight-offer", ' \
+                  '"id": "1", ' \
+                  '"source": "GDS", "instantTicketingRequired": false, "nonHomogeneous": false, "oneWay": false, ' \
+                  '"lastTicketingDate": "2022-05-11", "numberOfBookableSeats": 9, "itineraries": [ { "duration": ' \
+                  '"PT2H10M", ' \
+                  '"segments": [ { "departure": { "iataCode": "CDG", "terminal": "3", "at": "2022-07-04T20:45:00" }, ' \
+                  '"arrival": { ' \
+                  '"iataCode": "MAD", "terminal": "4", "at": "2022-07-04T22:55:00" }, "carrierCode": "IB", ' \
+                  '"number": "3741", ' \
+                  '"aircraft": { "code": "32A" }, "operating": { "carrierCode": "I2" }, "duration": "PT2H10M", ' \
+                  '"id": "4", ' \
+                  '"numberOfStops": 0, "blacklistedInEU": false } ] } ], "price": { "currency": "EUR", ' \
+                  '"total": "123.02", ' \
+                  '"base": "92.00", "fees": [ { "amount": "0.00", "type": "SUPPLIER" }, { "amount": "0.00", ' \
+                  '"type": "TICKETING" } ' \
+                  '], "grandTotal": "123.02", "additionalServices": [ { "amount": "30.00", "type": "CHECKED_BAGS" } ] ' \
+                  '}, ' \
+                  '"pricingOptions": { "fareType": [ "PUBLISHED" ], "includedCheckedBagsOnly": false }, ' \
+                  '"validatingAirlineCodes": [ ' \
+                  '"IB" ], "travelerPricings": [ { "travelerId": "1", "fareOption": "STANDARD", "travelerType": ' \
+                  '"ADULT", ' \
+                  '"price": { "currency": "EUR", "total": "123.02", "base": "92.00" }, "fareDetailsBySegment": [ { ' \
+                  '"segmentId": ' \
+                  '"4", "cabin": "ECONOMY", "fareBasis": "SDNNEOB2", "brandedFare": "NOBAG", "class": "S", ' \
+                  '"includedCheckedBags": { ' \
+                  '"quantity": 0 } } ] } ] } ], "payments": [ { "brand": "VISA_IXARIS", "binNumber": 123456, ' \
+                  '"flightOfferIds": [ 1 ' \
+                  '] } ] } } '
+
+    body = json.loads(json_string)
+    response = amadeus.shopping.flight_offers.upselling.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_AMADEUS_API_KEY',
+  clientSecret: 'YOUR_AMADEUS_API_SECRET'
+});
+
+
+// Search flights from LON to DEL
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'LON',
+  destinationLocationCode: 'DEL',
+  departureDate: '2023-06-01',
+  returnDate: '2023-06-30',
+  adults: '1'
+//then Get branded fares available from the first offer
+}).then(function (flightOffersResponse) {
+  return amadeus.shopping.flightOffers.upselling.post(
+    JSON.stringify({
+      "data": {
+        "type": "flight-offers-upselling",
+        "flightOffers": [
+          flightOffersResponse.data[0]
+        ],
+        "payments": [
+          {
+            "brand": "VISA_IXARIS",
+            "binNumber": 123456,
+            "flightOfferIds": [
+              1
+            ]
+          }
+        ]
+      }
+    })
+  );
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+
+public class BrandedFaresUpsell {
+
+  public static void main(String[] args) throws ResponseException {
+
+        Amadeus amadeus = Amadeus
+            .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+            .build();
+
+        FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(
+            Params.with("originLocationCode", "SYD")
+                    .and("destinationLocationCode", "BKK")
+                    .and("departureDate", "2023-11-01")
+                    .and("returnDate", "2023-11-08")
+                    .and("adults", 1)
+                    .and("max", 2));
+
+        FlightOfferSearch[] upsellFlightOffers = amadeus.shopping.flightOffers.upselling.post(flightOffersSearches[0]);
+
+        if (upsellFlightOffers[0].getResponse().getStatusCode() != 200) {
+            System.out.println("Wrong status code: " + upsellFlightOffers[0].getResponse().getStatusCode());
+            System.exit(-1);
+        }
+
+        System.out.println(upsellFlightOffers[0]);
+    }
+}
+
+
+
+
+

SeatMap Display

+

GET

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Retrieve the seat map of a flight present in an order
+    '''
+    response = amadeus.shopping.seatmaps.get(flightorderId='eJzTd9cPDPMwcooAAAtXAmE=')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Returns all the seat maps of a given order
+amadeus.shopping.seatmaps.get({
+  'flight-orderId': 'eJzTd9cPDPMwcooAAAtXAmE='
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.SeatMap;
+
+public class SeatMaps {
+    public static void main(String[] args) throws ResponseException {
+
+        Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+        SeatMap[] seatmap = amadeus.shopping.seatMaps.get(Params
+                .with("flight-orderId", "eJzTd9cPDPMwcooAAAtXAmE="));
+        if(seatmap.length != 0){
+          if (seatmap[0].getResponse().getStatusCode() != 200) {
+            System.out.println("Wrong status code: " + seatmap[0].getResponse().getStatusCode());
+            System.exit(-1);
+          }
+          System.out.println(seatmap[0]);
+        }
+        else {
+          System.out.println("No booking found for this flight-orderId");
+          System.exit(-1);
+        }
+     }
+}
+
+
+
+
+

POST

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Retrieve the seat map of a given flight offer 
+    '''
+    body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',
+                                                     destinationLocationCode='NYC',
+                                                     departureDate='2022-11-01',
+                                                     adults=1,
+                                                     max=1).result
+    response = amadeus.shopping.seatmaps.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Returns all the seat maps of a given flightOffer
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'SYD',
+  destinationLocationCode: 'BKK',
+  departureDate: '2022-08-01',
+  adults: '2'
+}).then(function (flightOffersSearchResponse) {
+  return amadeus.shopping.seatmaps.post(
+    JSON.stringify({
+      'data': [flightOffersSearchResponse.data[0]]
+    })
+  );
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+import com.amadeus.resources.SeatMap;
+import com.google.gson.JsonObject;
+
+public class SeatMaps {
+    public static void main(String[] args) throws ResponseException {
+
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get(
+                    Params.with("originLocationCode", "NYC")
+                            .and("destinationLocationCode", "MAD")
+                            .and("departureDate", "2022-11-01")
+                            .and("returnDate", "2022-11-09")
+                            .and("max", "1")
+                            .and("adults", 1));
+
+      JsonObject body = flightOffers[0].getResponse().getResult();
+      SeatMap[] seatmap = amadeus.shopping.seatMaps.post(body);
+
+      if (seatmap[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + seatmap[0].getResponse().getStatusCode());
+        System.exit(-1);
+      }
+
+      System.out.println(seatmap[0]);
+    }
+}
+
+
+
+
+

Flight Create Orders

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+traveler = {
+    'id': '1',
+    'dateOfBirth': '1982-01-16',
+    'name': {
+        'firstName': 'JORGE',
+        'lastName': 'GONZALES'
+    },
+    'gender': 'MALE',
+    'contact': {
+        'emailAddress': 'jorge.gonzales833@telefonica.es',
+        'phones': [{
+            'deviceType': 'MOBILE',
+            'countryCallingCode': '34',
+            'number': '480080076'
+        }]
+    },
+    'documents': [{
+        'documentType': 'PASSPORT',
+        'birthPlace': 'Madrid',
+        'issuanceLocation': 'Madrid',
+        'issuanceDate': '2015-04-14',
+        'number': '00000000',
+        'expiryDate': '2025-04-14',
+        'issuanceCountry': 'ES',
+        'validityCountry': 'ES',
+        'nationality': 'ES',
+        'holder': True
+    }]
+}
+
+try:
+    # Flight Offers Search to search for flights from MAD to ATH
+    flight_search = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',
+                                                              destinationLocationCode='ATH',
+                                                              departureDate='2022-12-01',
+                                                              adults=1).data
+
+    # Flight Offers Price to confirm the price of the chosen flight
+    price_confirm = amadeus.shopping.flight_offers.pricing.post(
+        flight_search[0]).data
+
+    # Flight Create Orders to book the flight
+    booked_flight = amadeus.booking.flight_orders.post(
+        flight_search[0], traveler).data
+
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
var Amadeus = require('amadeus');
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Book a flight from MAD to ATH on 2022-08-01
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'MAD',
+  destinationLocationCode: 'ATH',
+  departureDate: '2022-08-01',
+  adults: '1'
+}).then(function (flightOffersResponse) {
+  return amadeus.shopping.flightOffers.pricing.post(
+    JSON.stringify({
+      "data": {
+        "type": "flight-offers-pricing",
+        "flightOffers": [
+          flightOffersResponse.data[0]
+        ]
+      }
+    })
+  );
+}).then(function (pricingResponse) {
+  return amadeus.booking.flightOrders.post(
+    JSON.stringify({
+      'data': {
+        'type': 'flight-order',
+        'flightOffers': [pricingResponse.data.flightOffers[0]],
+        'travelers': [{
+          "id": "1",
+          "dateOfBirth": "1982-01-16",
+          "name": {
+            "firstName": "JORGE",
+            "lastName": "GONZALES"
+          },
+          "gender": "MALE",
+          "contact": {
+            "emailAddress": "jorge.gonzales833@telefonica.es",
+            "phones": [{
+              "deviceType": "MOBILE",
+              "countryCallingCode": "34",
+              "number": "480080076"
+            }]
+          },
+          "documents": [{
+            "documentType": "PASSPORT",
+            "birthPlace": "Madrid",
+            "issuanceLocation": "Madrid",
+            "issuanceDate": "2015-04-14",
+            "number": "00000000",
+            "expiryDate": "2025-04-14",
+            "issuanceCountry": "ES",
+            "validityCountry": "ES",
+            "nationality": "ES",
+            "holder": true
+          }]
+        }]
+      }
+    })
+  );
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+import com.amadeus.resources.FlightPrice;
+import com.amadeus.resources.FlightOrder;
+import com.amadeus.resources.FlightOrder.Traveler;
+import com.amadeus.resources.FlightOrder.Document.DocumentType;
+import com.amadeus.resources.FlightOrder.Phone.DeviceType;
+import com.amadeus.resources.FlightOrder.Name;
+import com.amadeus.resources.FlightOrder.Phone;
+import com.amadeus.resources.FlightOrder.Contact;
+import com.amadeus.resources.FlightOrder.Document;
+
+public class FlightSearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+            .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+            .build();
+
+    Traveler traveler = new Traveler();
+
+    traveler.setId("1");
+    traveler.setDateOfBirth("2000-04-14");
+    traveler.setName(new Name("JORGE", "GONZALES"));
+
+    Phone[] phone = new Phone[1];
+    phone[0] = new Phone();
+    phone[0].setCountryCallingCode("33");
+    phone[0].setNumber("675426222");
+    phone[0].setDeviceType(DeviceType.MOBILE);
+
+    Contact contact = new Contact();
+    contact.setPhones(phone);
+    traveler.setContact(contact);
+
+    Document[] document = new Document[1];
+    document[0] = new Document();
+    document[0].setDocumentType(DocumentType.PASSPORT);
+    document[0].setNumber("480080076");
+    document[0].setExpiryDate("2023-10-11");
+    document[0].setIssuanceCountry("ES");
+    document[0].setNationality("ES");
+    document[0].setHolder(true);
+    traveler.setDocuments(document);
+
+    Traveler[] travelerArray = new Traveler[1];
+    travelerArray[0] = traveler;
+    System.out.println(travelerArray[0]);
+
+    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(
+            Params.with("originLocationCode", "MAD")
+                    .and("destinationLocationCode", "ATH")
+                    .and("departureDate", "2023-08-01")
+                    .and("returnDate", "2023-08-08")
+                    .and("adults", 1)
+                    .and("max", 3));
+
+    // We price the 2nd flight of the list to confirm the price and the availability
+    FlightPrice flightPricing = amadeus.shopping.flightOffersSearch.pricing.post(
+            flightOffersSearches[0]);
+
+    // We book the flight previously priced
+    FlightOrder order = amadeus.booking.flightOrders.post(flightPricing, travelerArray);
+    System.out.println(order.getResponse());
+
+    // Return CO2 Emission of the previously booked flight
+    int weight = order.getFlightOffers()[0].getItineraries(
+    )[0].getSegments()[0].getCo2Emissions()[0].getWeight();
+    String unit = order.getFlightOffers()[0].getItineraries(
+    )[0].getSegments()[0].getCo2Emissions()[0].getWeightUnit();
+
+  }
+}
+
+
+
+
+

Flight Order Management

+

GET

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    # Retrieve the flight order based on it's id
+    '''
+    response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').get()
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Book a flight from MAD to ATH on 2020-08-01 and then retrieve it
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'MAD',
+  destinationLocationCode: 'ATH',
+  departureDate: '2020-08-01',
+  adults: '1'
+}).then(function (flightOffersSearchResponse) {
+  return amadeus.shopping.flightOffers.pricing.post(
+    JSON.stringify({
+      "data": {
+        "type": "flight-offers-pricing",
+        "flightOffers": [
+          flightOffersSearchResponse.data[0]
+        ]
+      }
+    })
+  );
+}).then(function (pricingResponse) {
+  return amadeus.booking.flightOrders.post(
+    JSON.stringify({
+      'data': {
+        'type': 'flight-order',
+        'flightOffers': [pricingResponse.data.flightOffers[0]],
+        'travelers': [{
+          "id": "1",
+          "dateOfBirth": "1982-01-16",
+          "name": {
+            "firstName": "JORGE",
+            "lastName": "GONZALES"
+          },
+          "gender": "MALE",
+          "contact": {
+            "emailAddress": "jorge.gonzales833@telefonica.es",
+            "phones": [{
+              "deviceType": "MOBILE",
+              "countryCallingCode": "34",
+              "number": "480080076"
+            }]
+          },
+          "documents": [{
+            "documentType": "PASSPORT",
+            "birthPlace": "Madrid",
+            "issuanceLocation": "Madrid",
+            "issuanceDate": "2015-04-14",
+            "number": "00000000",
+            "expiryDate": "2025-04-14",
+            "issuanceCountry": "ES",
+            "validityCountry": "ES",
+            "nationality": "ES",
+            "holder": true
+          }]
+        }]
+      }
+    })
+  );
+}).then(function (flightOrdersResponse) {
+  return amadeus.booking.flightOrder(flightOrdersResponse.data.id).get()
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.booking.FlightOrder;
+import com.amadeus.exceptions.ResponseException;
+
+public class FlightOrderManagement {
+    public static void main(String[] args) throws ResponseException {
+
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET")
+              .build();
+
+      com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder("MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").get();
+
+      if (order.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + order.getResponse().getStatusCode());
+        System.exit(-1);
+      }
+
+      System.out.println(order);
+     }
+}
+
+
+
+
+

DELETE

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    # Delete a given flight order based on it's id
+    '''
+    response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').delete()
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Book a flight from MAD to ATH on 2020-08-01, retrieve it and then delete it
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'MAD',
+  destinationLocationCode: 'ATH',
+  departureDate: '2020-08-01',
+  adults: '1'
+}).then(function (flightOffersSearchResponse) {
+  return amadeus.shopping.flightOffers.pricing.post(
+    JSON.stringify({
+      "data": {
+        "type": "flight-offers-pricing",
+        "flightOffers": [
+          flightOffersSearchResponse.data[0]
+        ]
+      }
+    })
+  );
+}).then(function (pricingResponse) {
+  return amadeus.booking.flightOrders.post(
+    JSON.stringify({
+      'data': {
+        'type': 'flight-order',
+        'flightOffers': [pricingResponse.data.flightOffers[0]],
+        'travelers': [{
+          "id": "1",
+          "dateOfBirth": "1982-01-16",
+          "name": {
+            "firstName": "JORGE",
+            "lastName": "GONZALES"
+          },
+          "gender": "MALE",
+          "contact": {
+            "emailAddress": "jorge.gonzales833@telefonica.es",
+            "phones": [{
+              "deviceType": "MOBILE",
+              "countryCallingCode": "34",
+              "number": "480080076"
+            }]
+          },
+          "documents": [{
+            "documentType": "PASSPORT",
+            "birthPlace": "Madrid",
+            "issuanceLocation": "Madrid",
+            "issuanceDate": "2015-04-14",
+            "number": "00000000",
+            "expiryDate": "2025-04-14",
+            "issuanceCountry": "ES",
+            "validityCountry": "ES",
+            "nationality": "ES",
+            "holder": true
+          }]
+        }]
+      }
+    })
+  );
+}).then(function (flightOrdersResponse) {
+  return amadeus.booking.flightOrder(flightOrdersResponse.data.id).get()
+}).then(function (flightOrderResponse) {
+  return amadeus.booking.flightOrder(flightOrderResponse.data.id).delete()
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.booking.FlightOrder;
+import com.amadeus.exceptions.ResponseException;
+
+public class FlightOrderManagement {
+    public static void main(String[] args) throws ResponseException {
+
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS)API_SECRET")
+              .build();
+
+      com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder("MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").delete();
+
+      if (order.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + order.getResponse().getStatusCode());
+        System.exit(-1);
+      }
+
+      System.out.println(order);
+     }
+}
+
+
+
+
+

Flight Price Analysis

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns price metrics of a given itinerary
+    '''
+    response = amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD',
+                                                             destinationIataCode='CDG',
+                                                             departureDate='2022-03-21')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+
+// Am I getting a good deal on this flight?
+amadeus.analytics.itineraryPriceMetrics.get({
+  originIataCode: 'MAD',
+  destinationIataCode: 'CDG',
+  departureDate: '2022-01-13',
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.ItineraryPriceMetric;
+
+public class FlightPriceAnalysis {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_API_ID","YOUR_API_SECRET")
+        .build();
+
+    // What's the flight price analysis from MAD to CDG
+    ItineraryPriceMetric[] metrics = amadeus.analytics.itineraryPriceMetrics.get(Params
+        .with("originIataCode", "MAD")
+        .and("destinationIataCode", "CDG")
+        .and("departureDate", "2022-03-21"));
+
+    if (metrics[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + metrics[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(metrics[0]);
+  }
+}
+
+
+
+
+

Flight Delay Prediction

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Will there be a delay from BRU to FRA? If so how much delay?
+    '''
+    response = amadeus.travel.predictions.flight_delay.get(originLocationCode='NCE', destinationLocationCode='IST',
+                                                           departureDate='2022-08-01', departureTime='18:20:00',
+                                                           arrivalDate='2022-08-01', arrivalTime='22:15:00',
+                                                           aircraftCode='321', carrierCode='TK',
+                                                           flightNumber='1816', duration='PT31H10M')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Will there be a delay from BRU to FRA? If so how much delay?
+amadeus.travel.predictions.flightDelay.get({
+  originLocationCode: 'NCE',
+  destinationLocationCode: 'IST',
+  departureDate: '2022-08-01',
+  departureTime: '18:20:00',
+  arrivalDate: '2022-08-01',
+  arrivalTime: '22:15:00',
+  aircraftCode: '321',
+  carrierCode: 'TK',
+  flightNumber: '1816',
+  duration: 'PT31H10M'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Delay;
+
+public class FlightDelayPrediction {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    Delay[] flightDelay = amadeus.travel.predictions.flightDelay.get(Params
+    .with("originLocationCode", "NCE")
+    .and("destinationLocationCode", "IST")
+    .and("departureDate", "2022-08-01")
+    .and("departureTime", "18:20:00")
+    .and("arrivalDate", "2022-08-01")
+    .and("arrivalTime", "22:15:00")
+    .and("aircraftCode", "321")
+    .and("carrierCode", "TK")
+    .and("flightNumber", "1816")
+    .and("duration", "PT31H10M"));
+
+    if (flightDelay[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightDelay[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightDelay[0]);
+  }
+}
+
+
+
+
+

Airport On Time Performance

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Will there be a delay in the JFK airport on the 1st of December?
+    '''
+    response = amadeus.airport.predictions.on_time.get(
+        airportCode='JFK', date='2021-12-01')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Will there be a delay in the JFK airport on the 1st of September?
+amadeus.airport.predictions.onTime.get({
+  airportCode: 'JFK',
+  date: '2022-09-01'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.OnTime;
+
+public class AirportOnTime {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    OnTime onTime = amadeus.airport.predictions.onTime.get(Params
+        .with("airportCode", "JFK")
+        .and("date", "2022-09-01"));
+
+    if(onTime.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + onTime.getResponse().getStatusCode());
+        System.exit(-1);
+    }
+    System.out.println(onTime);
+  }
+}
+
+
+
+
+

Flight Choice Prediction

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Find the probability of the flight MAD to NYC to be chosen
+    '''
+    body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',
+                                                     destinationLocationCode='NYC',
+                                                     departureDate='2022-11-01',
+                                                     returnDate='2022-11-09',
+                                                     adults=1).result
+    response = amadeus.shopping.flight_offers.prediction.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
var Amadeus = require("amadeus");
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+amadeus.shopping.flightOffersSearch.get({
+  originLocationCode: 'SYD',
+  destinationLocationCode: 'BKK',
+  departureDate: '2022-08-01',
+  adults: '2'
+}).then(function (response) {
+  return amadeus.shopping.flightOffers.prediction.post(
+    JSON.stringify(response)
+  );
+}).then(function (response) {
+  console.log(response.data);
+}).catch(function (responseError) {
+  console.log(responseError);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.FlightOfferSearch;
+import com.google.gson.JsonObject;
+
+public class FlightChoicePrediction {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get(
+                  Params.with("originLocationCode", "MAD")
+                          .and("destinationLocationCode", "NYC")
+                          .and("departureDate", "2022-11-01")
+                          .and("returnDate", "2022-11-09")
+                          .and("adults", 1));
+
+    JsonObject body = flightOffers[0].getResponse().getResult();
+    FlightOfferSearch[] flightOffersPrediction = amadeus.shopping.flightOffers.prediction.post(body);
+
+    if (flightOffersPrediction[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightOffersPrediction[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightOffersPrediction[0]);
+  }
+}
+
+
+
+
+

On Demand Flight Status

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns flight status of a given flight
+    '''
+    response = amadeus.schedule.flights.get(carrierCode='AZ',
+                                            flightNumber='319',
+                                            scheduledDepartureDate='2022-03-13')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What's the current status of my flight?
+amadeus.schedule.flights.get({
+  carrierCode: 'AZ',
+  flightNumber: '319',
+  scheduledDepartureDate: '2022-03-13'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.Response;
+import com.amadeus.resources.DatedFlight;
+
+public class OnDemandFlightStatus {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Returns the status of a given flight
+    DatedFlight[] flightStatus = amadeus.schedule.flights.get(Params
+        .with("flightNumber", "319")
+        .and("carrierCode", "AZ")
+        .and("scheduledDepartureDate", "2022-03-13"));
+
+   if (flightStatus[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + flightStatus[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(flightStatus[0]);
+  }
+}
+
+
+
+
+

Flight Most Traveled Destinations

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Where were people flying to from Madrid in the January 2017?
+    '''
+    response = amadeus.travel.analytics.air_traffic.traveled.get(originCityCode='MAD', period='2017-01')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Where were people flying to from Madrid in the January 2017?
+amadeus.travel.analytics.airTraffic.traveled.get({
+  originCityCode: 'MAD',
+  period: '2017-01'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.AirTraffic;
+
+public class FlightMostTraveledDestinations {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Flight Most Traveled Destinations
+    AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.traveled.get(Params
+      .with("originCityCode", "MAD")
+      .and("period", "2017-01"));
+
+    if (airTraffics[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + airTraffics[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(airTraffics[0]);
+  }
+}
+
+
+
+
+

Flight Busiest Traveling Period

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What were the busiest months for Madrid in 2022?
+    '''
+    response = amadeus.travel.analytics.air_traffic.busiest_period.get(
+        cityCode='MAD', period='2017', direction='ARRIVING')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What were the busiest months for Madrid in 2017?
+amadeus.travel.analytics.airTraffic.busiestPeriod.get({
+  cityCode: 'MAD',
+  period: '2017',
+  direction: Amadeus.direction.arriving
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Period;
+
+public class FlightBusiestPeriod {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Flight Busiest Traveling Period
+    Period[] busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get(Params
+      .with("cityCode", "MAD")
+      .and("period", "2017")
+      .and("direction", BusiestPeriod.ARRIVING));
+
+    if(busiestPeriods[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + (busiestPeriods[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+    System.out.println((busiestPeriods[0]);
+  }
+}
+
+
+
+
+

Flight Most Booked Destinations

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Where were people flying to from Madrid in the August 2017?
+    '''
+    response = amadeus.travel.analytics.air_traffic.booked.get(originCityCode='MAD', period='2017-08')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Where were people flying to from Madrid in the August 2017?
+amadeus.travel.analytics.airTraffic.booked.get({
+  originCityCode: 'MAD',
+  period: '2017-08'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.AirTraffic;
+
+public class FlightMostBookedDestinations {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Flight Most Booked Destinations
+    AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.booked.get(Params
+      .with("originCityCode", "MAD")
+      .and("period", "2017-08"));
+
+    if (airTraffics[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + airTraffics[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(airTraffics[0]);
+  }
+}
+
+
+
+
+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What is the URL to my online check-in?
+    '''
+    response = amadeus.reference_data.urls.checkin_links.get(airlineCode='BA')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What is the URL to my online check-in?
+amadeus.referenceData.urls.checkinLinks.get({
+    airlineCode: 'BA'
+  })
+  .then(function (response) {
+    console.log(response);
+  }).catch(function (response) {
+    console.error(response);
+  });
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.CheckinLink;
+
+public class FlightCheckinLinks {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    CheckinLink[] checkinLinks = amadeus.referenceData.urls.checkinLinks.get(Params
+      .with("airlineCode", "BA"));
+
+    if(checkinLinks[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + (checkinLinks[0].getResponse().getStatusCode()));
+        System.exit(-1);
+    }
+
+    System.out.println((checkinLinks[0]));
+  }
+}
+
+
+
+
+

Airport Nearest Relevant

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What relevant airports are there around a specific location?
+    '''
+    response = amadeus.reference_data.locations.airports.get(longitude=49.000, latitude=2.55)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What relevant airports are there around a specific location?
+amadeus.referenceData.locations.airports.get({
+  longitude: 2.55,
+  latitude: 49.0000
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Location;
+
+public class AirportNearest {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_API_ID","YOUR_API_SECRET")
+        .build();
+
+    // Airport Nearest Relevant (for London)
+    Location[] locations = amadeus.referenceData.locations.airports.get(Params
+      .with("latitude", 49.0000)
+      .and("longitude", 2.55));
+
+    if(locations[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + locations[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+    System.out.println(locations[0]);
+  }
+}
+
+
+
+
+ +

By keyword

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+from amadeus import Location
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Which cities or airports start with 'r'?
+    '''
+    response = amadeus.reference_data.locations.get(keyword='r',
+                                                    subType=Location.ANY)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_KEY'
+});
+
+// Retrieve information about the LHR airport?
+amadeus.referenceData.location('ALHR').get()
+  .then(function (response) {
+    console.log(response);
+  }).catch(function (response) {
+    console.error(response);
+  });
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Location;
+
+public class AirportCitySearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Get a specific city or airport based on its id
+    Location location = amadeus.referenceData
+      .location("ALHR").get();
+
+    if(location.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + location.getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(location);
+  }
+}
+
+
+
+
+

By Id

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+from amadeus import Location
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Which cities or airports start with 'r'?
+    '''
+    response = amadeus.reference_data.locations.get(keyword='r',
+                                                    subType=Location.ANY)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Which cities or airports start with ’r'?
+amadeus.referenceData.locations.get({
+  keyword: 'r',
+  subType: Amadeus.location.any
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.referenceData.Locations;
+import com.amadeus.resources.Location;
+
+public class AirportCitySearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Airport & City Search (autocomplete)
+    // Find all the cities and airports starting by the keyword 'LON'
+    Location[] locations = amadeus.referenceData.locations.get(Params
+      .with("keyword", "LON")
+      .and("subType", Locations.ANY));
+
+    if(locations[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + locations[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+    System.out.println(locations[0]);
+  }
+}
+
+
+
+
+

Airline Code Lookup

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What's the airline name for the IATA code BA?
+    '''
+    response = amadeus.reference_data.airlines.get(airlineCodes='BA')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What's the airline name for the IATA code BA?
+amadeus.referenceData.airlines.get({
+  airlineCodes: 'BA'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Airline;
+
+public class AirlineCodeLookup {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    Airline[] airlines = amadeus.referenceData.airlines.get(Params
+      .with("airlineCodes", "BA"));
+
+    if (airlines[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + airlines[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(airlines);
+  }
+}
+
+
+
+
+

Hotel

+

Hotel List

+

By geolocation

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Get list of hotels by a geocode
+    '''
+    response = amadeus.reference_data.locations.hotels.by_geocode.get(longitude=2.160873,latitude=41.397158)
+
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// List of hotels in Paris 
+amadeus.referenceData.locations.hotels.byGeocode.get({
+  latitude: 48.83152,
+  longitude: 2.24691
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Hotel;
+
+public class HotelList {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    Hotel[] hotels = amadeus.referenceData.locations.hotels.byGeocode.get(
+      Params.with("latitude", 48.83152)
+        .and("longitude", 2.24691));
+
+    if (hotels[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(hotels[0]);
+  }
+}
+
+
+
+
+

By city

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Get list of hotels by city code
+    '''
+    response = amadeus.reference_data.locations.hotels.by_city.get(cityCode='PAR')
+
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// List of hotels in Paris 
+amadeus.referenceData.locations.hotels.byCity.get({
+  cityCode: 'PAR'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Hotel;
+
+public class HotelList {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    Hotel[] hotels = amadeus.referenceData.locations.hotels.byCity.get(
+      Params.with("cityCode", "PAR"));
+
+    if (hotels[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(hotels[0]);
+  }
+}
+
+
+
+
+

By hotel

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Get list of hotels by hotel id
+    '''
+    response = amadeus.reference_data.locations.hotels.by_hotels.get(hotelIds='ADPAR001')
+
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Get Marriot Hotel information in Paris
+amadeus.referenceData.locations.hotels.byHotels.get({
+  hotelIds: 'ARPARARA'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Hotel;
+
+public class HotelList {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    Hotel[] hotels = amadeus.referenceData.locations.hotels.byHotels.get(
+      Params.with("hotelIds", "ARPARARA"));
+
+    if (hotels[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(hotels[0]);
+  }
+}
+
+
+
+
+ +

By hotel

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    # Get list of available offers in specific hotels by hotel ids
+    hotels_by_city = amadeus.shopping.hotel_offers_search.get(
+        hotelIds='RTPAR001', adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04')
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+    clientId: 'YOUR_API_KEY',
+    clientSecret: 'YOUR_API_SECRET'
+});
+
+// Get list of available offers in specific hotels by hotel ids
+amadeus.shopping.hotelOffersSearch.get({
+    hotelIds: 'RTPAR001',
+    adults: '2',
+    'checkInDate': '2023-10-10',
+    'checkOutDate': '2023-10-12'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.HotelOfferSearch;
+
+public class HotelSearch {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    HotelOfferSearch[] offers = amadeus.shopping.hotelOffersSearch.get(
+      Params.with("hotelIds", "RTPAR001")
+        .and("adults", 2)
+    );
+
+    if (offers[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + offers[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(offers[0]);
+  }
+}
+
+
+
+
+

By offer

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    # Get list of Hotels by city code
+    hotels_by_city = amadeus.shopping.hotel_offer_search('63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3').get()
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+    clientId: 'YOUR_API_KEY',
+    clientSecret: 'YOUR_API_SECRET'
+});
+
+// Check offer conditions of a specific offer id
+amadeus.shopping.hotelOfferSearch('63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3').get()
+.then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.HotelOfferSearch;
+
+public class HotelSearch {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    HotelOfferSearch offer = amadeus.shopping.hotelOfferSearch(
+        "0W7UU1NT9B")
+      .get();
+
+    if (offer.getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + offer.getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(offer);
+  }
+}
+
+
+
+
+

Hotel Booking

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    # Hotel List API to get list of Hotels by city code
+    hotels_by_city = amadeus.reference_data.locations.hotels.by_city.get(cityCode='DEL')
+    hotelIds = [hotel.get('hotelId') for hotel in hotels_by_city.data[:5]]
+
+    # Hotel Search API to get list of offers for a specific hotel
+    hotel_offers = amadeus.shopping.hotel_offers_search.get(
+        hotelIds=hotelIds, adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04')
+    offerId = hotel_offers.data[0]['offers'][0]['id']
+
+    guests = [{'id': 1, 'name': {'title': 'MR', 'firstName': 'BOB', 'lastName': 'SMITH'},
+               'contact': {'phone': '+33679278416', 'email': 'bob.smith@email.com'}}]
+    payments = {'id': 1, 'method': 'creditCard', 'card': {
+        'vendorCode': 'VI', 'cardNumber': '4151289722471370', 'expiryDate': '2027-08'}}
+
+    # Hotel booking API to book the offer 
+    hotel_booking = amadeus.booking.hotel_bookings.post(
+        offerId, guests, payments)
+    print(hotel_booking.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Book a hotel in DEL for 2023-10-10 to 2023-10-12 
+// 1. Hotel List API to get the list of hotels 
+amadeus.referenceData.locations.hotels.byCity.get({
+  cityCode: 'LON'
+}).then(function (hotelsList) {
+// 2. Hotel Search API to get the price and offer id
+  return amadeus.shopping.hotelOffersSearch.get({
+    'hotelIds': hotelsList.data[0].hotelId,
+    'adults' : 1,
+    'checkInDate': '2023-10-10',
+    'checkOutDate': '2023-10-12'
+  });
+}).then(function (pricingResponse) {
+// Finally, Hotel Booking API to book the offer
+  return amadeus.booking.hotelBookings.post(
+    JSON.stringify({
+      'data': {
+        'offerId': pricingResponse.data[0].offers[0].id,
+        'guests': [{
+          'id': 1,
+          'name': {
+            'title': 'MR',
+            'firstName': 'BOB',
+            'lastName': 'SMITH'
+          },
+          'contact': {
+            'phone': '+33679278416',
+            'email': 'bob.smith@email.com'
+          }
+        }],
+        'payments': [{
+          'id': 1,
+          'method': 'creditCard',
+          'card': {
+            'vendorCode': 'VI',
+            'cardNumber': '4151289722471370',
+            'expiryDate': '2022-08'
+          }
+        }]
+      }
+    }));
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.HotelBooking;
+
+public class HotelBookings {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET")
+        .build();
+
+    String body = "{\"data\""
+        + ":{\"offerId\":\"2F5B1C3B215FA11FD5A44BE210315B18FF91BDA2FEDDD879907A3798F41D1C28\""
+        + ",\"guests\":[{\"id\":1,\"name\":{\"title\":\"MR\",\"firstName\":\"BOB\","
+        + "\"lastName\" :\"SMITH\"},\"contact\":{\"phone\":\"+33679278416\",\""
+        + "email\":\"bob.smith@email.com\"}}],\""
+        + "payments\":[{\"id\":1,\"method\":\"creditCard\",\""
+        + "card\":{\"vendorCode\":\"VI\",\"cardNumber\""
+        + ":\"4151289722471370\",\"expiryDate\":\"2022-08\"}}]}}";
+
+    HotelBooking[] hotel = amadeus.booking.hotelBookings.post(body);
+
+    if (hotel[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + hotel[0].getResponse().getStatusCode());
+
+        System.exit(-1);
+    }
+
+    System.out.println(hotel[0]);
+  }
+}
+
+
+
+
+

Hotel Ratings

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What travelers think about this hotel?
+    '''
+    response = amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What travelers think about this hotel?
+amadeus.eReputation.hotelSentiments.get({
+  hotelIds: 'ADNYCCTB'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.HotelSentiment;
+
+public class HotelRatings {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET")
+        .build();
+
+    // Hotel Ratings / Sentiments
+    HotelSentiment[] hotelSentiments = amadeus.ereputation.hotelSentiments.get(Params.with("hotelIds", "ADNYCCTB"));
+
+    if (hotelSentiments[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + hotelSentiments[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(hotelSentiments[0]);
+  }
+}
+
+
+
+
+

Hotel Name Autocomplete

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
# Install the Python library from https://pypi.org/project/amadeus
+from ast import keyword
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search
+    '''
+    response = amadeus.reference_data.locations.hotel.get(keyword='PARI', subType=[Hotel.HOTEL_GDS])
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
const Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+// Or `var amadeus = new Amadeus()` if the environment variables are set
+
+
+// Hotel name autocomplete for keyword 'PARI' using  HOTEL_GDS category of search
+amadeus.referenceData.locations.hotel.get({
+  keyword: 'PARI',
+  subType: 'HOTEL_GDS'
+}).then(response => console.log(response))
+  .catch(err => console.error(err));
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.TripDetail;
+
+// Hotel name autocomplete for keyword 'PARI' using  HOTEL_GDS category of search
+public class HotelNameAutocomplete {
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Set query parameters
+    Params params = Params
+        .with("keyword", "PARI")
+        .and("subType", "HOTEL_GDS");
+
+    // Run the query
+    Hotel[] hotels = amadeus.referenceData.locations.hotel.get(params);
+
+    if (hotels.getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + hotels.getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    Arrays.stream(hotels)
+        .map(Hotel::getName)
+        .forEach(System.out::println);
+  }
+}
+
+
+
+
+

Destination Content

+

Points of Interest

+

By geolocation

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What are the popular places in Barcelona (based on a geo location and a radius)
+    '''
+    response = amadeus.reference_data.locations.points_of_interest.get(latitude=41.397158, longitude=2.160873)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What are the popular places in Barcelona (based on a geo location and a radius)
+amadeus.referenceData.locations.pointsOfInterest.get({
+  latitude: 41.397158,
+  longitude: 2.160873
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.PointOfInterest;
+
+public class PointsOfInterest {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_API_ID","YOUR_API_SECRET")
+        .build();
+
+    // What are the popular places in Barcelona (based on a geolocation)
+    PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get(Params
+       .with("latitude", "41.39715")
+       .and("longitude", "2.160873"));
+
+    if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(pointsOfInterest[0]);
+  }
+}
+
+
+
+
+

By square

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What are the popular places in Barcelona? (based on a square)
+    '''
+    response = amadeus.reference_data.locations.points_of_interest.by_square.get(north=41.397158,
+                                                                                 west=2.160873,
+                                                                                 south=41.394582,
+                                                                                 east=2.177181)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What are the popular places in Barcelona? (based on a square)
+amadeus.referenceData.locations.pointsOfInterest.bySquare.get({
+  north: 41.397158,
+  west: 2.160873,
+  south: 41.394582,
+  east: 2.177181
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.PointOfInterest;
+
+public class PointsOfInterest {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // What are the popular places in Barcelona? (based on a square)
+    PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.bySquare.get(Params
+        .with("north", "41.397158")
+        .and("west", "2.160873")
+        .and("south", "41.394582")
+        .and("east", "2.177181"));
+
+    if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(pointsOfInterest[0]);
+
+  }
+}
+
+
+
+
+

By Id

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Give me information about a place based on it's ID
+    '''
+    response = amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get()
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Extract the information about point of interest with ID '9CB40CB5D0'
+amadeus.referenceData.locations.pointOfInterest('9CB40CB5D0').get()
+  .then(function (response) {
+    console.log(response);
+  }).catch(function (response) {
+    console.error(response);
+  });
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.PointOfInterest;
+
+public class PointsOfInterest {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Returns a single Point of Interest from a given id
+    PointOfInterest pointOfInterest = amadeus.referenceData.locations.pointOfInterest("9CB40CB5D0").get();
+
+   if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(pointsOfInterest[0]);
+  }
+}
+
+
+
+
+

Tours and Activities

+

By geolocation

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns activities for a location in Barcelona based on geolocation coordinates
+    '''
+    response = amadeus.shopping.activities.get(latitude=40.41436995, longitude=-3.69170868)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Returns activities for a location in Barcelona based on geolocation coordinates
+amadeus.shopping.activities.get({
+  latitude: 41.397158,
+  longitude: 2.160873
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Activity;
+
+
+public class ToursActivities {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      Activity[] activities = amadeus.shopping.activities.get(Params
+        .with("latitude", "41.39715")
+        .and("longitude", "2.160873"));
+
+       if(activities[0].getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + activities[0].getResponse().getStatusCode());
+               System.exit(-1);
+    }
+      System.out.println(activities[0]);
+    }
+}
+
+
+
+
+

By square

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns activities in Barcelona within a designated area
+    '''
+    response = amadeus.shopping.activities.by_square.get(north=41.397158,
+                                                         west=2.160873,
+                                                         south=41.394582,
+                                                         east=2.177181)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// What are the best tours and activities in Barcelona? (based on a Square)
+amadeus.shopping.activities.bySquare.get({
+  north: 41.397158,
+  west: 2.160873,
+  south: 41.394582,
+  east: 2.177181
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Activity;
+
+
+public class ToursActivities {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      Activity[] activities = amadeus.shopping.activities.get(Params
+        .with("north", "41.397158")
+        .and("west", "2.160873")
+        .and("south", "41.394582")
+        .and("east", "2.177181"));
+
+       if(activities[0].getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + activities[0].getResponse().getStatusCode());
+               System.exit(-1);
+    }
+      System.out.println(activities[0]);
+    }
+}
+
+
+
+
+

By Id

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import ResponseError, Client
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Returns information of an activity from a given Id
+    '''
+    response = amadeus.shopping.activity('3216547684').get()
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Extract the information about an activity with ID '56777'
+amadeus.shopping.activity('56777').get({
+  north: 41.397158,
+  west: 2.160873,
+  south: 41.394582,
+  east: 2.177181
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Activity;
+
+
+public class ToursActivities {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      Activity tour = amadeus.shopping.activity("3216547684").get();
+
+       if(tour.getResponse().getStatusCode() != 200) {
+               System.out.println("Wrong status code: " + tour.getResponse().getStatusCode());
+               System.exit(-1);
+       }
+       System.out.println(tour);
+    }
+}
+
+
+
+
+

Location Score

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
# Install the Python library from https://pypi.org/project/amadeus
+from ast import keyword
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+)
+
+try:
+    '''
+    What are the location scores for the given coordinates?
+    '''
+    response = amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
var Amadeus = require('amadeus');
+var amadeus = new Amadeus();
+
+//What are the location scores for the given coordinates?
+amadeus.location.analytics.categoryRatedAreas.get({
+  latitude: 41.397158,
+  longitude: 2.160873
+}).then(data => {
+  console.log(data.body)
+}).catch(error => {
+  console.error(error)
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.ScoredLocation;
+import java.util.Arrays;
+
+//Get the score for a given location using its coordinates
+public class LocationScore {
+    public static void main(String[] args) throws ResponseException {
+
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      //Set query parameters
+      Params params = Params.with("latitude", 41.397158).and("longitude", 2.160873); 
+
+      //What are the location scores for the given coordinates?
+      ScoredLocation[] scoredLocations = amadeus.location.analytics.categoryRatedAreas.get(params);
+
+      if (scoredLocations[0] && scoredLocations[0].getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + scoredLocations[0].getResponse().getStatusCode());
+        System.exit(-1);
+      }
+
+      Arrays.stream(scoredLocations)
+          .map(ScoredLocation::getCategoryScores)
+          .forEach(System.out::println);
+    }
+}
+
+
+
+
+

Trip

+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    What are the cities matched with keyword 'Paris' ?
+    '''
+    response = amadeus.reference_data.locations.cities.get(keyword='Paris')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+    clientId: 'YOUR_API_KEY',
+    clientSecret: 'YOUR_API_SECRET'
+});
+
+// finds cities that match a specific word or string of letters. 
+// Return a list of cities matching a keyword 'Paris'
+amadeus.referenceData.locations.cities.get({
+    keyword: 'Paris'
+}).catch(function (response) {
+    console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.City;
+
+public class CitySearch {
+
+  public static void main(String[] args) throws ResponseException {
+    Amadeus amadeus = Amadeus
+      .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+      .build();
+
+    City[] cities = amadeus.referenceData.locations.cities.get(
+      Params.with("keyword","PARIS")
+    );
+
+    if (cities[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + cities[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(cities[0]);
+  }
+}
+
+
+
+
+

Trip Parser

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+  with open('../request_body.json') as file:
+    body = json.load(file)
+    response = amadeus.travel.trip_parser.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+//Read trip data from file
+const body = require('../request_body.json');
+amadeus.travel.tripParser.post(JSON.stringify(body))
+  .then(response => console.log(response))
+  .catch(err => console.error(err));
+
+/**
+ * If you don't have your base64 encoded payload, you can use
+ * the SDK helper method to create your request body
+ * '''js
+ * const base64Payload = amadeus.tripParser.fromFile(fileInUTF8Format)
+ * '''
+ */
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.TripDetail;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+public class TripParser {
+    public static void main(String[] args) throws ResponseException {
+
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+      //Read trip data from file
+      Gson gson = new Gson();
+      Reader reader = Files.newBufferedReader(Paths.get("../request_body.json"));
+      JsonObject body = gson.fromJson(reader, JsonObject.class);  
+
+      TripDetail trip = amadeus.travel.tripParser.post(body);
+
+      if (trip.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code: " + trip.getResponse().getStatusCode());
+        System.exit(-1);
+      }
+
+      System.out.println(trip);
+    }
+}
+
+
+
+
+

Trip Purpose Prediction

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
# Install the Python library from https://pypi.org/project/amadeus
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    The passenger is traveling for leisure or business?
+    '''
+    response = amadeus.travel.predictions.trip_purpose.get(originLocationCode='NYC', destinationLocationCode='MAD',
+                                                           departureDate='2022-08-01', returnDate='2022-08-12',
+                                                           searchDate='2022-06-11')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// The passenger is traveling for leisure or business?
+amadeus.travel.predictions.tripPurpose.get({
+  originLocationCode: 'NYC',
+  destinationLocationCode: 'MAD',
+  departureDate: '2022-08-01',
+  returnDate: '2022-08-12'
+}).then(function (response) {
+  console.log(response);
+}).catch(function (response) {
+  console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Prediction;
+
+public class TripPurposePrediction {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    // Predict the purpose of the trip: business or leisure
+    Prediction tripPurpose = amadeus.travel.predictions.tripPurpose.get(Params
+        .with("originLocationCode", "NYC")
+        .and("destinationLocationCode", "MAD")
+        .and("departureDate", "2022-08-01")
+        .and("returnDate", "2022-08-12"));
+
+    if(tripPurpose.getResponse().getStatusCode() != 200) {
+        System.out.println("Wrong status code" + tripPurpose.getResponse().getStatusCode());
+        System.exit(-1);
+    }
+
+    System.out.println(tripPurpose);
+  }
+}
+
+
+
+
+

Travel Recommendations

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+try:
+    '''
+    Recommends travel destinations similar to Paris for travelers in France
+    '''
+    response = amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR')
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
var Amadeus = require("amadeus");
+var amadeus = new Amadeus({
+  clientId: 'YOUR_API_KEY',
+  clientSecret: 'YOUR_API_SECRET'
+});
+
+// Recommended locations similar to PAR
+amadeus.referenceData.recommendedLocations.get({
+    cityCodes: 'PAR',
+    travelerCountryCode: 'FR'
+}).then(function(response) {
+    console.log(response.data);
+}).catch((error) => {
+    console.log("Error");
+    done();
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.Location;
+
+public class TravelRecommendations {
+    public static void main(String[] args) throws ResponseException {
+      Amadeus amadeus = Amadeus
+              .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET")
+              .build();
+
+        Location[] destinations = amadeus.referenceData.recommendedLocations.get(Params
+                .with("cityCodes", "PAR")
+                .and("travelerCountryCode", "FR"));
+
+        if (destinations.length != 0) {
+          if (destinations[0].getResponse().getStatusCode() != 200) {
+            System.out.println("Wrong status code: " + destinations[0].getResponse().getStatusCode());
+            System.exit(-1);
+          }
+          System.out.println(destinations[0]);
+        }
+        else {
+          System.out.println("No recommendations found");
+          System.exit(-1);
+        }
+     }
+}
+
+
+
+
+

Cars and Transfers

+ +
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+json_string = '{ "startLocationCode": "CDG", "endAddressLine": "Avenue Anatole France, 5", "endCityName": "Paris", "endZipCode": "75007", "endCountryCode": "FR", \
+"endName": "Souvenirs De La Tour", "endGeoCode": "48.859466,2.2976965", "transferType": "PRIVATE", "startDateTime": "2023-11-10T10:30:00", "providerCodes": "TXO", \
+"passengers": 2, "stopOvers": [ { "duration": "PT2H30M", "sequenceNumber": 1, "addressLine": "Avenue de la Bourdonnais, 19", "countryCode": "FR", "cityName": "Paris", \
+"zipCode": "75007", "name": "De La Tours", "geoCode": "48.859477,2.2976985", "stateCode": "FR" } ], "startConnectedSegment": \
+{ "transportationType": "FLIGHT", "transportationNumber": "AF380", "departure": { "localDateTime": "2023-11-10T09:00:00", "iataCode": "NCE" }, \
+"arrival": { "localDateTime": "2023-11-10T10:00:00", "iataCode": "CDG" } }, "passengerCharacteristics": [ { "passengerTypeCode": "ADT", "age": 20 }, \
+{ "passengerTypeCode": "CHD", "age": 10 } ] }'
+
+body = json.loads(json_string)
+try:
+    response = amadeus.shopping.transfer_offers.post(body)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
var Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_AMADEUS_API_KEY',
+  clientSecret: 'YOUR_AMADEUS_API_SECRET'
+});
+
+body =JSON.stringify({
+  "startLocationCode": "CDG",
+  "endAddressLine": "Avenue Anatole France, 5",
+  "endCityName": "Paris",
+  "endZipCode": "75007",
+  "endCountryCode": "FR",
+  "endName": "Souvenirs De La Tour",
+  "endGeoCode": "48.859466,2.2976965",
+  "transferType": "PRIVATE",
+  "startDateTime": "2023-11-10T10:30:00",
+  "providerCodes": "TXO",
+  "passengers": 2,
+  "stopOvers": [
+    {
+      "duration": "PT2H30M",
+      "sequenceNumber": 1,
+      "addressLine": "Avenue de la Bourdonnais, 19",
+      "countryCode": "FR",
+      "cityName": "Paris",
+      "zipCode": "75007",
+      "name": "De La Tours",
+      "geoCode": "48.859477,2.2976985",
+      "stateCode": "FR"
+    }
+  ],
+  "startConnectedSegment": {
+    "transportationType": "FLIGHT",
+    "transportationNumber": "AF380",
+    "departure": {
+      "localDateTime": "2023-11-10T09:00:00",
+      "iataCode": "NCE"
+    },
+    "arrival": {
+      "localDateTime": "2023-11-10T10:00:00",
+      "iataCode": "CDG"
+    }
+  },
+  "passengerCharacteristics": [
+    {
+      "passengerTypeCode": "ADT",
+      "age": 20
+    },
+    {
+      "passengerTypeCode": "CHD",
+      "age": 10
+    }
+  ]
+})
+
+amadeus.shopping.transferOffers.post(body).then(function (response) {
+    console.log(response);
+}).catch(function (response) {
+    console.error(response);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.TransferOffersPost;
+
+public class TransferSearch {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+        .build();
+
+    String body = "{\"startLocationCode\":\"CDG\",\"endAddressLine\":\"AvenueAnatoleFrance,5\",\"endCityName\":\"Paris\",\"endZipCode\":\"75007\",\"endCountryCode\":\"FR\",\"endName\":\"SouvenirsDeLaTour\",\"endGeoCode\":\"48.859466,2.2976965\",\"transferType\":\"PRIVATE\",\"startDateTime\":\"2023-11-10T10:30:00\",\"providerCodes\":\"TXO\",\"passengers\":2,\"stopOvers\":[{\"duration\":\"PT2H30M\",\"sequenceNumber\":1,\"addressLine\":\"AvenuedelaBourdonnais,19\",\"countryCode\":\"FR\",\"cityName\":\"Paris\",\"zipCode\":\"75007\",\"name\":\"DeLaTours\",\"geoCode\":\"48.859477,2.2976985\",\"stateCode\":\"FR\"}],\"startConnectedSegment\":{\"transportationType\":\"FLIGHT\",\"transportationNumber\":\"AF380\",\"departure\":{\"localDateTime\":\"2023-11-10T09:00:00\",\"iataCode\":\"NCE\"},\"arrival\":{\"localDateTime\":\"2023-11-10T10:00:00\",\"iataCode\":\"CDG\"}},\"passengerCharacteristics\":[{\"passengerTypeCode\":\"ADT\",\"age\":20},{\"passengerTypeCode\":\"CHD\",\"age\":10}]}";
+
+    TransferOffersPost[] transfers = amadeus.shopping.transferOffers.post(body);
+
+    if (transfers[0].getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + transfers[0].getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(transfers[0]);
+  }
+}
+
+
+
+
+

Transfer Booking

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+
+searchBody = '{ "startLocationCode": "CDG", "endAddressLine": "Avenue Anatole France, 5", "endCityName": "Paris", \
+    "endZipCode": "75007", "endCountryCode": "FR", "endName": "Souvenirs De La Tour", "endGeoCode": "48.859466,2.2976965", \
+    "transferType": "PRIVATE", "startDateTime": "2023-11-10T10:30:00", "providerCodes": "TXO", "passengers": 2, \
+    "stopOvers": [ { "duration": "PT2H30M", "sequenceNumber": 1, "addressLine": "Avenue de la Bourdonnais, 19", \
+    "countryCode": "FR", "cityName": "Paris", "zipCode": "75007", "name": "De La Tours", "geoCode": "48.859477,2.2976985", \
+    "stateCode": "FR" } ], "startConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "localDateTime": "2023-11-10T09:00:00", "iataCode": "NCE" }, \
+    "arrival": { "localDateTime": "2023-11-10T10:00:00", "iataCode": "CDG" } }, \
+    "passengerCharacteristics": [ { "passengerTypeCode": "ADT", "age": 20 }, { "passengerTypeCode": "CHD", "age": 10 } ] }'
+
+# Search list of transfers from Transfer Search API
+searchResponse = amadeus.shopping.transfer_offers.post(json.loads(searchBody))
+offerId = searchResponse.data[0]['id']
+
+
+offerBody = '{ "data": { "note": "Note to driver", "passengers": [ { "firstName": "John", "lastName": "Doe", "title": "MR", \
+    "contacts": { "phoneNumber": "+33123456789", "email": "user@email.com" }, \
+    "billingAddress": { "line": "Avenue de la Bourdonnais, 19", "zip": "75007", "countryCode": "FR", "cityName": "Paris" } } ], \
+    "agency": { "contacts": [ { "email": { "address": "abc@test.com" } } ] }, \
+    "payment": { "methodOfPayment": "CREDIT_CARD", "creditCard": \
+    { "number": "4111111111111111", "holderName": "JOHN DOE", "vendorCode": "VI", "expiryDate": "0928", "cvv": "111" } }, \
+    "extraServices": [ { "code": "EWT", "itemId": "EWT0291" } ], "equipment": [ { "code": "BBS" } ], \
+    "corporation": { "address": { "line": "5 Avenue Anatole France", "zip": "75007", "countryCode": "FR", "cityName": "Paris" }, "info": { "AU": "FHOWMD024", "CE": "280421GH" } }, \
+    "startConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" }, \
+    "arrival": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" } }, \
+    "endConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" }, \
+    "arrival": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" } } } }'
+
+# Book the first transfer from Transfer Search API via Transfer Booking API
+try:
+    response = amadeus.ordering.transfer_orders.post(json.loads(offerBody), offerId=offerId)
+    print(response.data)
+except ResponseError as error:
+    raise error
+
+
+
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
var Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_AMADEUS_API_KEY',
+  clientSecret: 'YOUR_AMADEUS_API_SECRET'
+});
+
+var searchBody =JSON.stringify({
+  "startLocationCode": "CDG",
+  "endAddressLine": "Avenue Anatole France, 5",
+  "endCityName": "Paris",
+  "endZipCode": "75007",
+  "endCountryCode": "FR",
+  "endName": "Souvenirs De La Tour",
+  "endGeoCode": "48.859466,2.2976965",
+  "transferType": "PRIVATE",
+  "startDateTime": "2023-11-10T10:30:00",
+  "providerCodes": "TXO",
+  "passengers": 2,
+  "stopOvers": [
+    {
+      "duration": "PT2H30M",
+      "sequenceNumber": 1,
+      "addressLine": "Avenue de la Bourdonnais, 19",
+      "countryCode": "FR",
+      "cityName": "Paris",
+      "zipCode": "75007",
+      "name": "De La Tours",
+      "geoCode": "48.859477,2.2976985",
+      "stateCode": "FR"
+    }
+  ],
+  "startConnectedSegment": {
+    "transportationType": "FLIGHT",
+    "transportationNumber": "AF380",
+    "departure": {
+      "localDateTime": "2023-11-10T09:00:00",
+      "iataCode": "NCE"
+    },
+    "arrival": {
+      "localDateTime": "2023-11-10T10:00:00",
+      "iataCode": "CDG"
+    }
+  },
+  "passengerCharacteristics": [
+    {
+      "passengerTypeCode": "ADT",
+      "age": 20
+    },
+    {
+      "passengerTypeCode": "CHD",
+      "age": 10
+    }
+  ]
+})
+
+// Search list of transfers from Transfer Search API
+amadeus.shopping.transferOffers.post(searchBody).then(function (searchResponse) {
+  var offerId = searchResponse.data[0].id; // Retrieve offer ID from the response of the first endpoint (Transfer Search API)
+
+
+var offerBody = JSON.stringify({
+  "data": {
+    "note": "Note to driver",
+    "passengers": [
+      {
+        "firstName": "John",
+        "lastName": "Doe",
+        "title": "MR",
+        "contacts": {
+          "phoneNumber": "+33123456789",
+          "email": "user@email.com"
+        },
+        "billingAddress": {
+          "line": "Avenue de la Bourdonnais, 19",
+          "zip": "75007",
+          "countryCode": "FR",
+          "cityName": "Paris"
+        }
+      }
+    ],
+    "agency": {
+      "contacts": [
+        {
+          "email": {
+            "address": "abc@test.com"
+          }
+        }
+      ]
+    },
+    "payment": {
+      "methodOfPayment": "CREDIT_CARD",
+      "creditCard": {
+        "number": "4111111111111111",
+        "holderName": "JOHN DOE",
+        "vendorCode": "VI",
+        "expiryDate": "0928",
+        "cvv": "111"
+      }
+    },
+    "extraServices": [
+      {
+        "code": "EWT",
+        "itemId": "EWT0291"
+      }
+    ],
+    "equipment": [
+      {
+        "code": "BBS"
+      }
+    ],
+    "corporation": {
+      "address": {
+        "line": "5 Avenue Anatole France",
+        "zip": "75007",
+        "countryCode": "FR",
+        "cityName": "Paris"
+      },
+      "info": {
+        "AU": "FHOWMD024",
+        "CE": "280421GH"
+      }
+    },
+    "startConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      }
+    },
+    "endConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      }
+    }
+  }
+})
+
+// Book the first transfer from Transfer Search API via Transfer Booking API
+  amadeus.ordering.transferOrders.post(offerBody, offerId).then(function (orderResponse) {
+    console.log(orderResponse);
+  }).catch(function (error2) {
+    console.error(error2);
+  });
+}).catch(function (error1) {
+  console.error(error1);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.TransferOrder;
+
+public class TransferOrders {
+
+    public static void main(String[] args) throws ResponseException {
+
+        Amadeus amadeus = Amadeus
+                .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+                .build();
+        Params params = Params.with("offerId", "5976726751");
+
+        String body = "{\n  \"data\": {\n    \"note\": \"Note to driver\",\n    \"passengers\": [\n      {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\",\n        \"title\": \"MR\",\n        \"contacts\": {\n          \"phoneNumber\": \"+33123456789\",\n          \"email\": \"user@email.com\"\n        },\n        \"billingAddress\": {\n          \"line\": \"Avenue de la Bourdonnais, 19\",\n          \"zip\": \"75007\",\n          \"countryCode\": \"FR\",\n          \"cityName\": \"Paris\"\n        }\n      }\n    ],\n    \"agency\": {\n      \"contacts\": [\n        {\n          \"email\": {\n            \"address\": \"abc@test.com\"\n          }\n        }\n      ]\n    },\n    \"payment\": {\n      \"methodOfPayment\": \"CREDIT_CARD\",\n      \"creditCard\": {\n        \"number\": \"4111111111111111\",\n        \"holderName\": \"JOHN DOE\",\n        \"vendorCode\": \"VI\",\n        \"expiryDate\": \"0928\",\n        \"cvv\": \"111\"\n      }\n    },\n    \"extraServices\": [\n      {\n        \"code\": \"EWT\",\n        \"itemId\": \"EWT0291\"\n      }\n    ],\n    \"equipment\": [\n      {\n        \"code\": \"BBS\"\n      }\n    ],\n    \"corporation\": {\n      \"address\": {\n        \"line\": \"5 Avenue Anatole France\",\n        \"zip\": \"75007\",\n        \"countryCode\": \"FR\",\n        \"cityName\": \"Paris\"\n      },\n      \"info\": {\n        \"AU\": \"FHOWMD024\",\n        \"CE\": \"280421GH\"\n      }\n    },\n    \"startConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    },\n    \"endConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    }\n  }\n}";
+
+        TransferOrder transfers = amadeus.ordering.transferOrders.post(body, params);
+        if (transfers.getResponse().getStatusCode() != 200) {
+            System.out.println("Wrong status code: " + transfers.getResponse().getStatusCode());
+            System.exit(-1);
+        }
+
+        System.out.println(transfers);
+    }
+}
+
+
+
+
+

Transfer Management

+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
import json
+from amadeus import Client, ResponseError
+
+amadeus = Client(
+    client_id='YOUR_AMADEUS_API_KEY',
+    client_secret='YOUR_AMADEUS_API_SECRET'
+)
+searchBody = '{ "startLocationCode": "CDG", "endAddressLine": "Avenue Anatole France, 5", "endCityName": "Paris", \
+    "endZipCode": "75007", "endCountryCode": "FR", "endName": "Souvenirs De La Tour", "endGeoCode": "48.859466,2.2976965", \
+    "transferType": "PRIVATE", "startDateTime": "2023-11-10T10:30:00", "providerCodes": "TXO", "passengers": 2, \
+    "stopOvers": [ { "duration": "PT2H30M", "sequenceNumber": 1, "addressLine": "Avenue de la Bourdonnais, 19", \
+    "countryCode": "FR", "cityName": "Paris", "zipCode": "75007", "name": "De La Tours", "geoCode": "48.859477,2.2976985", \
+    "stateCode": "FR" } ], "startConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "localDateTime": "2023-11-10T09:00:00", "iataCode": "NCE" }, \
+    "arrival": { "localDateTime": "2023-11-10T10:00:00", "iataCode": "CDG" } }, \
+    "passengerCharacteristics": [ { "passengerTypeCode": "ADT", "age": 20 }, { "passengerTypeCode": "CHD", "age": 10 } ] }'
+
+# Search list of transfers from Transfer Search API
+searchResponse = amadeus.shopping.transfer_offers.post(json.loads(searchBody))
+offerId = searchResponse.data[0]['id']
+
+
+offerBody = '{ "data": { "note": "Note to driver", "passengers": [ { "firstName": "John", "lastName": "Doe", "title": "MR", \
+    "contacts": { "phoneNumber": "+33123456789", "email": "user@email.com" }, \
+    "billingAddress": { "line": "Avenue de la Bourdonnais, 19", "zip": "75007", "countryCode": "FR", "cityName": "Paris" } } ], \
+    "agency": { "contacts": [ { "email": { "address": "abc@test.com" } } ] }, \
+    "payment": { "methodOfPayment": "CREDIT_CARD", "creditCard": \
+    { "number": "4111111111111111", "holderName": "JOHN DOE", "vendorCode": "VI", "expiryDate": "0928", "cvv": "111" } }, \
+    "extraServices": [ { "code": "EWT", "itemId": "EWT0291" } ], "equipment": [ { "code": "BBS" } ], \
+    "corporation": { "address": { "line": "5 Avenue Anatole France", "zip": "75007", "countryCode": "FR", "cityName": "Paris" }, "info": { "AU": "FHOWMD024", "CE": "280421GH" } }, \
+    "startConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" }, \
+    "arrival": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" } }, \
+    "endConnectedSegment": { "transportationType": "FLIGHT", "transportationNumber": "AF380", \
+    "departure": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" }, \
+    "arrival": { "uicCode": "7400001", "iataCode": "CDG", "localDateTime": "2023-03-27T20:03:00" } } } }'
+
+# Book the first transfer from Transfer Search API via Transfer Booking API
+orderResponse =  amadeus.ordering.transfer_orders.post(json.loads(offerBody), offerId=offerId)
+orderId = orderResponse.data['id']
+confirmNbr = orderResponse.data['transfers'][0]['confirmNbr'] 
+
+# Book the first transfer from Transfer Search API via Transfer Booking API
+try:
+    amadeus.ordering.transfer_order(orderId).transfers.cancellation.post('', confirmNbr=confirmNbr)
+except ResponseError as error:
+    raise error
+
+
+
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
var Amadeus = require('amadeus');
+
+var amadeus = new Amadeus({
+  clientId: 'YOUR_AMADEUS_API_KEY',
+  clientSecret: 'YOUR_AMADEUS_API_SECRET'
+});
+
+var searchBody =JSON.stringify({
+  "startLocationCode": "CDG",
+  "endAddressLine": "Avenue Anatole France, 5",
+  "endCityName": "Paris",
+  "endZipCode": "75007",
+  "endCountryCode": "FR",
+  "endName": "Souvenirs De La Tour",
+  "endGeoCode": "48.859466,2.2976965",
+  "transferType": "PRIVATE",
+  "startDateTime": "2023-11-10T10:30:00",
+  "providerCodes": "TXO",
+  "passengers": 2,
+  "stopOvers": [
+    {
+      "duration": "PT2H30M",
+      "sequenceNumber": 1,
+      "addressLine": "Avenue de la Bourdonnais, 19",
+      "countryCode": "FR",
+      "cityName": "Paris",
+      "zipCode": "75007",
+      "name": "De La Tours",
+      "geoCode": "48.859477,2.2976985",
+      "stateCode": "FR"
+    }
+  ],
+  "startConnectedSegment": {
+    "transportationType": "FLIGHT",
+    "transportationNumber": "AF380",
+    "departure": {
+      "localDateTime": "2023-11-10T09:00:00",
+      "iataCode": "NCE"
+    },
+    "arrival": {
+      "localDateTime": "2023-11-10T10:00:00",
+      "iataCode": "CDG"
+    }
+  },
+  "passengerCharacteristics": [
+    {
+      "passengerTypeCode": "ADT",
+      "age": 20
+    },
+    {
+      "passengerTypeCode": "CHD",
+      "age": 10
+    }
+  ]
+})
+
+amadeus.shopping.transferOffers.post(searchBody).then(function (searchResponse) {
+  var offerId = searchResponse.data[0].id; // Retrieve offer ID from the response of the first endpoint (Transfer search API)
+
+
+var offerBody = JSON.stringify({
+  "data": {
+    "note": "Note to driver",
+    "passengers": [
+      {
+        "firstName": "John",
+        "lastName": "Doe",
+        "title": "MR",
+        "contacts": {
+          "phoneNumber": "+33123456789",
+          "email": "user@email.com"
+        },
+        "billingAddress": {
+          "line": "Avenue de la Bourdonnais, 19",
+          "zip": "75007",
+          "countryCode": "FR",
+          "cityName": "Paris"
+        }
+      }
+    ],
+    "agency": {
+      "contacts": [
+        {
+          "email": {
+            "address": "abc@test.com"
+          }
+        }
+      ]
+    },
+    "payment": {
+      "methodOfPayment": "CREDIT_CARD",
+      "creditCard": {
+        "number": "4111111111111111",
+        "holderName": "JOHN DOE",
+        "vendorCode": "VI",
+        "expiryDate": "0928",
+        "cvv": "111"
+      }
+    },
+    "extraServices": [
+      {
+        "code": "EWT",
+        "itemId": "EWT0291"
+      }
+    ],
+    "equipment": [
+      {
+        "code": "BBS"
+      }
+    ],
+    "corporation": {
+      "address": {
+        "line": "5 Avenue Anatole France",
+        "zip": "75007",
+        "countryCode": "FR",
+        "cityName": "Paris"
+      },
+      "info": {
+        "AU": "FHOWMD024",
+        "CE": "280421GH"
+      }
+    },
+    "startConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      }
+    },
+    "endConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2023-03-27T20:03:00"
+      }
+    }
+  }
+})
+
+  amadeus.ordering.transferOrders.post(offerBody, offerId).then(function (orderResponse) {
+    var orderId = orderResponse.data.id; // Retrieve order ID from the response of the second endpoint (Transfer Order API)
+    var confirmNbr = orderResponse.data.transfers[0].confirmNbr; // Retrieve confirmation number from the response of the second endpoint (Transfer Order API)
+
+    // Transfer Management API to cancel the transfer order.
+    amadeus.ordering.transferOrder(orderId).transfers.cancellation.post(JSON.stringify({}), confirmNbr).then(function (response) {
+      console.log(response);
+    }).catch(function (error3) {
+      console.error(error3);
+    });
+  }).catch(function (error2) {
+    console.error(error2);
+  });
+}).catch(function (error1) {
+  console.error(error1);
+});
+
+
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
// How to install the library at https://github.com/amadeus4dev/amadeus-java
+import com.amadeus.Amadeus;
+import com.amadeus.Params;
+import com.amadeus.exceptions.ResponseException;
+import com.amadeus.resources.TransferCancellation;
+
+public class TransferManagement {
+
+  public static void main(String[] args) throws ResponseException {
+
+    Amadeus amadeus = Amadeus
+        .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET")
+        .build();
+    Params params = Params.with("confirmNbr", "12029761");
+
+    TransferCancellation transfers = amadeus.ordering
+        .transferOrder("VEg0Wk43fERPRXwyMDIzLTA2LTE1VDE1OjUwOjE4").transfers.cancellation.post(params);
+    if (transfers.getResponse().getStatusCode() != 200) {
+      System.out.println("Wrong status code: " + transfers.getResponse().getStatusCode());
+      System.exit(-1);
+    }
+
+    System.out.println(transfers);
+  }
+}
+
+
+
+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 00000000..a96b8624 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,1664 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code examples and prototypes - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Code examples and prototypes

+

To facilitate a smooth and efficient start, or to spark creativity in using our Self-Service APIs within your applications, we've assembled a compilation of code examples and prototypes. These resources aim to serve as guides for you to quickly integrate our APIs into your project.

+ + + + + + + + + + + + + + + + + + + + + +
AssetLink
Code examplesFor each SDK and API endpoint
Interactive code examplesFlight Search and Hotel Search
PrototypesOfficial prototypes
Community prototypes
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/live-examples/index.html b/examples/live-examples/index.html new file mode 100644 index 00000000..e53552b6 --- /dev/null +++ b/examples/live-examples/index.html @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Interactive examples - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Interactive examples

+ +

Interactive code examples

+

Explore our collection of interactive code examples, which can be easily integrated into your website. These examples allow you to view and modify the code to see how it affects the appearance and functionality of each component.

+

Flight Search form

+

The flight search form not only provides a simple and minimal user interface, but also includes validation rules for each field. It checks the mandatory fields takes into consideration all the search restrictions related to the passengers, such as it doesn't allow the number of infants to be higher than the number of adult passengers.

+

Additionally, this form has a responsive design and is easy to customize by changing colors or adding new fields. Find the full code at the Amadeus for Developers GitHub.

+ + +

Hotel Search form

+

The hotel search form apart from the user interface, it also includes validation rules to the fields. Furthermore, it has responsive design and can be easily customized to suit your website's aesthetics, whether by changing colors, adding new fields, or adjusting the layout.

+

You can find the full code for the hotel search form at the Amadeus for Developers GitHub.

+ + +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/prototypes/index.html b/examples/prototypes/index.html new file mode 100644 index 00000000..2e4eb596 --- /dev/null +++ b/examples/prototypes/index.html @@ -0,0 +1,2400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Prototypes - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Prototypes

+

Would you like to explore the applications that you could build with Amadeus Self-Service APIs? +We have prototypes available in Amadeus for Developers GitHub.

+

There are two types of prototypes (demo apps) available.

+
    +
  • Official prototypes are managed by Amadeus for Developers team and updated frequently to the latest version of APIs and SDKs.
  • +
  • Community prototypes are examples or demo apps that have been built and managed by developer community and it is not supported or maintained by Amadeus for Developers team.
  • +
+

Official Prototypes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use CasesAmadeus APIs usedTechnologyDetails
Flight booking engineFlight Offers Search, Flight Offers Price, Flight Create Order, Airport & City SearchPython, DjangoSee details
Hotel Booking engineHotel List, Hotel Search, Hotel BookingPython, DjangoSee details
Flight Search with Price Analysis & Trip purposeFlight Offers Search, Flight Price Analysis, Trip Purpose PredictionPython, DjangoSee details
Map with Hotels, Point of interests and Safety scoresHotel List, Points of Interest, Safe Place, Tours and ActivitiesPython, Django, HERE MapsSee details
+

Amadeus Flight Booking in Django

+
    +
  • Demo app: You can access the demo of the prototype here.
  • +
  • Source code: You can access the source code on GitHub.
  • +
+

The prototype is built with Django and the Amadeus Python SDK and demonstrates the end-to-end flight booking process, which works in conjunction with three APIs:

+ +

It also calls the Airport & City Search API to autocomplete the origin and destination with IATA code.

+

amadeus-flight-booking-django +amadeus-flight-booking-django-2

+

Amadeus Hotel Booking in Django

+
    +
  • Demo app: You can access the demo of the prototype here.
  • +
  • Source code: You can access the source code on GitHub.
  • +
+

The prototype is built with Python/Django and the Amadeus Python SDK. It demonstrates the end-to-end Hotel booking process (Hotel booking engine), which works in conjunction with three APIs:

+ +

amadeus-hotel-booking-django

+

Amadeus Flight Price Analysis in Django

+
    +
  • Demo app: You can access the demo of the prototype here.
  • +
  • Source code: You can access the source code on GitHub.
  • +
+

The prototype is built with Python/Django and the Amadeus Python SDK. It retrieves flight offers using the Flight Offers Search API for a given itinerary. Then it displays if the cheapest available flight is a good deal based on the Flight Price Analysis API. We finally predict if the trip is for business or leisure using the Trip Purpose Prediction API.

+

amadeus-flight-price-analysis-django

+

Amadeus Hotel Search with area safety and POIs

+
    +
  • Demo app: You can access the demo of the prototype here.
  • +
  • Source code: You can access the source code on GitHub.
  • +
+

The prototype is built by Python/Django and the Amadeus Python SDK, It demonstrates the safety information, POIs and tours for a chosen hotel on a map, using the following APIs:

+ +

amadeus-hotel-area-safety-pois-django

+

Prototypes from community

+

We have many other prototypes or demo apps that developers in our community built and shared! Explore them below or in Amadeus for Developers -Examples GitHub.

+
+

Warning

+

Projects from communities are examples that have been built and managed by developer community(Discord) and it is not supported or maintained by Amadeus for Developers team. The projects may not be up-to-date.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use caseAmadeus APIs usedTechnologyDetails
Trip purpose predictionTrip Purpose PredictionPython, djangoamadeus-trip-purpose-django
Hotel SearchHotel SearchSwiftamadeus-hotel-search-swift
Hotel booking engineHotel Search, Hotel BookingKotlinamadeus-hotel-booking-android
Flight Search with Artificial intelligenceFlight Offers Search, Flight Choice Prediction, Trip Purpose Prediction and Airport & City SearchPython, djangoamadeus-smart-flight-search-django
Flight SearchFlight Offers SearchPHP, wordpressamadeus-flight-search-wordpress-plugin
Flight Booking engineFlight Offers Search, Flight Offers price, Flight Create Orders, Airport & City SearchJava, Reactamadeus_java_flight_api
Airport & City autocompleteAirport & City SearchNode, Express, Reactamadeus-airport-city-search-mern
Flight Seatmap displaySeatMap DisplayReactamadeus-seatmap
Hotel booking engineHotel Search, Hotel BookingReact NativeAmadeusNodeServer, AmadeusHotelBookingPart1
Hotel booking engineAirport & City Search, Hotel Search, Hotel BookingNode, ReactBuilding-a-Hotel-Booking-App-in-NodeJS-and-React
Neighborhood safety mapSafe PlacePythonamadeus-safeplace
Map nearbyPoints of InterestsSwiftMyPlaces
Flight Booking engineFlight Offers Search, Flight Offers price, Flight Create Orders, Airport & City SearchNode, AngularFlight-booking-frontend and backend
Flight Search backendFlight Offers Search, Airport & City SearchBootstrap, Vanila JSBuilding-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API
Map nearbyPoints of InterestsAndroidAmadeus_POI_Android  
Hotel booking engineHotel Search, Hotel BookingRuby on Railsamadeus-hotel-booking-rubyonrails
Flight status notification serviceOn-Demand Flight StatusPythonamadeus-async-flight-status
Flight Calendar searchAirport & City Search, Flight Offers SearchNode, SvelteFlightSearchCalendar  
Airport & City autocompleteAirport & City SearchNode and ExpressLive-Airport-City-Search
Flight BookingFlight Offers Search, Flight Offers Price, Flight Create OrdersNode, Vueamadeus-flight-booking-node
+

amadeus-trip-purpose-django

+

This project (Link to GitHub) demonstrates how to integrate Amadeus APIs using the Python SDK in a Django application. The end user submits round-trip information via a form and the Trip Purpose Prediction is called. This API predicts if the given journey is for leisure or business purposes.

+

amadeus-trip-purpose-django

+

amadeus-hotel-search-swift

+

This prototype (Link to GitHub) demonstrates a simple iOS hotel search app from scratch using Amadeus Hotel Search API (version 2.1 - decommissioned) and iOS SDK.

+

amadeus-hotel-search-swift

+

amadeus-hotel-booking-android

+

This prototype (Link to GitHub) shows how to use the Android SDK to build a Hotel Booking Engine in Android Studio.

+

amadeus-hotel-booking-android

+

amadeus-smart-flight-search-django

+

This prototype (Link to GitHub) shows how the Air APIs can be integrated with the Django framework and Python SDK, by calling the Flight Choice Prediction and Trip Purpose Prediction. We also call the Flight Offers Search as a more traditional method of flight search and we compare its results with the Flight Choice Prediction ones to show the power of AI.

+

amadeus-smart-flight-search-django

+

amadeus-flight-search-wordpress-plugin

+

This prototype (Link to GitHub) demonstrated how to create a WordPress plugin to build a basic flight search feature using Flight Offers Search API.

+

amadeus-flight-search-wordpress-plugin

+

amadeus_java_flight_api

+

This app (Link to GitHub) is an example of how to use the Amadeus Flight APIs to search and book a flight. The application uses a Spring backend and a React frontend.

+

amadeus-airport-city-search-mern

+

This application (Link to GitHub) implements airport and city name autocomplete box powered by the Airport & City Search API. It consists of a simple Node and Express backend that connects to the Amadeus API with Node SDK, and a small React app that talks to a Node/Express backend and use it to obtain the airport name data from Amadeus.

+

amadeus-seatmap

+

This prototype (Link to GitHub) demonstrates how to display a flight seatmap using SeatMap Display API with React.

+ +

amadeus-seatmap

+

AmadeusNodeServer, AmadeusHotelBookingPart1

+

This prototype consists of 2 Github repositories (GitHub to Node Server and GitHub to React Native). It demonstrates a Hotel booking application in iOS using React Native. There is a series of blogs to elaborate further to build an app with this prototype.

+ +

AmadeusNodeServer, AmadeusHotelBookingPart1

+

amadeus-safeplace

+

This prototype (Link to GitHub) demonstrates a neighbourhood safety map in Python to let users compare the relative safety levels of different neighbourhoods. You will use the Safe Place API for the safety scores and HERE Maps to visualize them on a map.

+ +

amadeus-safeplace

+

MyPlaces

+

This prototype (Link to GitHub) demonstrates an iOS application that finds nearby places and displays them on a map. You will use the Points of Interest API to retrieve the places and MKMapView for the map.

+ +

MyPlaces

+

Building-a-Hotel-Booking-App-in-NodeJS-and-React

+

This prototype consists of 2 code sets (Github to Backend and Github to Frontend). It demonstrates a complete hotel booking app using Node on the backend and React for the frontend.

+ +

Building-a-Hotel-Booking-App-in-NodeJS-and-React

+

Flight-booking-frontend and backend

+

This prototype consists of 2 code sets (Github to Backend and Github to Frontend). It demonstrates a complete flight booking application using Node in the backend and Angular for the front end.

+ +

Flight-booking-frontend and backend

+

Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API

+

This prototype consists of 2 code sets (Github to Frontend and Github to Backend). It demonstrates a flight booking engine with Flight Offer Search API using Bootstrap and Vanilla JS for frontend and Express for the backend.

+ +

Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API

+

Amadeus_POI_Android

+

This app (Link to GitHub) demonstrates the usage of Amadeus Points of Interest API to +fetch the list of best attractions near the user's current location and +displays them on a list as well as a map.

+

amadeus-hotel-booking-rubyonrails

+

This prototype (Link to GitHub) demonstrates an end-to-end Hotel booking process, which works in conjunction with 2 APIs, Hotel Search API and Hotel Booking API.

+

amadeus-async-flight-status

+

This prototype (Link to GitHub) demonstrates an application with event-driven microservices that asynchronously consume events coming from the API and notifies end users of these events via SMS using Twilio SMS API.

+ +

amadeus-async-flight-status +amadeus-async-flight-status

+

FlightSearchCalendar

+

This application (Link to GitHub) demonstrates a calendar application to display the flights within a date interval to find the cheapest possible prices using Amadeus APIs.

+ +

This application (Link to GitHub) lets you perform a live search for Airports and Cities through the Airport & City Search API. The implementation is done through jQuery Autocomplete with Node and Express as the backend for which connects to the Amadeus API with Node SDK.

+

Live-Airport-City-Search

+

amadeus-flight-booking-node

+

The Amadeus Flight Booking app is built with Node and Vue using the Node SDK. You can find the source code on GitHub

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/faq/index.html b/faq/index.html new file mode 100644 index 00000000..3e1ef580 --- /dev/null +++ b/faq/index.html @@ -0,0 +1,4171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FAQ - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Frequently Asked Questions

+

This page provides help with the most common questions about Amadeus Self-service APIs.

+

Account registration

+

How do I change my password?

+

To change your password, sign in to the Developers portal and click on My Account in the top right corner of the screen. You'll find the option to change your password at the bottom of the page. Please remember that we never send your password in any correspondence.

+

I registered but never received a confirmation email? What should I do?

+

If you haven't received a confirmation mail, it is often because the email address was entered incorrectly. Please sign in to the Developers portal and visit the My Account section to confirm that the email address used to create the account is correct. If so, please check your spam folder for an email from noreply@amadeus.com.

+

Business enquiries

+

How can I monetise my application?

+

You are free to create your own business models around our APIs, such as charging users to use our APIs in their apps or adopting a subscription-based model. However, we do not give any commission or other types of incentives for the Self-Service API. The latter is only possible in the Enterprise framework. If you're offering flight booking services, you can generate revenue for your apps by applying a markup on flight offers.

+

I would like to partner up with Amadeus

+

You can partner with Amadeus through the Amadeus Partner Network. This includes different types of partnerships, with the possibility to get access to technology or to connect to Amadeus' global network of customers and partners.

+

Self-Service vs Enterprise

+

What is the difference between Self-Service and Enterprise APIs?

+

Amadeus for Developers provides two different offers, each of which meets distinct customer needs: Self-Service and Enterprise.

+

The Self-Service offer targets independent developers and start-ups that wish to connect to Amadeus APIs in a quick and easy manner. You can access and start testing these new REST/JSON APIs in less than 3 minutes, and get quick access to production data with a flexible pay-as-you-go pricing model. Please note that the catalog includes some selected APIs only, although we will be constantly releasing new APIs.

+

The Enterprise offer provides access to the full Amadeus APIs catalog, tailored to companies with scaling needs as well as the leading brands in the travel industry. Customers of Enterprise APIs receive dedicated support from their account managers and enjoy a customized pricing scheme to meet their needs. Please note that access to Enterprise APIs is only granted on a request basis, and some special requirements may apply. Our Enterprise commercial teams will be happy to guide you through the process.

+

Can I use APIs from both Self-Service and Enterprise?

+

Yes, you can use APIs from both catalogs, but please keep in mind that the requirements and conditions of each offer are very different. Please check our Get Started guide for more information.

+

How can I contact Enterprise?

+

To contact the Enterprise team, please fill in the following contact us form and someone from the Enterprise team will get back to you shortly. Please keep in mind that the access to Enterprise requires an implementation fee as well as monthly fees.

+

How much do I need to pay to access Enterprise APIs?

+

The access to Enterprise APIs is subject to certain requirements depending on your market and the functionalities you want to access. It is usually reserved for experienced companies with the need to scale. Before we can disclose the pricing details you will need to sign an NDA.

+

Self-Service APIs general

+

Is there a test environment to try the Self-Service APIs?

+

Yes! You can try Self-Service APIs in our test environment and enjoy a free monthly request quota to build and test your app. If you exceed this free request quota in the test environment, you'll receive a 429 error code in JSON and not be able to call the APIs.

+

If you need to increase the number of monthly API calls, please consider moving your application to production. It's a quick and easy process and you will keep the free request quota you enjoyed in test. Once you reach your threshold in production, you will simply pay for the additional API calls you make.

+

How do I access the Self-Service APIs documentation?

+

Check our Amadeus for Developers docs portal for links to interactive reference documentation for each API and helpful guides covering topics such as authorization, pagination and common errors. On the Amadeus for Developers GitHub page, you can also find code samples and SDKs.

+

Do you provide SDKs?

+

Yes! On the Amadeus for Developers GitHub page you can find open-source SDKs in various languages. Alternatively, you can use OpenAPI Generator to create an SDK from our OpenAPI files.

+

Where can I see code examples for Amadeus Self-Service APIs?

+

Code examples for all Amadeus Self-Service APIs are available in our GitHub.

+

How do I make my first Self-Service API call?

+

On the Get Started with Self-Service APIs page you can find information on creating an account, getting your API key and making your first call.

+

How do I move Self-Service APIs from test to production?

+

To launch your application to production, please follow the steps described in our Moving to production guide.

+

You will be asked to sign a contract and provide billing information before receiving your new API key. When you move to production, you will maintain the same free monthly request quota you enjoyed in test. When you reach your monthly threshold, you will be billed for the additional API calls you make at the rates shown on our Pricing page.

+

How do I delete my application built using Self-Service APIs?

+

To delete an application, visit the My apps section of your My Self-Service Workspace. Remember that deleted apps cannot be recovered.

+

Will you include more APIs in the Self-Service catalog?

+

We are constantly expanding our Self-Service API catalog with new APIs from all travel segments such as flights, hotels, cars or destination content. If you have any specific requests or feedback regarding APIs that you would like to add to your catalog, please contact us. We'd love to hear from you!

+

What are the terms of service for Amadeus Self-Service APIs?

+

To find out more about our terms and conditions for the test environment, please visit our Terms and Conditions page.

+

If you are already in production, you should have received an email with the legal terms regulating API usage in the production environment. If you have not received this information, please contact us.

+

I am not a travel agent and have no experience in the travel industry, can I still use the Self-Service APIs?

+

Our Self-Service offer is designed for newcomers to Amadeus, there are no prerequisites. Any developer who wishes to connect to Amadeus travel data can do so in a quick and easy way via our Self-Service offer. For more details, please check our Get Started guide.

+

Are there any limitations to the Self-Service API dataset?

+

We do not return data on American Airlines, Low cost carriers, and, in some markets, British Airways. For other arlines we only return published rates. We do not return negotiated rates or any other special rates. The Flight Offers Search only returns the bag allowance information for one passenger type code. Airlines blacklisted in the EU are not returned using the Flight Offers Search GET, e.g., Iraqi Airways. There is a possibility to override this with the POST method.

+

How can I do group booking?

+

Our Self-Service APIs allow you to book up to 9 passengers on the same PNR number. For more passengers you will need to create a new booking.

+

What is it returning different prices with the Self-Service APIs and other Amadeus solutions?

+

The Self-Service catalog only returns published GDS rates. If you have access to special rates through another solution, they will not be available through our Self-Service APIs.

+

Do I need an IATA license?

+

IATA or ARC licenses (depending on your market) are mandatory if you want to issue flight tickets, but this option is only available in our Enterprise framework. In Self-Service you will need to work with an airline consolidator to issue flight tickets, therefore no IATA or ARC license is needed.

+

API keys

+

What is an API key?

+

An API key is a unique reference number which identifies your application to Amadeus. The API key is part of the authorization process and must be sent with each API request. If you have multiple applications using Amadeus APIs, each application must have its own API key. For more details, check our Authorization guide.

+

Your API keys are also used to track usage. To avoid unwanted charges, please do no share or post them in public repositories. For more information, see this article on best practices for secure API key storage.

+

How do I get my Self-Service API key?

+

To get a Self-Service API key, simply create an account in the Amadeus for Developers portal. Next, visit the My Self-Service Workspace area and create your first application. An API key will be generated automatically. Remember, your API key is private and should not be shared publicly.

+

Why is my Self-Service API key not working?

+

If your API key is not working, please verify that it is the same exact key that was provided in the My Self-Service Workspace.

+

Please keep in mind that we automatically revoke API keys that are publicly searchable. This is done to protect users against unwanted usage bills. As a general rule, you should not put your API keys in the source code you commit to GitHub or other public repositories. Instead, you should store your keys as environment variables rather than hard-coding them in your script. For more information, see this article on best practices for secure API key storage.

+

How long is my Self-Service access token valid for?

+

The access token is valid for 1800 seconds (30mins). If you get an authentication fail, please request a new token.

+

Can I use my API key in a public repository?

+

Storing your API keys or any other sensitive information in a public repository must be avoided at all costs to prevent malicious access to your APIs, which could result in unwanted usage bills.

+

In order to protect our users, we automatically revoke API keys that are publicly searchable. We recommend that you store your keys as environment variables rather than hard-coding them in your script. For more information, see this article on best practices for secure API key storage.

+

Why has my API key been revoked?

+

We automatically revoke publicly searchable API keys to prevent unwanted charges to your account. To prevent this from happening, you should read your API key from a system environment variable rather than putting it in the source code you commit to GitHub. If you need to get a new API key, please go to My Self-Service Workspace.

+

Billing

+

How is billing calculated for Self-Service APIs?

+

It is free to test and prototype with Self-Service APIs and you will enjoy a free monthly request quota in both the test and production environments.

+

When you exceed your free request quota in production, you will be billed for the additional calls you make at the rates indicated on our Pricing page, with no additional fees. Please note that prices vary from one API to another.

+

You can check your monthly usage and select your preferred payment method (credit card or bank transfer) in your Self-Service Workspace.

+

How do I request a refund of my Self-Service usage bill?

+

If you're a Self-Service API user, please send your refund requests via the contact us and our team will carefully analyse them. You will be notified if your refund is approved and be reimbursed within the following days (please note that refund processing times may vary depending on your bank).

+

Where can I find my invoices?

+

You will receive your invoices on a monthly basis from data.distribution@amadeus.com. Please note that once opened, you will not be able to open the same invoice again.

+

Test collection

+

Is there a limit to the calls I can make to Self-Service APIs in the test environment?

+

Yes, each Self-Service API in test includes a limited number of free monthly calls. This free request quota varies from one API to another and it applies to the sum of all your applications. If you exceed the quota in test, you'll receive a 429 error code in JSON.

+

To see how many free requests remain, log into your account and check your API usage & quota in your Workspace area. Please keep in mind that it can take up to 12 minutes for data to appear.

+

Your free request quota should be sufficient for testing purposes. If you need to increase your number of monthly API calls, please consider moving your application to production. The process is quick and simple and you will keep the free request quotas you enjoyed in test.

+

What should I do if I'm about to reach my Self-Service free request quota limit?

+

The test environment is designed for testing purposes. Every month, you'll receive a free request quota to build and test your app. If you need to increase your number of monthly API calls, please move your application to production. The process is quick and easy, and you will keep the free monthly request quota you enjoyed in test. Once you exceed your quota in production, you will be billed for the additional API calls you make.

+

Is there a limit to the calls I can make to Self-Service APIs in the production environment?

+

There is no consumption limit in production, as long as there are no outstanding usage bills and your account's payment method is up to date.

+

Why do I get a 429 error in JSON if I have some free calls left?

+

After making API call, it can take up to 12 minutes for the data to appear on your usage & quota page. If you are nearing your limit free request quota limit and receive a 429 error, it's likely that you have run out of free calls.

+

To keep using the APIs, you can either move your app to production or wait until the free request quota is reset at the beginning of each month.

+

Why do I get an error code 429 when I call a Self-Service API?

+

This error indicates you carried out too many requests and went over your limit of free calls for this API.

+

If you wish to keep using the APIs, you can either move your app to production and enter your preferred payment method or alternatively wait until the following month to get more free calls.

+

Is the data returned in the Self-Service test environment accurate?

+

The information returned in test environment is from limited data collections. This is done as a security measure to protect our data and our customers. When you move to production, you will get access to complete and live data.

+ + +

This API works with cached data in the test environment and not all airports are cached. You can find a list of airports included in the cached data in our guides section. When combining these searches with the Airport Nearest Relevant API, it is better to search using the city code rather than the airport code.

+

Why are some origin and destination pairings not returning results?

+

The Flight Inspiration Search and Flight Cheapest Date Search APIs are built on top of a pre-computed cache of selected origin-destination pairs. This is why, even in production, you cannot find all possible origin-destination pairs. If you need to access more results, you need to use the live Flight Offers Search API.

+

Airport routes

+

The API returns an airport that has been permanently closed

+

This is the expected behavior. The IATA code in the response corresponds to the Destination City IATA code but not the Airport Code.

+

Airport Nearest Relevant API

+

Why isn't the Airport Nearest Relevant API returning a specific airport near me?

+

This may be because an airport is near a national boarder. If so, please check the API parameters for location. Also, please keep in mind that our Airport Nearest Relevant API excludes private and military airports.

+ +

Why are the prices returned more expensive than on other websites?

+

The API only returns published rates, which are the standard rates given by airlines. Amadeus then redistributes them to the travel agencies around the world. However, big players in the industry can negotiate their rates directly with the airlines, which can help them be more competitive or maximise returns made form selling tickets.

+

What does nonHomogeneous mean in the API response?

+

PNRs are designed to be homogeneous, meaning that one PNR contains the same type of content (e.g., flights only) and number of passengers. However, nowadays, there can be a mix of different content, such as air and hotel. When nonHomogeneous is true, it means that a single PNR can contain records that would initially be split across different PNRs.

+

Why the dataWindow parameter returns less results with I3D or I2D?

+

This is normal behaviour. Flight Offers Search returns the cheapest option for all flights. When you request an extra delay in the search (+/- xDays), Flight Offers Search takes a matching flight (i.e., AF111), checks all possible days, and returns only the cheapest offers. Using more filters does not increase the number of results. It increases the range of data the API uses to find the cheapest offers to return. Having fewer options between 'I3D' and 'I2D' is normal. With 'I2D,' you most likely compare a working week with very regular flights, and with 'ID3,' you always include weekend flights on top, so there are more options.

+

How can I add a loyalty program to a booking?

+

Flight Offers Price and SeatMap Display both accept frequent flyer information, so end-users can benefit from their loyalty program. When adding frequent flyer information, please remember that each airline policy is different, and some require additional information like passenger name, email, or phone number to validate the account. If validation fails, your user won’t receive their loyalty program advantages.

+

POST and GET do not return the same results

+

By default the GET method does not return airlines blacklisted in Europe. However, users can override this using the POST method.

+

How do I add bags to a check in bag for flight reservation?

+

You can add a checked-in bag to a flight booking using the ‘’additionalServices’’ element in the flight offer when calling Flight Offers Price. For more details, please check our guide on adding baggage with Amadeus flight booking APIs.

+

How do I add bags to a cabin bag for flight reservation?

+

Our APIs do not return cabin bag information in the responses, and it is not possible to add an additional cabin bag to a booking.

+

Can I display the price of flights using air miles/loyalty points and book a flight?

+

Our Self-Service APIs do not let you display the prices in loyalty points or book a flight using loyalty points.

+

Why are some taxes refundable?

+

A refundable tax is a type of tax or fee that is collected when you purchase an airline ticket but can be refunded to the passenger under certain circumstances, these conditions will vary depending on the specific country and airline.

+

How can I integrate flight booking?

+

You can integrate flight booking using our Self-Service APIs. Production access is subject to certain requirements, including being registered in one of our approved markets, meeting your local legal requirements, and working with an airline consolidator to issue tickets.

+

The booking flow involves the following APIs: +- Flight Offers Search: to search for the best bookable flight offers. +- Flight Offers Price: confirms the latest price and availability of a specific chosen flight. +- Flight Create Orders: to book flights and ancillary services proposed by the airline. +- Flight Orders Management: to manage and consult your bookings. This API also includes an endpoint to cancel the reservation.

+

Once you generate a booking in production, your consolidator will receive it in their back office and issue the tickets from there. After the ticket has been issued, you will need to contact your consolidator for any modifications to the booking or refund requests. +For more information on flight booking please check our guide on how to build a flight booking engine.

+

Do you provide Co2 emission?

+

You can return Co2 emissions for a flight only after booking it. The information will be included in the response of Flight Create Orders API.

+

What are fare rules?

+

Fare rules are a set of conditions that determine the price of an air ticket for each seat class. They also define whether a ticket is refundable/nonrefundable or whether additional charges are applicable. You can return those with our Self-Service APIs using Flight Offers Price and adding ''include=detailed-fare-rules'' in your base URL:

+

https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules

+

Please keep in mind that this will return the fare rules in a raw format. If you want a structured version of these, you will need to use our Enterprise APIs.

+

Do you return airline logos?

+

We do not return airline logos in our Self-Service catalog.

+

Flight Offers Price

+

How can we get information on refundable flights?

+

To get the refund policy for a specific flight, you will need to use the Flight Offers Price API, with the parameter include set to detailed-fare-rules at the endpoint of the URL as follows: https://api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules

+

Flight Price Analysis

+

Why do some origin and destination pairings not return any results?

+

Not all possible routes are supported by the API even in production. The reason is that the machine learning model filters out all the routes with an error rate below 15% MAPE (Mean absolute percentage error). For more insights on how the model works, please refer to this blog post.

+

Flight Delay Prediction

+

Why do I get the INFERENCE error?

+

This means the requested origin/city pairing was not included in our training data. So, we have no previous information on whether that flight is normally delayed or not.

+ +

Why are some origin and destination pairings not returning results?

+

The Flight Inspiration Search & Flight Cheapest Date Search APIs are built on top of a pre-computed cache of selected origin-destination pairs. This is why, even in production, you cannot find all possible origin-destination pairs. To access more results, you need to use the live Flight Offers Search API.

+

Why do I get the 500 error message?

+

The 500 error message 'SYSTEM ERROR HAS OCCURRED', 'detail': 'Primitive Timeout' is caused by the search being too generic, and the API taking too much time to fetch the data. Unfortunately, there is nothing we can do about this for now. The solution will be to filter the search down using more parameters.

+ +

Why are some travel classes not returned in the search results?

+

Travel class is not standardized, and some airlines may use different letters for the same travel class. For example, All Nippon Airways does not use 'Class: I'. By default, this API excludes closed booking classes, departed flights, and cancelled flights. To return closed content, you can use the parameter includeClosedContent and set it to true.

+

Branded Fares Upsell

+

Why do additional services change between segments in an Itinerary?

+

Additional services can change between segments in an itinerary. For example, a passenger could end up with a checked bag which is allowed in one of the segments of an itinerary but not on the others (because of its weight or because it's not included at all). This is normal behavior for this API. The packages are created at the flight level. This means that even an itinerary made up of two flights from the same airline could have different upsell options. Additionally, not every airline will have the option to upsell.

+

SeatMap Display

+

Is there any way to request a seat map by cabin instead of having to specify a booking class code?

+

There is no way to specify a cabin, but you will get this information in the response of Flight Offers Search. This will allow you to filter based on that.

+

Why do I get the error code 4926?

+

Returning the error: 'warnings': [{'code': 4926, 'title': 'INVALID DATA RECEIVED', 'detail': 'Invalid departure/Arrival city pair'}] is caused by airlines choosing not to display the seat map of some flights, so the API returns a warning with the information we have.

+

Seatmap not available as flight operated by another carrier

+

This error is generated when the specified flight in the query is a codeshare, and no agreement exists with the operating flight. Unfortunately, the only way to mitigate this in the future is to avoid calling the SeatMap Display API with this specific operating carrier.

+

Why am I unable to retrieve seatmap data?

+

This error message means that the airline never filled in a seat map for the specific flight. It's usually not generic to all flights of the airline. Unfortunately, there is no solution for this one.

+

What does AVAILABLE, BLOCKED, and OCCUPIED mean in the response?

+
    +
  • AVAILABLE: the seat is not occupied and is available to book.
  • +
  • BLOCKED: the seat is not occupied but isn’t available to book for the user. This is usually due to the passenger type (e.g., children may not sit in exit rows), or their fare class (e.g., some seats may be reserved for travelers in higher classes).
  • +
  • OCCUPIED: the seat is occupied and unavailable to book.
  • +
+

Flight Create Orders API

+

How are tickets issued for flights booked with Flight Create Orders in Self-Service?

+

For Self-Service users, ticketing must be done via airline consolidator. Airline consolidators are essentially air ticket wholesalers that have special arrangements with airlines and, among other functions, can serve as host agencies for travel agents without the necessary IATA/ARC certifications necessary to issue tickets.

+

To access Flight Create Orders in production, you must have a contract signed with a consolidator for ticket issuance. If you need help finding a consolidator, please contact our support team to put in touch with the best consolidator in your region.

+

How can I retrieve booking made with Flight Create Orders in Self-Service?

+

You can consult booking made through Flight Create Orders using the Flight Order Management API. This API works using a unique identifier(the flight offer id) that is returned by the Flight Create Orders API.

+

Does Amadeus pay a commission for flights booked with Flight Create Orders in Self-Service?

+

Generally, Amadeus does not offer booking commissions for Self-Service users.

+

Why do I get the INVALID DATA RECEIVED error?

+

Getting the error message: INVALID DATA RECEIVED. Some of the data in the query is false. It could be that the fare does not match the traveling class, or that the flight number is incorrect. This is common to all our APIs. It comes from the API backend validating your query. All the fields of the price reply should be exactly the same as the one from the book query to be sure there is a problem.

+

Why do I get the SEGMENT SELL FAILURE error?

+

Getting the error message: SEGMENT SELL FAILURE means that you were not able to book the seat in the airline inventory. Most of the time, it comes from the flight being full. This often happens in the test environment, as you can perform many bookings without restrictions (no real payment). But the inventory is a copy of the real one, so if you book many seats, the inventory can get empty and you won't be able to book anymore. The good practice here is to use Flight Offers Price right before booking and avoid last-minute flights that tend to quickly get full.

+

How does payment work when I book a flight?

+

There are two things to consider regarding payments for flight booking:

+
    +
  1. +

    The payment between you (the app owner) and your customers (for the services provided + the price of the flight ticket). You decide how to collect this payment. It is not included in the API. A third-party payment gateway, like Stripe for example, will be the easiest solution for this.

    +
  2. +
  3. +

    The payment between you and the consolidator (to be able to pay the airline and issue the flight ticket). This will be done between you and your consolidator of choice and is to be agreed upon with the consolidator.

    +
  4. +
+

How can I cancel a flight?

+

Cancellation is possible with the Flight Orders Management API as long as the booking has not been issued by the consolidator yet. If the booking has been issued, it will need to be canceled by the consolidator directly.

+

How to make the airline consolidator wait before issuing a ticket?

+

You can delay ticketing using the ticketingAgreement parameter in Flight Create Orders. For this, you can use the following options:

+
    +
  • DELAY_TO_QUEUE: this allows you to queue the reservation for the desired date if the traveller does not make the payment.
  • +
  • DELAY_TO_CANCEL: if the traveler does not make the payment, the reservation for the desired date will be cancelled.
  • +
+

The queuing and cancellation take place based on the local date and time. If no specific time is mentioned, the reservation is queued or cancelled at 00:00.

+

Can I markup prices of flight tickets sold?

+

Yes you are free to add a markup on any flight ticket. This must be done through your own payment gateway.

+

How can I modify my booking once the ticket is issued?

+

This is not possible through our Self-Service APIs. Once a ticket has been issued you will need to contact the consolidator for any changes, and this will be subject to a fee. +In case the ticket has not been issued. You will need to delete the booking and rebook with the modifications.

+

Hotel Search & Book

+

What are guarantee, deposit and prepay?

+
    +
  • Guarantee: The hotel will save credit card information during booking but will not make any charges to the account. In the case of a no-show or out-of-policy cancellation, the hotel may charge penalties to the card.
  • +
  • Deposit: At the time of booking or on a given deadline, the hotel will charge the guest a percentage of the total amount of the reservation. The remaining amount is paid by the traveler directly at the hotel.
  • +
  • Prepay: The traveler must pay the total amount of the reservation during booking.
  • +
+

What is the total price?

+

The price total refers to the total price to be paid for the full stay. The variations, on the other hand, represent the average price per night. In the example you highlighted, a guest will need to pay €548.56 for the three nights, and the average price for the room is €182.85 per night (€548.55 overall). For more details, you can refer to our data model found in the OpenAPI specification of the Hotel Search API.

+

What is the latest possible date for check-in?

+

The maximum date for the 'checkInDate' parameter is 359 days from today. Anything beyond this will return the error message 'MAXIMUM ADVANCE DAYS BOOKING EXCEEDED'.

+

How to search a hotel by location

+

Regarding the input for a specific location in a hotel search, you have the following options:

+
    +
  • +

    Since the commissioning of Hotel Search v3, we can no longer search hotels by IATA codes. In order to search by location you will need to use the third endpoint of Hotel List /reference-data/locations/hotels/by-geocode, which allows you to search using a latitude & longitude. The Hotel List API returns hotelIds based on the specific search coordinates. You will then need to use this hotelId in the third endpoint of the Hotel Search API.

    +
  • +
  • +

    Alternatively, you can use the Google API to retrieve the geo location of a specific location and use the Hotel Search by geo location.

    +
  • +
+

What type of payments are supported?

+

The current version of the Hotel Booking API only supports credit card payments. The Hotel Search API returns the payment policy of each hotel under acceptedPayments in the policies section.

+

Can I markup the room prices?

+

It is not possible to markup the prices of the hotel rooms with the current version of the Hotel Booking API. The reason is that the content we offer today in our Hotel Search/Book API is post-paid, meaning the traveler will pay directly at the hotel. The Hotel Booking API is here to enable making a reservation but not to pay directly. We are working on adding more hotel offers, especially offers that will be pre-paid, meaning you will be able to charge the travelers directly and add a markup. However, you still need to add a credit card while booking in case of cancellations or no-shows.

+

Payment providers and gateways

+

The Hotel Booking API works by using the guest's payment information and sending it to a chosen hotel for the reservation. You can use a payment gateway in your app, but this will not change the way the API works. The hotels will never collect any money from you. Instead, the payments are always done at the time of checkout between the guest and the hotel. During the booking process, Amadeus passes the payment and guest information to the hotel but does not validate information, so it doesn’t play the role of payment gateway. Be sure to validate the payment and guest information as invalid information may result in the reservation being canceled. As soon as your application stores, transmits, or processes cardholder information, you will need to comply with the PCI Data Security Standard (PCI DSS). For more information, visit the PCI Security Council website.

+

How can I cancel a room booking?

+

As of now, the hotel booking API does not allow canceling rooms. If this option is possible with your hotel offer, the cancellation will have to be done manually with the hotels. We are working on an API for the cancellation; however, it is still too soon to commit to anything.

+

Why do I get 500 status code?

+

The process of booking a hotel in the test environment involves sending your request to each hotel provider, and each provider has its own environment and rules. Due to these differences, there may be connectivity issues with the providers that can result in a timeout. Additionally, if many requests are sent to a particular hotel, they may choose to block them. If you provide us with a timestamp and details of another API request that has failed, including the hotel in question, we can search our logs to find more information. However, it is likely that the issue is one of the aforementioned cases.

+

How can I see Amadeus API coverage for a hotel chain?

+

You can find the list of supported hotel chains in our data collection.

+

What is considered a query?

+

When you make an initial call to the Hotel Search API with a cityCode parameter, it is considered one query that returns 10 hotels. If you then click on each hotel to view room details and other information, you are making additional API calls using the second endpoint of the Hotel Search. Each hotel that you click on generates another API call. For example, if you click on 5 hotels to see room details, you will be making a total of 5 additional queries.

+ +

No, there are no legal documents required. However, you will need to comply with any local legal requirements for your market.

+

What are the room type codes?

+

The room type code is a 3-character identifier that indicates the room type category, the number of beds, and the bed type. However, some hotels may not follow this pattern and instead use custom types. In such cases, the room description is the best way to understand the room type.

+

How do I cancel a hotel?

+

There is no way to cancel hotel bookings through the APIs. This needs to be done offline by ringing the hotels.

+

Why is Hotel Search returning empty responses ‘{"data": []}’?

+

You are returning this because this specific hotel is closed or unavailable for this specific date. You can either try to change the check-in date or use the ''includeClosed'' parameter set to ''true''. The latter will return further information on the hotel, but you will not be able to book it.

+

Do you return hotel images?

+

Hotel images are not available through our Self-Service catalog.

+

Airline consolidators

+

What is an airline consolidator?

+

Airlines consolidators are wholesalers of air tickets. They usually partner with airlines to get negotiated rates for air tickets, and then resell the air tickets to travel agents or consumers.

+

Many airlines consolidators act as host agencies for retail travel agencies or online travel agency startups that do not have the license from the International Air Transport Association (IATA) to issue air tickets. To issue air tickets via airline consolidators, the travel startups have to settle commercial agreements with the airline consolidators in the markets in which they want to operate.

+

It is to be noted that not all the airline consolidators provide post-ticketing services such as monitoring and notifying travel agencies about schedule changes and flight cancellations. This is something that startups have to check with their potential airline consolidators.

+

How are payments handled with my consolidator?

+

Different airline consolidators handle payments in different ways. In some cases, you will be asked to make an initial deposit to cover future ticketing charges. In other cases, you will be billed monthly for the services consumed. Please contact our support team or refer to your airline consolidator contract for more details.

+

How do I handle cancellations, changes and post-booking services for bookings made with Flight Create Orders in Self-Service?

+

For Self-Service users, all post-booking services must be handled offline with the consolidator you work with for ticket issuance. In general, these actions can be made while the Passenger Name Record (PNR) is queued for ticketing (before the ticket is issued), though their availability once a ticket has issued depends largely on the consolidator and the clauses of your agreement.

+

How can I get a consolidator?

+

Before requesting a consolidator, please first make sure that you are in one of the approved markets for Flight Create Orders. You need it to implement flight booking in Self-Service. Once this is verified, please go to the Support section and get in touch with us using the Contact form.

+

How do I handle refunds for flights booked with Flight Create Orders in Self-Service?

+

Refunds must be handled offline directly with your consolidator.

+

Can I use multiple consolidators?

+

Yes you can use different consolidator, but you will need to tell us so we can connect both your accounts. Once we open the access, you can decide where you want your booking to go using the ‘’queuingOfficeId’’ parameter in the Flight Create Orders request.

+

Destination Experiences

+

Do you provide tours and activities at destination?

+

You can search and book activities with our Tours and Activities API. It includes 300,000 activities around the world, such as sightseeing tours, days trips, and museum tickets. The API provides a list of top activities for a given location, including the prices, ratings, descriptions, photos, as well as a deep link to complete the booking with the provider.

+

What are the tags returned in Points of Interest?

+

The Points of Interest API returns the following tags:

+

food, schools, beauty&spas, commercialplace, outdoorplace, tourguide, health&hospital, health&medicalcenter, trail, health&medical, professionalservices, busline, honeymoonpackages, bakery, rental, newspaper, garden, generic, gift, vineyard, cityhall, sport, beauty&hairsalon, beauty&nailsalon, pet, market, machines, icecream, secondhand, communitycenter, toy, kids, health&seniorcenter, daycare, education, rugby, smoke, cemetery, harbor, laundromat, optical, cheese, financialservices, bank, field, college, car, florists, pharmacy, games, atm, building, university, mobilephone, center, donuts, beauty&barbershop, road, chocolate, tattoo, militarybase, surfing, lighthouse, cottage, square, cricket, patio, fusion, health&alternative, printing, basketball, pier, bay, wildlifesanctuary, airlines, lottery, fairground, health&nursinghome, art, tunnel, ski, gunroom, gunrange, camping, meat, antique, discount, prison, servicestation, thriftshop, gayfriendly, skate, creperie, electronic, petrolshelf, street, culturalcenter, volleyball, merchandise, popcorn, reservoir, sleepwear, beauty&professionals, firewall, drinkingwater, publicplace, quarries, health&services, prosthetics, industrialestate, american, mexican, internet, ignore, military, natural, canadian, technology, indian, tea, salon, beer, coffee, spanish, arts, communications, irish, french, river, neighbourhoodsandvillages, celebrities, office, social, japanese, institute, peruvian, british, continental, wine, brazilian, chinese, asian, italian, beauty, hair, religious, mediterranean, generic, african, portuguese, greek, farm, deli, german, european, ocean, english, religiousorganization, basque, latin, family, russian, austrian, southern, accessories, vegetarian, middleeastern, vietnamese, chicken, caribbean, lebanese, cosmetics, cuban, telecommunication, vegan, drink, design, moroccan, texmex, turkish, hawaiian, security, dining, contemporary, cajun, australian, korean, persian, pakistani, eating, painting, pet, bed&breakfast, bar, cooking, latte, ignore, chinese, nature, noodles, game, dating, automotive, car, electrician, funeral, travel, wedding, firestation, tvandradio, environmental, farm, agriculture, company, realestate, eyedoctor, campground, hostel, hotel, inn, lodging, motel, resort, corporatehousing, hiking, golf, events, sports, theater, gym, neighborhood, locality, city, island, region, home, office, dealership, storage, butcher, courthouse, radiostation, conferenceroom, insurance, dentist, photographer, animalshelter, coach, chiropractor, gardener, music, architect, nutritionist, apartments, vacationrental, yoga, tennis, nightlife, bodega, burrito, dance, skating, activelife, basketball, beach, baseball, state, shoppingdistrict, home, pet, veterinarian, mediaproduction, wholesale, factory, plumber, legal, government, fooddelivery, health, doctor, physicaltherapist, mobilehomes, police, conventioncenter, auctionhouse, religiousplace, coworkingspace, recycling, armedforces, marketing, publicservice, stadium, skydiving, sportclub, cine, zoo, massage, cricket, country, lawyer, design, childcare, carpenter, startup, financial, building, painter, retailer, graphicdesign, optometrists, transport, postoffice, itservices, spiritualcenter, distributor, embassy, recruiter, counseling, mover, tailor, festival, huntingandfishing, horseriding, lasertag, paintball, submarinism, rafting, surfing, climbing, summercamp, skate, gamingcafe, province, castle, operahouse, seamstress, hockey, mining, manufacturers, repair, accountant, chamberofcommerce, restorer, lab, publisher, pharmaceutical, psychologist, entertainer, energy, laborunions, traditional, pilates, stargazing, martialarts, rodeo, circus, karting, cheerleading, leisure, classiccuisine, traditionalcuisine, eco, floatels, accommodation, brewery, club, musicvenue, nightclub, pub, restaurant, barbecue, breakfast, buffet, burger, cheap, coffee, fastfood, foodtruck, gastropub, grills, hotdogs, internetcoffe, noodle, pizza, ramen, sandwich, seafood, activities, aquarium, attraction, banquethalls, bike, bowlingalley, casino, snack, steakhouse, sushi, taco, tapas, tea, thai, vegetarian, shopping, baby, bags, boutique, clothing, fashion, home, jewelry, library, liquor, mall, musicstore, outlet, perfume, personalcare, shoe, watches, supermarket, bridge, forest, garden, marina, marine, picnic, restarea, river, beach, capitol, church, lake, mosque, mountain, river, statuary, synagogue, temple, sightseeing, artgallerie, landmark, museum, sights, bridge, capitol, church, historicplace, marina, mosque, palace, synagogue, temple, buddhist, transport, airport, bus, busstation, busstop, gasstation, heliport, metro, metrostation, parking, port, taxi, train, trainstation, tram, boating, boating, park, italiancuisine, juicebar, bathingarea, fountain, statue, volcano, chargingstation, bistro, brasserie, churrasco, foodstand, mediterraneancuisine, moderncuisine, regionalcuisine, snackbar, spanishcuisine, swissfood, souvenir, amusementpark, boat, historic, japanese, guesthouse, camping, archery, bingohall, birdwatching, luxurybybrand, luxuryname, luxury.

+

Cars & Transfers

+

Who are the providers available in the Car & Transfers APIs?

+

The Transfers APIs will allow you to offer private transfers, hourly services, taxis, shared transfers, airport express, airport buses, private jets, and helicopter transfer. The API uses the following providers:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameCode
DrivaniaDRV
Eco Rent A CarECO
EZ Shuttle ZAESZ
FlygTaxiFGT
Get-EGET
GroundScopeGSE
GroundSpanGSN
HolidayTaxisHTX
iVcardoIVC
JPD TransportJPD
ServantripSVP
Sixt RideSMD
SuperShuttleSPS
Svea Taxi AlliansTXB
TalixoTXO
TaxibokningTXB
TaxiTenderTXT
World TransferWTR
+

Technical support

+

What kind of support does Amadeus for Developers offer?

+

There are two different support paths available based on our two different offer: Self-Service and Enterprise.

+
    +
  1. Self-Service users have at their disposal detailed documentation, guides and SDKs, to help them solve any doubts they may have. Check the Self-Service Docs page for more information. For any other Self-Service support queries, such as billing issues or a refund request, please go to the support section and click on contact us about Self-Service support.
  2. +
+
+

Important

+

Contact Support
+You need to be registered and signed in to reach out to the Self-Service support.

+
+
    +
  1. Enterprise users have access to dedicated support. If you are an Enterprise user, get in touch with your Account Manager or open a ticket via the Amadeus Service Hub.
  2. +
+

Where do I go for Self-Service technical support? What does it cost?

+

If you are a Self-Service customer experiencing a technical issue, you should do the following:

+
    +
  1. First, look for an answer in our Self-Service APIs Docs and this FAQs page. We update this page regularly with explanations on fixing common issues.
  2. +
  3. Search for a solution in Stack Overflow, or ask the community for help. Our developer advocacy team actively monitors and answers the questions on Stack Overflow that relate to our APIs.
  4. +
  5. Finally, if you are still experiencing a problem with Self-Service APIs, you can get in touch with our developer advocates via the contact form in the Support page. We will try to get back to you as quickly as possible, however please understand that in times of high demand we may not be able to guarantee a prompt answer.
  6. +
+

Do you offer phone support for Self-Service APIs?

+

We do not currently offer phone support for Self-Service APIs. If you need assistance you can get in touch with our Developer Advocates via the contact form in the Support page. Please keep in mind that in times of high demand we may not be able to guarantee a prompt answer.

+

How can I report bugs or suggest improvements to the Self-Service section?

+

We love feedback from our community and it helps us create the best possible product for all users! If you want to report a bug or suggest improvements, please go to the Support section and get in touch using the Contact form.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/Amadeus.eot b/fonts/Amadeus.eot new file mode 100644 index 00000000..8cbac795 Binary files /dev/null and b/fonts/Amadeus.eot differ diff --git a/fonts/Amadeus.svg b/fonts/Amadeus.svg new file mode 100644 index 00000000..59dc063c --- /dev/null +++ b/fonts/Amadeus.svg @@ -0,0 +1,6297 @@ + + + + +Created by FontForge 20170731 at Tue Jun 25 10:23:48 2013 + By Aleksey,,, +Copyright (c) 2005 Parachute, www.parachute.gr. All rights reserved. Modification of this file is not permitted without written permission from Parachute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fonts/Amadeus.ttf b/fonts/Amadeus.ttf new file mode 100644 index 00000000..887bdcdc Binary files /dev/null and b/fonts/Amadeus.ttf differ diff --git a/fonts/Amadeus.woff b/fonts/Amadeus.woff new file mode 100644 index 00000000..6049ced3 Binary files /dev/null and b/fonts/Amadeus.woff differ diff --git a/fonts/Amadeus.woff2 b/fonts/Amadeus.woff2 new file mode 100644 index 00000000..0d328f46 Binary files /dev/null and b/fonts/Amadeus.woff2 differ diff --git a/fonts/AmadeusNeue-Bold.otf b/fonts/AmadeusNeue-Bold.otf new file mode 100644 index 00000000..4df0e93a Binary files /dev/null and b/fonts/AmadeusNeue-Bold.otf differ diff --git a/fonts/AmadeusNeue-Bold.ttf b/fonts/AmadeusNeue-Bold.ttf new file mode 100644 index 00000000..2335dcf1 Binary files /dev/null and b/fonts/AmadeusNeue-Bold.ttf differ diff --git a/fonts/AmadeusNeue-Bold.woff b/fonts/AmadeusNeue-Bold.woff new file mode 100644 index 00000000..810abf74 Binary files /dev/null and b/fonts/AmadeusNeue-Bold.woff differ diff --git a/fonts/AmadeusNeue-Bold.woff2 b/fonts/AmadeusNeue-Bold.woff2 new file mode 100644 index 00000000..525063c5 Binary files /dev/null and b/fonts/AmadeusNeue-Bold.woff2 differ diff --git a/fonts/AmadeusNeue-Light.otf b/fonts/AmadeusNeue-Light.otf new file mode 100644 index 00000000..1004c664 Binary files /dev/null and b/fonts/AmadeusNeue-Light.otf differ diff --git a/fonts/AmadeusNeue-Light.ttf b/fonts/AmadeusNeue-Light.ttf new file mode 100644 index 00000000..521f14c7 Binary files /dev/null and b/fonts/AmadeusNeue-Light.ttf differ diff --git a/fonts/AmadeusNeue-Light.woff b/fonts/AmadeusNeue-Light.woff new file mode 100644 index 00000000..815d16ce Binary files /dev/null and b/fonts/AmadeusNeue-Light.woff differ diff --git a/fonts/AmadeusNeue-Light.woff2 b/fonts/AmadeusNeue-Light.woff2 new file mode 100644 index 00000000..448e7e91 Binary files /dev/null and b/fonts/AmadeusNeue-Light.woff2 differ diff --git a/fonts/AmadeusNeue-Regular.otf b/fonts/AmadeusNeue-Regular.otf new file mode 100644 index 00000000..2301a1e3 Binary files /dev/null and b/fonts/AmadeusNeue-Regular.otf differ diff --git a/fonts/AmadeusNeue-Regular.ttf b/fonts/AmadeusNeue-Regular.ttf new file mode 100644 index 00000000..26701d4a Binary files /dev/null and b/fonts/AmadeusNeue-Regular.ttf differ diff --git a/fonts/AmadeusNeue-Regular.woff b/fonts/AmadeusNeue-Regular.woff new file mode 100644 index 00000000..89dc6728 Binary files /dev/null and b/fonts/AmadeusNeue-Regular.woff differ diff --git a/fonts/AmadeusNeue-Regular.woff2 b/fonts/AmadeusNeue-Regular.woff2 new file mode 100644 index 00000000..69da596a Binary files /dev/null and b/fonts/AmadeusNeue-Regular.woff2 differ diff --git a/glossary/index.html b/glossary/index.html new file mode 100644 index 00000000..6bffca93 --- /dev/null +++ b/glossary/index.html @@ -0,0 +1,1907 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Glossary - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Key concepts

+

This page provides help with the most common terminology used across Amadeus Self-service APIs.

+

Air and Trip

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TermDefinition
Additional BaggageLuggage beyond the standard allowance provided by an airline, subject to additional fees.
Aircraft CodeIATA aircraft code .
Airline CodeAirline code following IATA or ICAO standard - e.g. 1X; AF or ESY.
Airline consolidatorsWholesalers of air tickets that usually partner with airlines to get negotiated rates for air tickets, and then resell the air tickets to travel agents or consumers.
Amadeus Office IDAn identification number assigned to travel agencies to access Amadeus system and book reservations.
AmenitiesAdditional services or features offered to enhance the experience of the passengers, such as food, entertainment, Wi-Fi, extra legroom, baggage allowance, frequent flyer programs, and lounge access. They can vary depending on the class of service and the airline/train company.
Baggage allowanceThe amount of luggage that a passenger is allowed to carry on a flight without additional charges.
BookingThe process of reserving a seat on a flight or a room in a hotel.
CabinThe section of an aircraft or train where passengers sit during their trip. It is divided into different classes, such as first class, business class, and economy class, each one with different amenities and prices.
CommissionFee paid to intermediaries for booking travel-related services, usually a percentage of the total cost.
Carrier Code2 to 3-character IATA carrier code (IATA table codes).
Country CodeCountry code following ISO 3166 Alpha-2 standard.
Direct flightA flight that goes from one destination to another without any stops in between.
FareThe price of a ticket for a particular flight or travel itinerary.
Fare RulesThe terms and conditions that apply to a specific airline ticket or fare, including restrictions and information on refunds, cancellations, changes, baggage, seat assignments, upgrades, and frequent flyer programs.
Flight Order IdUnique identifier returned by the Flight Create Orders API .
GDS (Global Distribution System)A computerized system used by travel agents and airlines to search for and book flights, hotels, rental cars, and other travel-related services
IATAInternational Air Transport Association
IATA CodeCode used by IATA to identify locations, airlines and aircraft. For example, the Airport & City Search API returns IATA codes for cities as the iataCode parameter.
ICAOInternational Civil Aviation Organization
ISO8601 date formatPnYnMnDTnHnMnS format, e.g. PT2H10M.
LayoverA stopover in a destination en route to the final destination.
Location IdAmadeus-defined identifier that you can see in the search results when querying Self-Service APIs that retrieve information on geographical locations.
Multi-stop flightA flight itinerary that includes stops at multiple destinations before reaching the final destination.
Non-stop flightA flight that goes from one destination to another without any stops in between.
PricingThe process of determining the cost of a product or service, in the context of travel it refers to the cost of airline tickets, hotel rooms, rental cars.
PNR (Passenger Name Record)A record in a computer reservation system that contains the details of a passenger's itinerary and contact information.
Round-tripA trip that includes travel to a destination and then back to the original departure point.
SeatmapA map or diagram of the seating layout in the cabin of an aircraft or train. It shows the location of different types of seats, such as exit row, bulkhead seat, aisle seat, window seat. It can be used to choose a seat or to see the availability of seats for a certain flight.
TicketingThe process of issuing a travel document, typically a paper or electronic ticket, that confirms that a passenger has purchased a seat on a flight, train, bus, or other form of transportation. It can be refundable or non-refundable, one-way or round-trip, and open-jaw.
Travel ClassesDifferentiation of service level and amenities offered to passengers on an aircraft or train, like first class, business class, economy class.
+

Hotel

+ + + + + + + + + + + + + +
TermDefinition
Hotel IdsAmadeus Property Codes (8 chars). Comma-separated list of Amadeus Hotel Ids (max. 3). Amadeus Hotel Ids are found in the Hotel Search response (parameter name is hotelId).
+

Destination content

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TermDefinition
AvuxiAmadeus' data provider on locations popularity.
Activity IdTours and Activities API returns a unique activity Id along with the activity name, short description, geolocation, customer rating, image, price and deep link to the provider page to complete the booking.
GeoSureAmadeus's provider od data on locations crime rate, health and economic data, official travel alerts, local reporting and a variety of other sources.
GeoSure GeoSafeScoresAlgorithm that analyzes crime, health and economic data, official travel alerts, local reporting and a variety of other sources.
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/icons/amadeus4dev.svg b/icons/amadeus4dev.svg new file mode 100644 index 00000000..4aef5f64 --- /dev/null +++ b/icons/amadeus4dev.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/api-keys/moving-to-production/api_request.png b/images/api-keys/moving-to-production/api_request.png new file mode 100644 index 00000000..1a667974 Binary files /dev/null and b/images/api-keys/moving-to-production/api_request.png differ diff --git a/images/api-keys/moving-to-production/api_request_list.png b/images/api-keys/moving-to-production/api_request_list.png new file mode 100644 index 00000000..e45f8292 Binary files /dev/null and b/images/api-keys/moving-to-production/api_request_list.png differ diff --git a/images/api-keys/moving-to-production/app_live.png b/images/api-keys/moving-to-production/app_live.png new file mode 100644 index 00000000..310b2014 Binary files /dev/null and b/images/api-keys/moving-to-production/app_live.png differ diff --git a/images/api-keys/moving-to-production/app_pending.png b/images/api-keys/moving-to-production/app_pending.png new file mode 100644 index 00000000..108d6155 Binary files /dev/null and b/images/api-keys/moving-to-production/app_pending.png differ diff --git a/images/api-keys/moving-to-production/request_production_key.png b/images/api-keys/moving-to-production/request_production_key.png new file mode 100644 index 00000000..b620ae0e Binary files /dev/null and b/images/api-keys/moving-to-production/request_production_key.png differ diff --git a/images/developer-tools/mock-server/mock-server-1.png b/images/developer-tools/mock-server/mock-server-1.png new file mode 100644 index 00000000..8fb82c2f Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-1.png differ diff --git a/images/developer-tools/mock-server/mock-server-2.png b/images/developer-tools/mock-server/mock-server-2.png new file mode 100644 index 00000000..a30dccf5 Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-2.png differ diff --git a/images/developer-tools/mock-server/mock-server-3.png b/images/developer-tools/mock-server/mock-server-3.png new file mode 100644 index 00000000..5c23e35c Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-3.png differ diff --git a/images/developer-tools/mock-server/mock-server-4.png b/images/developer-tools/mock-server/mock-server-4.png new file mode 100644 index 00000000..47cb5efa Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-4.png differ diff --git a/images/developer-tools/mock-server/mock-server-5.png b/images/developer-tools/mock-server/mock-server-5.png new file mode 100644 index 00000000..725989d2 Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-5.png differ diff --git a/images/developer-tools/mock-server/mock-server-6.png b/images/developer-tools/mock-server/mock-server-6.png new file mode 100644 index 00000000..59087610 Binary files /dev/null and b/images/developer-tools/mock-server/mock-server-6.png differ diff --git a/images/developer-tools/postman/postman-1.png b/images/developer-tools/postman/postman-1.png new file mode 100644 index 00000000..567e5b32 Binary files /dev/null and b/images/developer-tools/postman/postman-1.png differ diff --git a/images/developer-tools/postman/postman-10.png b/images/developer-tools/postman/postman-10.png new file mode 100644 index 00000000..7446d1b1 Binary files /dev/null and b/images/developer-tools/postman/postman-10.png differ diff --git a/images/developer-tools/postman/postman-11.png b/images/developer-tools/postman/postman-11.png new file mode 100644 index 00000000..385b20b5 Binary files /dev/null and b/images/developer-tools/postman/postman-11.png differ diff --git a/images/developer-tools/postman/postman-12.png b/images/developer-tools/postman/postman-12.png new file mode 100644 index 00000000..613823eb Binary files /dev/null and b/images/developer-tools/postman/postman-12.png differ diff --git a/images/developer-tools/postman/postman-2.png b/images/developer-tools/postman/postman-2.png new file mode 100644 index 00000000..a1eabb0d Binary files /dev/null and b/images/developer-tools/postman/postman-2.png differ diff --git a/images/developer-tools/postman/postman-3.png b/images/developer-tools/postman/postman-3.png new file mode 100644 index 00000000..50859bf4 Binary files /dev/null and b/images/developer-tools/postman/postman-3.png differ diff --git a/images/developer-tools/postman/postman-4.png b/images/developer-tools/postman/postman-4.png new file mode 100644 index 00000000..4cb675a5 Binary files /dev/null and b/images/developer-tools/postman/postman-4.png differ diff --git a/images/developer-tools/postman/postman-5.png b/images/developer-tools/postman/postman-5.png new file mode 100644 index 00000000..33be6f55 Binary files /dev/null and b/images/developer-tools/postman/postman-5.png differ diff --git a/images/developer-tools/postman/postman-6.png b/images/developer-tools/postman/postman-6.png new file mode 100644 index 00000000..4f3373c2 Binary files /dev/null and b/images/developer-tools/postman/postman-6.png differ diff --git a/images/developer-tools/postman/postman-7.png b/images/developer-tools/postman/postman-7.png new file mode 100644 index 00000000..fd8058f4 Binary files /dev/null and b/images/developer-tools/postman/postman-7.png differ diff --git a/images/developer-tools/postman/postman-8.png b/images/developer-tools/postman/postman-8.png new file mode 100644 index 00000000..ca3260ac Binary files /dev/null and b/images/developer-tools/postman/postman-8.png differ diff --git a/images/developer-tools/postman/postman-9.png b/images/developer-tools/postman/postman-9.png new file mode 100644 index 00000000..09efe6fb Binary files /dev/null and b/images/developer-tools/postman/postman-9.png differ diff --git a/images/examples/prototypes/AmadeusNodeServer, AmadeusHotelBookingPart1.png b/images/examples/prototypes/AmadeusNodeServer, AmadeusHotelBookingPart1.png new file mode 100644 index 00000000..b310d5a7 Binary files /dev/null and b/images/examples/prototypes/AmadeusNodeServer, AmadeusHotelBookingPart1.png differ diff --git a/images/examples/prototypes/Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API.png b/images/examples/prototypes/Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API.png new file mode 100644 index 00000000..caae2262 Binary files /dev/null and b/images/examples/prototypes/Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API.png differ diff --git a/images/examples/prototypes/Building-a-Hotel-Booking-App-in-NodeJS-and-React.jpg b/images/examples/prototypes/Building-a-Hotel-Booking-App-in-NodeJS-and-React.jpg new file mode 100644 index 00000000..fff70791 Binary files /dev/null and b/images/examples/prototypes/Building-a-Hotel-Booking-App-in-NodeJS-and-React.jpg differ diff --git a/images/examples/prototypes/Flight-booking-frontend and backend.png b/images/examples/prototypes/Flight-booking-frontend and backend.png new file mode 100644 index 00000000..a9f1c4ba Binary files /dev/null and b/images/examples/prototypes/Flight-booking-frontend and backend.png differ diff --git a/images/examples/prototypes/MyPlaces.gif b/images/examples/prototypes/MyPlaces.gif new file mode 100644 index 00000000..c1956242 Binary files /dev/null and b/images/examples/prototypes/MyPlaces.gif differ diff --git a/images/examples/prototypes/amadeus-async-flight-status.png b/images/examples/prototypes/amadeus-async-flight-status.png new file mode 100644 index 00000000..c76a267a Binary files /dev/null and b/images/examples/prototypes/amadeus-async-flight-status.png differ diff --git a/images/examples/prototypes/amadeus-async-flight-status2.jpg b/images/examples/prototypes/amadeus-async-flight-status2.jpg new file mode 100644 index 00000000..f0436d69 Binary files /dev/null and b/images/examples/prototypes/amadeus-async-flight-status2.jpg differ diff --git a/images/examples/prototypes/amadeus-flight-booking-django-2.png b/images/examples/prototypes/amadeus-flight-booking-django-2.png new file mode 100644 index 00000000..59d4fec0 Binary files /dev/null and b/images/examples/prototypes/amadeus-flight-booking-django-2.png differ diff --git a/images/examples/prototypes/amadeus-flight-booking-django.png b/images/examples/prototypes/amadeus-flight-booking-django.png new file mode 100644 index 00000000..850b500a Binary files /dev/null and b/images/examples/prototypes/amadeus-flight-booking-django.png differ diff --git a/images/examples/prototypes/amadeus-flight-price-analysis-django.png b/images/examples/prototypes/amadeus-flight-price-analysis-django.png new file mode 100644 index 00000000..d637bd97 Binary files /dev/null and b/images/examples/prototypes/amadeus-flight-price-analysis-django.png differ diff --git a/images/examples/prototypes/amadeus-flight-search-wordpress-plugin.png b/images/examples/prototypes/amadeus-flight-search-wordpress-plugin.png new file mode 100644 index 00000000..4e86b84d Binary files /dev/null and b/images/examples/prototypes/amadeus-flight-search-wordpress-plugin.png differ diff --git a/images/examples/prototypes/amadeus-hotel-area-safety-pois-django.png b/images/examples/prototypes/amadeus-hotel-area-safety-pois-django.png new file mode 100644 index 00000000..13c26385 Binary files /dev/null and b/images/examples/prototypes/amadeus-hotel-area-safety-pois-django.png differ diff --git a/images/examples/prototypes/amadeus-hotel-booking-android.png b/images/examples/prototypes/amadeus-hotel-booking-android.png new file mode 100644 index 00000000..e18f5e9c Binary files /dev/null and b/images/examples/prototypes/amadeus-hotel-booking-android.png differ diff --git a/images/examples/prototypes/amadeus-hotel-booking-django.png b/images/examples/prototypes/amadeus-hotel-booking-django.png new file mode 100644 index 00000000..a6ce25a4 Binary files /dev/null and b/images/examples/prototypes/amadeus-hotel-booking-django.png differ diff --git a/images/examples/prototypes/amadeus-hotel-search-swift.png b/images/examples/prototypes/amadeus-hotel-search-swift.png new file mode 100644 index 00000000..f5dc8564 Binary files /dev/null and b/images/examples/prototypes/amadeus-hotel-search-swift.png differ diff --git a/images/examples/prototypes/amadeus-safeplace.png b/images/examples/prototypes/amadeus-safeplace.png new file mode 100644 index 00000000..b06c4e11 Binary files /dev/null and b/images/examples/prototypes/amadeus-safeplace.png differ diff --git a/images/examples/prototypes/amadeus-seatmap.png b/images/examples/prototypes/amadeus-seatmap.png new file mode 100644 index 00000000..65ba0547 Binary files /dev/null and b/images/examples/prototypes/amadeus-seatmap.png differ diff --git a/images/examples/prototypes/amadeus-smart-flight-search-django.png b/images/examples/prototypes/amadeus-smart-flight-search-django.png new file mode 100644 index 00000000..99c91add Binary files /dev/null and b/images/examples/prototypes/amadeus-smart-flight-search-django.png differ diff --git a/images/examples/prototypes/amadeus-travel-restrictions-node.png b/images/examples/prototypes/amadeus-travel-restrictions-node.png new file mode 100644 index 00000000..e3068499 Binary files /dev/null and b/images/examples/prototypes/amadeus-travel-restrictions-node.png differ diff --git a/images/examples/prototypes/amadeus-trip-purpose-django.png b/images/examples/prototypes/amadeus-trip-purpose-django.png new file mode 100644 index 00000000..a77b4ed2 Binary files /dev/null and b/images/examples/prototypes/amadeus-trip-purpose-django.png differ diff --git a/images/examples/prototypes/api_validation.png b/images/examples/prototypes/api_validation.png new file mode 100644 index 00000000..9a4864b0 Binary files /dev/null and b/images/examples/prototypes/api_validation.png differ diff --git a/images/examples/prototypes/email_confirmation.png b/images/examples/prototypes/email_confirmation.png new file mode 100644 index 00000000..1290b2a4 Binary files /dev/null and b/images/examples/prototypes/email_confirmation.png differ diff --git a/images/examples/prototypes/hotel-search.png b/images/examples/prototypes/hotel-search.png new file mode 100644 index 00000000..14dfa838 Binary files /dev/null and b/images/examples/prototypes/hotel-search.png differ diff --git a/images/examples/prototypes/live_airport_city_search.gif b/images/examples/prototypes/live_airport_city_search.gif new file mode 100644 index 00000000..0c5a44e0 Binary files /dev/null and b/images/examples/prototypes/live_airport_city_search.gif differ diff --git a/images/main.gif b/images/main.gif new file mode 100644 index 00000000..dcf68599 Binary files /dev/null and b/images/main.gif differ diff --git a/images/quick-start/api_key1.png b/images/quick-start/api_key1.png new file mode 100644 index 00000000..1b82bafe Binary files /dev/null and b/images/quick-start/api_key1.png differ diff --git a/images/quick-start/api_key2.png b/images/quick-start/api_key2.png new file mode 100644 index 00000000..b1bfdc73 Binary files /dev/null and b/images/quick-start/api_key2.png differ diff --git a/images/quick-start/api_key3.png b/images/quick-start/api_key3.png new file mode 100644 index 00000000..896215c0 Binary files /dev/null and b/images/quick-start/api_key3.png differ diff --git a/images/resources/cars-transfers/TransfersAPI.png b/images/resources/cars-transfers/TransfersAPI.png new file mode 100644 index 00000000..05087551 Binary files /dev/null and b/images/resources/cars-transfers/TransfersAPI.png differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..cc5d28cd --- /dev/null +++ b/index.html @@ -0,0 +1,1739 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Amadeus for Developers docs

+

Welcome to the Amadeus for Developers docs portal!

+

Our main focus here is on the Self-Service APIs. If you need any information on the Enterprise APIs, please reach out to our customer support team and we'll be happy to assist you further.

+

What are the Self-Service APIs?

+

Target independent developers and start-ups that wish to connect to Amadeus APIs in a quick and easy manner. You can access and start to test these new REST/JSON APIs in less than 3 minutes, and get quick access to production data with a flexible pay-as-you-go pricing model. Please note that the catalog includes some selected APIs, although we will be constantly releasing new APIs. Currently, you can find APIs around flights, hotels, destination content, and travel safety.

+

Self-Service users have at their disposal detailed documentation, guides, and SDKs to be able to integrate the APIs in their apps.

+

What are the Enterprise APIs?

+

Provide access to the full Amadeus APIs catalog, tailored to companies with scale needs and leading brands in the travel industry. Customers of Enterprise APIs receive dedicated support from their account managers and enjoy a customized pricing scheme to meet their needs. Please note that access to Enterprise APIs is only granted on a request basis, and some special requirements may apply.

+
+

Warning

+

You can potentially use APIs from both catalogs, but please keep in mind that the requirements and conditions of each offer are very different!

+
+

Discover the Amadeus Self-Service APIs

+

Amadeus for Developers provides a set of Self-Service APIs, which were implemented using the API-first approach. We produce an API specification in the OpenAPI format before any implementation.

+
+

Information

+

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic.

+
+
    +
  • To see all Amadeus Self-Service APIs in one place, check out our API catalogue.
  • +
  • Don’t forget to stop by our GitHub workspace where you can find tons of samples and prototypes to get inspiration, as well as the latest versions of the SDKs in multiple programming languages.
  • +
  • If you are a happy Postman user, as we are, feel free to use the Amadeus for Developers Postman collection.
  • +
+
+

Important

+

Something not clear? Typos? We would be happy to receive your pull requests and feedback to this documentation guides. Feel free to contribute!

+
+

Happy coding!

+

The Amadeus for Developers Team

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/migration-guides/hotel-search/index.html b/migration-guides/hotel-search/index.html new file mode 100644 index 00000000..59ad5946 --- /dev/null +++ b/migration-guides/hotel-search/index.html @@ -0,0 +1,2234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Hotel search - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Hotel search

+ +

Are you still using the old version of the Hotel Search API? This guide will help you migrate to the new version of the Hotel Search API and leverage its advantages right from the start.

+

How is the Hotel Search API v3 different to v2.1?

+

The main difference between the two API versions is that the v2.1 endpoint /shopping/hotel-offers/by-hotel has been integrated into the v3 /shopping/hotel-offers/ endpoint. All hotel offers in the Hotel Search v3 are now queried by hotel’s unique Amadeus Id, which renders the v2.1 endpoint /shopping/hotel-offers/by-hotel obsolete.

+

We also have a new API to help you ensure a seamless migration – the Hotel List API. This API returns a list of hotels by a unique Amadeus hotel Id, IATA city code or geographic coordinates.

+

The diagram below shows a high-level overview of the differences between the Hotel Search API v2.1 and v3.

+

overview

+

Now let’s have a closer look at the differences on the parameters level.

+

GET /shopping/hotel-offers

+

New required query parameters

+ + + + + + + + + + + + + + + + + +
ParameterDescription
hotelIdsAmadeus property codes on 8 chars. This parameter was an optional query parameter in v2.1.
adultsNumber of adult guests (1-9) per room. This parameter was an optional query parameter in v2.1.
+

Removed query parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
cityCodeDestination IATA city code. This parameter is still returned in the successful response for each hotel. To search a hotel by the IATA city code, use the Hotel List API.
latitudeLatitude of a geographical point used for the search. This parameter is returned in the successful response for each hotel as the latitude of the given hotel. To search a hotel by geographic coordinates, use the Hotel List API.
longitudeLongitude of a geographical point used for the search. This parameter is returned in the successful response for each hotel as the longitude of the given hotel. To search a hotel by geographic coordinates, use the Hotel List API.
radiusMaximum distance (in radiusUnit) from Destination (city centre or geocodes). This parameter is not present in the response.
radiusUnitDistance unit (of the radius value). This parameter is not present in the response.
hotelNameHotel name used for the search. This parameter is returned in the successful response for each hotel.
chainsChain (EM...) or Brand (SB...) or Merchant (AD...) (comma separated list of Amadeus 2 chars codes). This parameter is now shown as chainCode and returned in the successful response for each hotel.
amenitiesAmenities list per hotel. To use this parameter for hotel search, refer to the Hotel List API.
ratingsHotel stars. To use this parameter for hotel search, refer to the Hotel List API.
cacheControlParameter to force bypass the Amadeus cache (slower response) or get only hotels that are in the cache.
+

Added optional query parameters

+ + + + + + + + + + + + + +
ParameterDescription
countryOfResidenceCode of the traveller’s country of residence in the ISO 3166-1 format.
+

Data model changes

+
Hotel Offers
+
Removed parameters
+

• The hotel object does not contain the hotelDistance object as the search by radius has been omitted. +• The address, contact, amenities and media objects are excluded from the response. +• Metadata for the pagination is not in the response as the Hotel Search v3 does not use pagination.

+
Added parameters
+

• The offers object now contains the checkInDate and checkOutDate. +• New object commission has been added to the response. +• New object taxes has been added to the response.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
checkInDateCheck-in date.
checkOutDateCheck-out date.
commissionThis object defines the commission to be paid by the traveller to the hotel. It has three properties:
  • percentage – a string showing the percentage of the commission paid to the travel seller, the value is between 0 and 100.
  • amount – a string showing the amount of the commission paid to the travel seller, the amount is always linked to the currency code of the offer.
  • description – a string for the free text field for any notes on the commission.
taxesThis object shows the tax data as per the IATA tax definition: “An impost for raising revenue for the general treasury and which will be used for general public purposes”. It contains the following properties:
  • amount - a string, which defines the tax amount with a decimal separator.
  • currency- a string, which defines a monetary unit of the tax. It is a three-alpha code (IATA code). Example: EUR for Euros, USD for US dollar, etc.
  • code - a string for the International Standards Organization (ISO) Tax code. It is a two-letter country code.
  • percentage - a string, which will indicate, in the case of a tax on TST value, the percentage of the tax.
  • included - a boolean, which indicates if tax is included or not.
  • description - a string for the tax description.
  • pricingFrequency - a string, which specifies if the tax applies per stay or per night.
  • pricingMode - a string, which specifies if the tax applies per occupant or per room.
+

GET / shopping/hotel-offers/{offerId}

+

Data Model changes

+
Offers
+
Added parameters
+

• The checkInDate, checkOutDate, category, commission, boardType properties have been added. +• The price object has additional properties sellingTotal, base, taxes, markups, variations. +• New object policies has been added.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
checkInDateCheck-in date.
checkOutDateCheck-out date.
categoryOffer category.
commissionThis object defines the commission to be paid by the traveller to the hotel. It has three properties:
  • percentage – a string showing the percentage of the commission paid to the travel seller, the value is between 0 and 100.
  • amount – a string showing the amount of the commission paid to the travel seller, the amount is always linked to the currency code of the offer.
  • description – a string for the free text field for any notes on the commission.
sellingTotalA string defining the price Total + margins + markup + totalFees – discounts.
baseA string for the base price of the offer.
taxesThis object shows the tax data as per the IATA Tax definition: “An impost for raising revenue for the general treasury and which will be used for general public purposes”. It contains the following properties:
  • amount - a string, which defines the tax amount with a decimal separator.
  • currency- a string, which defines a monetary unit of the tax. It is a three-alpha code (IATA code). Example: EUR for Euros, USD for US dollar, etc.
  • code - a string for the International Standards Organization (ISO) Tax code. It is a two-letter country code.
  • percentage - a string, which will indicate, in the case of a tax on TST value, the percentage of the tax.
  • included - a boolean, which indicates if tax is included or not.
  • description - a string for the tax description.
  • pricingFrequency - a string, which specifies if the tax applies per stay or per night.
pricingModea string, which specifies if the tax applies per occupant or per room.
markupsAn object defining the markup. Markups are applied to provide a service or a product to the client. The markup can be introduced by any stakeholder. Typical use case is to convey markup information set by the travel agent or in case of merchant mode. The object contains a string amount, which defines the monetary value with a decimal position.
variationsAn object defining the hotel daily price variations. It has the following properties:
  • average – an object that encompasses the price object.
  • changes – an object defining the collection of price periods if the daily price changes during the stay.
policiesAn object defining the hotel booking rules.
+
Hotel
+
Removed parameters
+

The rating, latitude, longitude, amenities, media parameters have been removed.

+
Values returned by the response
+

The address, contact, amenities, media values have been removed.

+

Use case inspirations

+

You can easily integrate the new Hotel Search API in your hotel booking engine or combine it with other APIs in our Hotel category, such as the Hotel Ratings API or Hotel Name Autocomplete API. Whatever your use case might be, the Amadeus Self-Service APIs will help your business achieve the competitive advantage in the travel industry.

+

FAQ

+
    +
  • +

    How can I get the hotel image/address/contact details/rating/amenities?

    +
      +
    • Due to legal constraints we, unfortunately, can no longer distribute hotel images and specific details through our Self-Service APIs.
    • +
    • As a workaround we recommend using Leonardo, our trusted data provider.
    • +
    • Also, we have built some Python tutorials about how to get the hotel address using geocoding APIs and Google Place APIs and how to get the hotel images with Google Places API. You should be able to adapt them in your own programming language easily.
    • +
    +
  • +
  • +

    How can I use the data without the cache data control?

    +
      +
    • The Hotel Search API v3 is using live data directly while avoiding the need to build cache and add any extra validation mechanisms to the data.
    • +
    +
  • +
  • +

    How do I get the hotel rating?

    +
      +
    • We offer data on hotel rating via our Hotel Rating API. Please bear in mind that this rating information is based on the sentiment analysis and not the star rating system. You can, however, retrieve a list of hotels by their star rating using the Hotel List API with the required star rating as an additional query parameter.
    • +
    +
  • +
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/migration-guides/index.html b/migration-guides/index.html new file mode 100644 index 00000000..a983a06a --- /dev/null +++ b/migration-guides/index.html @@ -0,0 +1,1656 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Migration guides - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Migration guides

+

To ensure you have a seamless transition to the latest API version, we've compiled migration guides for your reference. As we continuously enhance our APIs and launch new releases, these guides will assist you in the upgrading process.

+ + + + + + + + + + + + + +
APIMigration guide
Hotel Search APIFrom v2.1 to v3
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/pagination/index.html b/pagination/index.html new file mode 100644 index 00000000..685fbcc4 --- /dev/null +++ b/pagination/index.html @@ -0,0 +1,1826 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pagination - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Pagination on Self-Service APIs

+

Amadeus for Developers Self-Service APIs can often return a lot of results. For example, when calling the Safe Place API, you may get a response hundreds of pages long. +That's where pagination comes in. Using pagination, you can split the results into different pages to make the responses easier to handle.

+

Not all Amadeus Self-Service APIs support pagination. The following APIs currently support pagination:

+ +

Accessing paginated results

+

Using SDKs

+

Amadeus for Developers SDKs make it simple to access paginated results. If the API endpoint supports pagination, you can get page results using the the .next, .previous, .last and +.first methods.

+

Example in Node:

+
1
+2
+3
+4
+5
+6
+7
+8
+9
amadeus.referenceData.locations.get({
+  keyword: 'LON',
+  subType: 'AIRPORT,CITY'
+}).then(function(response){
+  console.log(response.data); // first page
+  return amadeus.next(response);
+}).then(function(nextReponse){
+  console.log(nextReponse.data); // second page
+});
+
+

If a page is not available, the response will resolve to null.

+

The same approach is valid for other languages, such as Ruby:

+
1
+2
+3
+4
+5
response = amadeus.reference_data.locations.get(
+  keyword: 'LON',
+  subType: Amadeus::Location::ANY
+)
+amadeus.next(response) #=> returns a new response for the next page
+
+

In this case, the method will return nil if the page is not available.

+

Manually parsing the response

+

The response will contain the following JSON content:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
{
+  "meta": {
+     "count": 28,
+     "links": {
+        "self": "https://api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55",
+        "next": "https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55&page%5Boffset%5D=10",
+        "last": "https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55&page%5Boffset%5D=18"
+     }
+  },
+  "data": [
+     {
+       /* large amount of items */
+     }
+  ]
+}
+
+

You can access the next page of the results using the value of meta/links/next or +meta/links/last node within the JSON response.

+

Note that indexing elements between pages is done via the page[offset] query +parameter. For example, page[offset]=18. The next and last returned in the example above encode the special characters [] as %5B and %5D. This is called percent +encoding and is used to +encode special characters in the url parameter values.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/pricing/index.html b/pricing/index.html new file mode 100644 index 00000000..666b4c01 --- /dev/null +++ b/pricing/index.html @@ -0,0 +1,1653 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pricing - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Pricing options for Amadeus Travel APIs

+

Amadeus for Developers provides two environments: test and production.

+

The test environment is the default environment for all new applications with access to a subset of the real data. This is where you will enjoy free request quota each month to build and test your apps.

+

The production environment gives you access to the full real-time data. When you move to production, you maintain your monthly free request quota and pay only for the additional calls you make.

+

Check out the pricing page to find out more about the pricing options.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/quick-start/index.html b/quick-start/index.html new file mode 100644 index 00000000..128d5e96 --- /dev/null +++ b/quick-start/index.html @@ -0,0 +1,1927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Quick start - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Making your first API call

+

Step 1: Create an account

+

The first step to start using Amadeus Self-Service APIs is to register and create an account:

+
    +
  • Open the Amadeus Developers Portal.
  • +
  • Click on Register.
  • +
  • Complete the form using a valid email address and click on the Create account button. An automatic confirmation email will be sent to the email address you provided.
  • +
  • In the confirmation email you receive, click on Activate your account.
  • +
+

You can now log in to the portal with your new credentials! Welcome to Amadeus for Developers!

+

Step 2: Get your API key

+

To start using the APIs, you need to tell the system that you are allowed to do so. This process is called authorization.

+
+

Danger

+

Remember that the API Key and API Secret are for personal use only. Do not share them with anyone.

+
+

All you need to do, is to attach an alphanumeric string called token to your calls. This token will identify you as a valid user. Each token is generated from two parameters: API Key and API Secret. Once your account has been verified, you can get your API key and API Secret by following these steps:

+ +
+

Important

+

Test environment
+At this stage, you are using the testing environment, where you will enjoy a fixed number of free API call quotas per month for all your applications. When you reach the limit, you will receive an error message. This environment will help you build and test your app for free and get ready for deploying it to the market.

+
+

Step 3: Calling the API

+

For our first call, let's get a list of possible destinations from Paris for a maximum amount of 200 EUR using the Flight Inspiration Search API, which returns a list of destinations from a given origin along with the cheapest price for each destination.

+

Creating the Request

+

Before making your first API call, you need to get your access token. For security purposes, we implemented the oauth2 process that will give you an access token based on your API Key and API Secret. To retrieve the token, you need to send a POST request to the endpoint /v1/security/oauth2/tokenwith the correct Content-Type header and body. Replace {client_id} with your API Key and {client_secret} with your API Secret in the command below and execute it:

+
1
+2
+3
curl "https://test.api.amadeus.com/v1/security/oauth2/token" \
+     -H "Content-Type: application/x-www-form-urlencoded" \
+     -d "grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}"
+
+
+

Warning

+

Please take a look at our Authorization guide to understand how the process works in depth.

+
+

According to the documentation, you need to use v1/shopping/flight-destinations as the endpoint, followed by the mandatory query parameter origin. As you want to filter the offers to those cheaper than 200 EUR, you need to add the maxPrice parameter to your query as well.

+

Our call is therefore:

+
1
+2
curl 'https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=PAR&maxPrice=200' \
+      -H 'Authorization: Bearer ABCDEFGH12345'
+
+

Note how we add the Authorization header to the request with the value Bearer string concatenated with the token previously requested.

+

Evaluating the Response

+

The response returns a JSON object containing a list of destinations matching our criteria:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
{
+    "data": [
+        {
+            "type": "flight-destination",
+            "origin": "PAR",
+            "destination": "CAS",
+            "departureDate": "2022-09-06",
+            "returnDate": "2022-09-11",
+            "price": {
+                "total": "161.90"
+            }
+        },
+        {
+            "type": "flight-destination",
+            "origin": "PAR",
+            "destination": "AYT",
+            "departureDate": "2022-10-16",
+            "returnDate": "2022-10-31",
+            "price": {
+                "total": "181.50"
+            }
+        }
+    ]
+}
+
+

Congratulations! You have just made your first Amadeus for Developers API call!

+

Video Tutorial

+

You can check the step by step process in this video tutorial of How to make your first API call from Get Started series.

+

+

Postman collection

+

To start testing our APIs without any additional configuration, have a look at our dedicated Postman collection.

+

Test and Production environment

+

After successfully developing your travel app with Amadeus APIs in the Test environment, you can now move to Production. Discover the differences between the Test and Production environments in Amadeus Self-Service APIs. Find out how to seamlessly switch to Production at no cost and, depending on your quota, gain access to real-time data, improved results, and quicker response times.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/cars-transfers/index.html b/resources/cars-transfers/index.html new file mode 100644 index 00000000..e43bb341 --- /dev/null +++ b/resources/cars-transfers/index.html @@ -0,0 +1,2648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cars and Transfers - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Cars and Transfers

+

The Amadeus Cars and Transfers APIs provide an extensive suite of capabilities designed to simplify the process of booking and managing transfers during a traveler's trip, delivering a seamless and efficient experience.

+

Cars and transfers API

+

Have a look at our dedicated Postman collection to easily test the Cars and Transfers API with pre-set requests.

+ + + + + + + + + + + + + + + + + + + + + +
APIsDescription
Transfer SearchThis API enables users to search for a transfer using a range of pre-arranged transportation options. These options include Private Transfers, Hourly Services, Taxis, Shared Transfers, Airport Express trains and buses, Private Jets, and Helicopter Transfers.
Transfer BookingOnce a transfer is chosen, the Transfer Booking API completes the reservation. It provides a unique booking ID and reservation details, which can be used to manage the reservation later.
Transfer ManagementThis API provides tools for managing transfer reservations. Using the booking ID provided by the Transfer Booking API, users can cancel reservations.
+

Search for a transfer

+

The search is carried out through a POST API call to /shopping​/transfer-offers. The API request includes parameters like the start and end locations, type of transfer, number of passengers, provider codes, and other optional parameters.

+

In the following example request, we have multiple parameters each with its own specific meaning and structure:

+
    +
  • +

    startLocationCode: "CDG" - This is an International Air Transport Association (IATA) airport code which represents Charles de Gaulle Airport in Paris, France. The starting location of the journey.

    +
  • +
  • +

    endAddressLine: "Avenue Anatole France, 5" - This is the exact address where the journey will end, presumably a location in Paris.

    +
  • +
  • +

    endCityName: "Paris" - The city where the journey ends.

    +
  • +
  • +

    endZipCode: "75007" - This represents the postal code of the end location.

    +
  • +
  • +

    endCountryCode: "FR" - It's a two-letter country code representing France.

    +
  • +
  • +

    endName: "Souvenirs De La Tour" - The name of the destination, perhaps a business or venue at the end location.

    +
  • +
  • +

    endGooglePlaceId: "ChIJL-DOWeBv5kcRfTbh97PimNc" - A unique identifier that Google assigns to a location. You can use it to get more details about this location using Google's Places API.

    +
  • +
  • +

    endGeoCode: "48.859466,2.2976965" - The geographical coordinates of the end location. The first number is latitude and the second is longitude.

    +
  • +
  • +

    transferType: "PRIVATE" - This indicates that the transfer type is private, meaning the transfer will not be shared with others. This value is the Amadeus transfer service type, which can take one of the following:

    +
  • +
  • +

    PRIVATE: Private transfer from point to point

    +
  • +
  • SHARED: Shared transfer from point to point
  • +
  • TAXI: Taxi reservation from point to point, price is estimated
  • +
  • HOURLY: Chauffeured driven transfer per hour
  • +
  • AIRPORT_EXPRESS: Express Train from/to Airport
  • +
  • AIRPORT_BUS: Express Bus from/to Airport
  • +
  • HELICOPTER: Private helicopter flight from/to airport
  • +
  • +

    PRIVATE_JET: Private flight from airport to airport

    +
  • +
  • +

    startDateTime: "2021-11-10T10:30:00" - The ISO 8601 timestamp when the journey begins.

    +
  • +
  • +

    providerCodes: "TXO" - The code representing the provider of the transfer service.

    +
  • +
  • +

    passengers: 2 - The total number of passengers who will take the journey.

    +
  • +
  • +

    stopOvers: This is an array of objects representing different stopovers on the journey. Each object includes details about the duration of the stopover, the sequence number (which stopover it is), and information about the stopover's address, country code, city name, zip code, Google place ID, name, and geographical coordinates. For example, a stopOver object might look like this:

    +
  • +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
{
+  "duration": "PT2H30M",
+  "sequenceNumber": 1,
+  "addressLine": "Avenue de la Bourdonnais, 19",
+  "countryCode": "FR",
+  "cityName": "Paris",
+  "zipCode": "75007",
+  "googlePlaceId": "DOWeBv5kcRfTbh97PimN",
+  "name": "De La Tours",
+  "geoCode": "48.859477,2.2976985",
+  "stateCode": "FR"
+}
+
+
    +
  • +

    startConnectedSegment: This object contains information about a connected transportation segment, like a flight, that leads to the start of this transfer. It includes details about the transportation type, transportation number, and the departure and arrival of this segment.

    +
  • +
  • +

    passengerCharacteristics: This array of objects includes details about the passengers' type codes and their ages. For example, "ADT" stands for an adult passenger and "CHD" stands for a child passenger.

    +
  • +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
{
+  "startLocationCode": "CDG",
+  ...
+  "endGeoCode": "48.859466,2.2976965",
+  "transferType": "PRIVATE",
+  ...
+  "passengers": 2,
+  "stopOvers": [
+    {
+      "duration": "PT2H30M",
+      "sequenceNumber": 1,
+      ...
+      "stateCode": "FR"
+    }
+  ],
+  ...
+  "passengerCharacteristics": [
+    {
+      "passengerTypeCode": "ADT",
+      "age": 20
+    },
+    ...
+  ]
+}
+
+

This request initiates a search for a private transfer for two passengers from location CDG with specific passenger characteristics and other details.

+

Let's have a look at the response:

+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
{
+  "data": [
+    {
+      "type": "transfer-offer",
+      "id": "0cb11574-4a02-11e8-842f-0ed5f89f718b",
+      "transferType": "PRIVATE",
+      "start": {
+        "dateTime": "2021-11-10T10:30:00",
+        "locationCode": "CDG"
+      },
+      "end": {
+        "address": {
+          "line": "Avenue Anatole France, 5",
+          "zip": "75007",
+          "countryCode": "FR",
+          "cityName": "Paris",
+          "latitude": 48.859466,
+          "longitude": 2.2976965
+        },
+        "googlePlaceId": "ChIJL-DOWeBv5kcRfTbh97PimNc",
+        "name": "Souvenirs De La Tour"
+      },
+      "stopOvers": [
+        {
+          "duration": "PT2H30M",
+          "sequenceNumber": 1,
+          "location": {
+            "locationCode": "CDG",
+            "address": {
+              "line": "Avenue de la Bourdonnais, 19",
+              "zip": "75007",
+              "countryCode": "FR",
+              "cityName": "Paris",
+              "latitude": 48.859477,
+              "longitude": 2.2976975
+            },
+            "googlePlaceId": "DOWeBv5kcRfTbh97PimN",
+            "name": "De La Tours"
+          }
+        }
+      ],
+      "vehicle": {
+        "code": "VAN",
+        "category": "BU",
+        "description": "Mercedes-Benz V-Class, Chevrolet Suburban, Cadillac Escalade or similar",
+        "seats": [
+          {
+            "count": 3
+          }
+        ],
+        "baggages": [
+          {
+            "count": 3,
+            "size": "M"
+          }
+        ],
+        "imageURL": "https://provider.com/images/BU_VAN.png"
+      },
+      "serviceProvider": {
+        "code": "ABC",
+        "name": "Provider name",
+        "logoUrl": "https://provider.com/images/logo.png",
+        "termsUrl": "https://provider.com/terms_and_conditions.html",
+        "contacts": {
+          "phoneNumber": "+33123456789",
+          "email": "support@provider.com"
+        },
+        "settings": [
+          "BILLING_ADDRESS_REQUIRED",
+          "FLIGHT_NUMBER_REQUIRED",
+          "CVV_NUMBER_REQUIRED"
+        ]
+      },
+      "quotation": {
+        "monetaryAmount": "63.70",
+        "currencyCode": "USD",
+        "isEstimated": false,
+        "base": {
+          "monetaryAmount": "103.70"
+        },
+        "discount": {
+          "monetaryAmount": "50.00"
+        },
+        "fees": [
+          {
+            "indicator": "AIRPORT",
+            "monetaryAmount": "10.00"
+          }
+        ],
+        "totalTaxes": {
+          "monetaryAmount": "12.74"
+        },
+        "totalFees": {
+          "monetaryAmount": "10.00"
+        }
+      },
+      "converted": {
+        "monetaryAmount": "63.70",
+        "currencyCode": "EUR",
+        "isEstimated": false,
+        "base": {
+          "monetaryAmount": "103.70"
+        },
+        "discount": {
+          "monetaryAmount": "50.00"
+        },
+        "fees": [
+          {
+            "indicator": "AIRPORT",
+            "monetaryAmount": "10.00"
+          }
+        ],
+        "totalTaxes": {
+          "monetaryAmount": "12.74"
+        },
+        "totalFees": {
+          "monetaryAmount": "10.00"
+        }
+      },
+      "extraServices": [
+        {
+          "code": "EWT",
+          "itemId": "EWT0291",
+          "description": "Extra 15 min. wait",
+          "quotation": {
+            "monetaryAmount": "39.20",
+            "currencyCode": "USD",
+            "base": {
+              "monetaryAmount": "36.00"
+            },
+            "totalTaxes": {
+              "monetaryAmount": "3.20"
+            }
+          },
+          "converted": {
+            "monetaryAmount": "32.70",
+            "currencyCode": "EUR",
+            "base": {
+              "monetaryAmount": "30.00"
+            },
+            "totalTaxes": {
+              "monetaryAmount": "2.7"
+            }
+          },
+          "isBookable": true,
+          "taxIncluded": true,
+          "includedInTotal": false
+        }
+      ],
+      "equipment": [
+        {
+          "code": "BBS",
+          "description": "Baby stroller or Push chair",
+          "quotation": {
+            "monetaryAmount": "39.20",
+            "currencyCode": "USD",
+            "base": {
+              "monetaryAmount": "36.00"
+            },
+            "totalTaxes": {
+              "monetaryAmount": "3.20"
+            }
+          },
+          "converted": {
+            "monetaryAmount": "32.70",
+            "currencyCode": "EUR",
+            "base": {
+              "monetaryAmount": "30.00"
+            },
+            "totalTaxes": {
+              "monetaryAmount": "2.7"
+            }
+          },
+          "isBookable": true,
+          "taxIncluded": true,
+          "includedInTotal": false
+        }
+      ],
+      "cancellationRules": [
+        {
+          "feeType": "PERCENTAGE",
+          "feeValue": "100",
+          "metricType": "DAYS",
+          "metricMin": "0",
+          "metricMax": "1"
+        },
+        {
+          "feeType": "PERCENTAGE",
+          "feeValue": "0",
+          "metricType": "DAYS",
+          "metricMin": "1",
+          "metricMax": "100"
+        }
+      ],
+      "methodsOfPaymentAccepted": [
+        "CREDIT_CARD",
+        "INVOICE"
+      ],
+      "discountCodes": [
+        {
+          "type": "CD",
+          "value": "FJKS0289LDIW234"
+        }
+      ],
+      "distance": {
+        "value": 152,
+        "unit": "KM"
+      },
+      "startConnectedSegment": {
+        "transportationType": "FLIGHT",
+        "transportationNumber": "AF380",
+        "departure": {
+          "localDateTime": "2021-11-10T09:00:00",
+          "iataCode": "NCE"
+        },
+        "arrival": {
+          "localDateTime": "2021-11-10T10:00:00",
+          "iataCode": "CDG"
+        }
+      },
+      "passengerCharacteristics": [
+        {
+          "passengerTypeCode": "ADT",
+          "age": 20
+        },
+        {
+          "passengerTypeCode": "CHD",
+          "age": 10
+        }
+      ]
+    }
+  ],
+  "warnings": [
+    {
+      "code": 101,
+      "title": "PICK-UP DATE TIME CHANGED",
+      "detail": "Transfer pick-up date and time have been changed by provider",
+      "source": {
+        "pointer": "/data/1/start/dateTime",
+        "parameter": "dateTime"
+      }
+    }
+  ]
+}
+
+

The data represents a private transfer offer with the id 0cb11574-4a02-11e8-842f-0ed5f89f718b. The transfer begins from the location CDG at the time 2021-11-10T10:30:00 and ends at the location Souvenirs De La Tour located at Avenue Anatole France, 5 in Paris, France.

+

During the journey, there's a stopover at De La Tours situated at Avenue de la Bourdonnais, 19 in Paris, France for 2 hours and 30 minutes. The vehicle to be used for this transfer is a VAN in the category BU. The model of the vehicle can be a Mercedes-Benz V-Class, Chevrolet Suburban, Cadillac Escalade or similar. The vehicle can accommodate 3 passengers and 3 medium-sized baggages.

+

The transfer service provider is Provider name with the code ABC. The quotation for the transfer is 63.70 USD after a discount of 50.00 USD from the base price of 103.70 USD. The total taxes and fees for the transfer are 12.74 USD and 10.00 USD respectively.

+

There are also options to avail extra services like "Extra 15 min. wait" for 39.20 USD and to rent equipment like Baby stroller or Push chair for 39.20 USD. The cancellation rules state a 100% fee for cancellations made between 0 to 1 day before the transfer and no fee for cancellations made between 1 to 100 days before the transfer.

+

The payment for the transfer can be made through Credit Card or Invoice. A discount code FJKS0289LDIW234 is also available for use.

+

This transfer offer is linked to a flight with the transportation number AF380 departing from NCE at 2021-11-10T09:00:00 and arriving at CDG at 2021-11-10T10:00:00. The transfer caters to a passenger aged 20 and a child aged 10.

+

A warning code 101 titled PICK-UP DATE TIME CHANGED is issued stating that the transfer pick-up date and time have been changed by the provider.

+

Booking a transfer

+

Let's now look into the Transfer Booking API.

+

The main endpoint URL is https://test.api.amadeus.com/v1/ordering/transfer-orders?offerId=<OFFER_ID>. The parameter <OFFER_ID> needs to be replaced with the actual ID of the offer you wish to order, such as 0cb11574-4a02-11e8-842f-0ed5f89f718b, which we obtained in our previous example.

+

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
{
+  "data": {
+    "note": "Note to driver",
+    "passengers": [
+      {
+        "firstName": "John",
+        "lastName": "Doe",
+        "title": "MR",
+        "contacts": {
+          "phoneNumber": "+33123456789",
+          "email": "user@email.com"
+        },
+        "billingAddress": {
+          "line": "Avenue de la Bourdonnais, 19",
+          "zip": "75007",
+          "countryCode": "FR",
+          "cityName": "Paris"
+        }
+      }
+    ],
+    "agency": {
+      "contacts": [
+        {
+          "email": {
+            "address": "abc@test.com"
+          }
+        }
+      ]
+    },
+    "payment": {
+      "methodOfPayment": "CREDIT_CARD",
+      "creditCard": {
+        "number": "4111111111111111",
+        "holderName": "JOHN DOE",
+        "vendorCode": "VI",
+        "expiryDate": "1018",
+        "cvv": "111"
+      }
+    },
+    "extraServices": [
+      {
+        "code": "EWT",
+        "itemId": "EWT0291"
+      }
+    ],
+    "equipment": [
+      {
+        "code": "BBS"
+      }
+    ],
+    "corporation": {
+      "address": {
+        "line": "5 Avenue Anatole France",
+        "zip": "75007",
+        "countryCode": "FR",
+        "cityName": "Paris"
+      },
+      "info": {
+        "AU": "FHOWMD024",
+        "CE": "280421GH"
+      }
+    },
+    "startConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2021-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2021-03-27T20:03:00"
+      }
+    },
+    "endConnectedSegment": {
+      "transportationType": "FLIGHT",
+      "transportationNumber": "AF380",
+      "departure": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2021-03-27T20:03:00"
+      },
+      "arrival": {
+        "uicCode": "7400001",
+        "iataCode": "CDG",
+        "localDateTime": "2021-03-27T20:03:00"
+      }
+    }
+  }
+}
+
+- data: Root level object encapsulating all the necessary data for the transfer order. + - note: A string containing a note intended for the driver. (Example: "Note to driver") + - passengers: An array of objects, each representing a passenger with the following properties: + - firstName: A string containing the passenger's first name. (Example: "John") + - lastName: A string containing the passenger's last name. (Example: "Doe") + - title: A string containing the passenger's title ("MR", "MS", etc.). (Example: "MR") + - contacts: An object containing contact details: + - phoneNumber: A string containing the passenger's phone number. (Example: "+33123456789") + - email: A string containing the passenger's email address. (Example: "user@email.com") + - billingAddress: An object containing the billing address details: + - line: Street name and number. (Example: "Avenue de la Bourdonnais, 19") + - zip: Zip or postal code. (Example: "75007") + - countryCode: Country code. (Example: "FR") + - cityName: City name. (Example: "Paris") + - agency: An object representing the agency details with the following properties: + - contacts: An array containing objects, each representing a contact's details: + - email: An object containing the email details: + - address: A string containing the contact's email address. (Example: "abc@test.com") + - payment: An object containing payment details: + - methodOfPayment: A string indicating the method of payment. (Example: "CREDIT_CARD") + - creditCard: An object containing credit card details: + - number: A string containing the credit card number. (Example: "4111111111111111") + - holderName: A string containing the card holder's name. (Example: "JOHN DOE") + - vendorCode: A string containing the vendor's code. (Example: "VI") + - expiryDate: A string containing the expiry date of the card. (Example: "1018") + - cvv: A string containing the card's CVV. (Example: "111") + - extraServices: An array containing objects, each representing an extra service: + - code: A string indicating the service's code. (Example: "EWT") + - itemId: A string indicating the service's item ID. (Example: "EWT0291") + - equipment: An array containing objects, each representing an equipment detail: + - code: A string indicating the equipment's code. (Example: "BBS") + - corporation: An object containing corporation details: + - address: An object containing the corporation address: + - line: Street name and number. (Example: "5 Avenue Anatole France") + - zip: Zip or postal code. (Example: "75007") + - countryCode: Country code. (Example: "FR") + - cityName: City name. (Example: "Paris") + - info: An object containing additional corporation info: + - AU: Additional information (Example: "FHOWMD024") + - CE: Additional information (Example: "280421GH") + - startConnectedSegment: An object representing the start of a connected transport segment: + - transportationType: A string indicating the type of transportation. (Example: "FLIGHT") + - transportationNumber: A string indicating the transportation number. (Example: "AF380") + - departure: An object containing departure details: + - uicCode: A string indicating the UIC code. (Example: "7400001") + - iataCode: A string indicating the IATA code. (Example: "CDG") + - localDateTime: A string indicating the local date and time of departure. (Example: "2021-03-27T20:03:00") + - arrival: An object containing arrival details: + - uicCode: A string indicating the UIC code. (Example: "7400001") + - iataCode: A string indicating the IATA code. (Example: "CDG") + - localDateTime: A string indicating the local date and time of arrival. (Example: "2021-03-27T20:03:00") + - endConnectedSegment: An object representing the end of a connected transport segment (same structure as startConnectedSegment).

+

Cancelling a transfer

+

The Transfer Management API effectively allows us to cancel a transfer linked with an existing order.

+

For example:

+

POST https://test.api.amadeus.com/v1/ordering/transfer-orders/{orderId}/transfers/cancellation

+

The {orderId} in the URL should be replaced with the unique identifier of the order that was previously generated when the order was created. For instance, the orderId could be something like 0cb11574-4a02-11e8-842f-0ed5f89f718b.

+

The confirmNbr is a unique confirmation number associated with the transfer that is to be cancelled.

+

The response for this request will confirm the cancellation of the transfer. Here's an example response:

+
1
+2
+3
+4
+5
+6
{
+  "data": {
+    "confirmNbr": "2904892",
+    "reservationStatus": "CANCELLED"
+  }
+}
+
+

In this example response, we see the confirmNbr 2904892 and the reservationStatus CANCELLED, confirming that the cancellation has been successful.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/destination-experiences/index.html b/resources/destination-experiences/index.html new file mode 100644 index 00000000..7ed37114 --- /dev/null +++ b/resources/destination-experiences/index.html @@ -0,0 +1,2058 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Destination experiences - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Destination Experiences

+

With Amadeus Self-Service APIs, you can find data on over two million places and 150,000 activities and show travelers the best things to see and do. In the Destination Experiences category, we have two APIs available for that.

+
+

Information

+

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

+
+ + + + + + + + + + + + + + + + + +
APIsDescription
Points of InterestFind the best sights, shops, and restaurants in any city or neighborhood.
Tours and ActivitiesFind the best tours, activities, and tickets in any city or neighborhood. Includes a deep link to book with the provider.
+

These two APIs have the same behavior. You can search by radius or by a square, and retrieve results by ID. Let's go through them one by one.

+

Show Travelers the best sights, shops, and restaurants

+

The Points of Interest API relies on AVUXI’s GeoPopularity algorithm, which analyses and ranks geolocated data from more than 60 sources, including comments, photos, and reviews from millions of users.

+

Search by radius

+

The first endpoint supports only GET method and returns a list of points of interest for a given location - latitude and longitude - and a radius (1 km by default).

+

The following sample returns a list of Points of Interest for someone geolocated in Barcelona downtown:

+
curl https://test.api.amadeus.com/v1/reference-data/locations/pois?latitude=41.397158&longitude=2.160873
+
+

In case we want to expand the area of search, we could use the radius parameter. In the following example, we increase the radius to 3 kilometers:

+
curl https://test.api.amadeus.com/v1/reference-data/locations/pois?latitude=41.397158&longitude=2.160873&radius=3
+
+

Search by a square

+

The second endpoint works in a similar way to the radius-based endpoint. It also supports GET operations but it defines the area of search by a square: North, West, South, and East.

+

The following example returns a list of points of interest for an area around Barcelona:

+
curl https://test.api.amadeus.com/v1/reference-data/locations/pois/by-square?north=41.397158&west=2.160873&south=41.394582&east=2.177181   
+
+

Response

+

For both endpoints you can expect the same response format - a list of locations with the following JSON structure:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
{
+            "type": "location",
+            "subType": "POINT_OF_INTEREST",
+            "id": "AF57D529B2",
+            "self": {
+                "href": "https://test.api.amadeus.com/v1/reference-data/locations/pois/AF57D529B2",
+                "methods": [
+                    "GET"
+                ]
+            },
+            "geoCode": {
+                "latitude": 41.40359,
+                "longitude": 2.17436
+            },
+            "name": "La Sagrada Familia",
+            "category": "SIGHTS",
+            "rank": 5,
+            "tags": [
+                "church",
+                "sightseeing",
+                "temple",
+                "sights",
+                "attraction",
+                "historicplace",
+                "tourguide",
+                "landmark",
+                "professionalservices",
+                "latte",
+                "activities",
+                "commercialplace"
+            ]
+        }
+
+
    +
  • Type and subType are literals with fixed values.
  • +
  • id is a unique value for this point of interest, which you can use in the next endpoint.
  • +
  • geoCode is a structure that contains geolocation information: latitude and longitude of the location.
  • +
  • name contains the string identifying the location.
  • +
  • category corresponds to the category of the location and could be one of the following values: SIGHTS, BEACH_PARK, HISTORICAL, NIGHTLIFE, RESTAURANT, or SHOPPING.
  • +
  • rank is the position compared to other locations based on how famous a place is, with 1 being the highest.
  • +
  • tags field is a list of words related to that location, which comes directly from the different sources of data analyzed.
  • +
+

Retrieve by Id

+

You can also keep the unique Id of each point of interest and retrieve it with the last endpoint as below.

+
curl https://test.api.amadeus.com/v1/reference-data/locations/pois/AF57D529B2  
+
+

Offer tours, activities, and attraction tickets

+

The Tours and Activities API is built in partnership with MyLittleAdventure. Tours and Activities API enables you to offer users the best activities in any destination, complete with a photo, description, price, and link to book the activity directly with the provider.

+

For the API, we partnered with MyLittleAdventure which aggregates offers from over 45 of the world’s top activity platforms, such as Viator, GetYourGuide, Klook and Musement and applies an algorithm to identify duplicate activities across providers, compare them and return the best one.

+

You can now help your users find the best things to do in over 8,000 destinations worldwide and book more than 300,000 unique activities including sightseeing tours, day trips, skip-the-line museum tickets, food tours, hop-on-hop-off bus tickets and much more.

+

This API has the same design as other endpoints, such as the Points of Interest API.

+

Search by radius

+

You can search activities for a specific location by providing a latitude and longitude. The API returns activities within a 1km radius, but you can also define a custom radius.

+
curl https://test.api.amadeus.com/v1/shopping/activities/longitude=-3.69170868&latitude=40.41436995&radius=1   
+
+

Search by a square

+

You can search activities within a given area by providing the coordinates: North, West, South, and East.

+
curl https://test.api.amadeus.com/v1/shopping/activities/by-square?north=41.397158&west=2.160873&south=41.394582&east=2.177181 
+
+

Response

+

Let’s look at a sample response from the Tours and Activities API:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
{ 
+  "data": [ 
+    { 
+      "id": "23642", 
+      "type": "activity", 
+      "self": { 
+        "href": "https://test.api.amadeus.com/v1/shopping/activities/23642", 
+        "methods": [ 
+          "GET" 
+        ] 
+      }, 
+      "name": "Skip-the-line tickets to the Prado Museum", 
+      "shortDescription": "Book your tickets for the Prado Museum in Madrid, discover masterpieces by Velázquez, Goya, Mantegna, Raphael, Tintoretto and access all temporary exhibitions.", 
+      "geoCode": { 
+        "latitude": "40.414000", 
+        "longitude": "-3.691000" 
+      }, 
+      "rating": "4.500000", 
+      "pictures": [ 
+        "https://images.musement.com/cover/0001/07/prado-museum-tickets_header-6456.jpeg?w=500" 
+      ], 
+      "bookingLink": "https://b2c.mla.cloud/c/QCejqyor?c=2WxbgL36", 
+      "price": { 
+        "currencyCode": "EUR", 
+        "amount": "16.00" 
+      } 
+    } 
+  ] 
+} 
+
+

As you can see, the API returns a unique activity Id along with the activity name, short description, geolocation, customer rating, image, price and deep link to the provider page to complete the booking.

+
    +
  • Type is a literal with a fixed value.
  • +
  • id is a unique value for this activity, that you can use in the next endpoint.
  • +
  • name and shortDescription contains the information about the activity.
  • +
  • geoCode is a structure that contains geolocation information: latitude and longitude of the location.
  • +
  • rating is a rating of the activity.
  • +
  • pictures and booking link are external links to check the relevant pictures and to go to the booking URL from the activity provider.
  • +
  • price is the price of the fare, which can be alpha-numeric. Ex- 500.20 or 514.13A, A signifies additional collection.
  • +
+

Retrieve by Id

+

Same as Points of Interest API, you can keep the unique Id of each activity and retrieve it with the last endpoint as below.

+
curl https://test.api.amadeus.com/v1/shopping/activities/23642
+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/flights/index.html b/resources/flights/index.html new file mode 100644 index 00000000..dbc38189 --- /dev/null +++ b/resources/flights/index.html @@ -0,0 +1,5457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flights - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Flights

+

The Flights category contains a wide array of APIs that can help you manage flights, from searching for flight options to actually booking a flight.

+
+

Information

+

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
APIsDescription
Flight booking
Flight Offers SearchLets you can search flights between two cities, perform multi-city searches for longer itineraries and access one-way combinable fares to offer the cheapest options possible.
Flight Offers PriceConfirms the availability and final price (including taxes and fees) of flights returned by the Flight Offers Search API.
Flight Create OrdersProvides a unique booking ID and reservation details once the reservation is completed.
Flight Order ManagementChecks the latest status of a reservation, shows post-booking modifications like ticket information or form of payment and lets you cancel reservations.
Seatmap DisplayShows airplane cabin plan from a Flight Offer in order for the traveler to be able to choose their seat during the flight booking flow.
Branded Fares UpsellProvides the branded fares available for a given flight, along with pricing and a fare description.
Flight Price AnalysisUses an Artificial Intelligence algorithm trained on Amadeus historical flight booking data to show how current flight prices compare to historical fares and whether the price of a flight is below or above average.
Flight Choice PredictionUses Artificial Intelligence and Amadeus historical flight booking data to identify which flights in search results are most likely to be booked.
Flight inspiration
Flight Inspiration SearchProvides a list of destinations from a given city that is ordered by price and can be filtered by departure date or maximum price.
Flight Cheapest Date SearchProvides a list of flight options with dates and prices, and allows you to order by price, departure date or duration.
Flight Availabilities SearchProvides a list of flights with seats for sale on a given itinerary and the quantity of seats available in different fare classes.
Travel RecommendationsUses Artificial Intelligence trained on Amadeus historical flight search data to determine which destinations are also popular among travelers with similar profiles, and provides a list of recommended destinations with name, IATA code, coordinates and similarity score.
Flight schedule
On Demand Flight StatusProvides real-time flight schedule data including up-to-date departure and arrival times, terminal and gate information, flight duration and real-time delay status. Help travelers track the live status of their flight and enjoy a stress-free trip.
Flight Delay PredictionProvides delay probabilities for four possible delay lengths
Airport
Airport & City SearchFinds airports and cities that match a specific word or a string of letters.
Airport Nearest RelevantProvides a list of commercial airports within a 500km (311mi) radius of a given point that are ordered by relevance, which considers their distance from the starting point and their yearly flight traffic.
Airport Routes APIFinds all destinations served by a given airport.
Airport On-Time PerformancePredicts an airport's overall performance based on the delay of all flights during a day.
Airlines
Flight Check-in LinksSimplifies the check-in process by providing direct links to the airline check-in page.
Airline Code LookupFinds the name of an airline by its IATA or ICAO airline codes.
Airline RoutesFinds all destinations served by a given airline.
+

Search flights

+

Search to get flight inspirations

+

The Flight Inspiration Search API provides a list of destinations from a given airport that is searched by the IATA code of the origin, ordered by price and filtered by departure date, one-way/round-trip, trip duration, connecting flights or maximum price.

+
+

Information

+

The Flight Inspiration Search API uses dynamic cache data. This cache data is created daily based on the most trending options that are derived from past searches and bookings. In this way, only the most trending options are included in the response.

+
+

The only mandatory query parameter is the IATA code of the origin as in the following example request that retrieves a list of destinations from Boston:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS
+
+

The departure date is an optional parameter, which needs to be provided in the YYYY-MM-DD format:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&departureDate=2022-12-12
+
+

If the oneWay parameter set to true, only one way flight options will be provided in the response. Alternatively, if the oneWay parameter set to false, the search results will show round-trip flights. Otherwise, both flight options will be included in the results. For example, the following request shows one-way flights out of Boston:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&oneWay=true
+
+

One-way journeys can be optionally refined by the journey duration provided in days with the duration parameter:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&oneWay=true&duration=2
+
+

The nonStop parameter filters the search query to direct flights only:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&nonStop=true
+
+

If you need to cap the maximum ticket price, just specify the maximum price in decimals using the maxPrice parameter:

+
GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&maxPrice=100
+
+
+

Information

+

This API returns cached prices. Once a destination is chosen, use the Flight Offers Search API to get real-time pricing and availability.

+
+

The API provides a link to the Flight Offers Search API to search for flights once a +destination is chosen and a link to the Flight Cheapest Date Search API to check the +cheapest dates to fly:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
"data": [
+        {
+            "type": "flight-destination",
+            "origin": "BOS",
+            "destination": "CHI",
+            "departureDate": "2022-07-22",
+            "returnDate": "2022-07-28",
+            "price": {
+                "total": "52.18"
+            },
+            "links": {
+                "flightDates": "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&destination=CHI&departureDate=2022-07-02,2022-12-28&oneWay=false&duration=1,15&nonStop=false&maxPrice=300&currency=USD&viewBy=DURATION",
+                "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22&returnDate=2022-07-28&adults=1&nonStop=false&maxPrice=300&currency=USD"
+            }
+        }
+    ]
+
+

Search for destinations for a specific duration of stay

+

For example, let's say a traveler wants to spend six days in a city but doesn't have a strong preference for the destination. With the Flight Inspiration Search API we can recommend the traveler the cheapest destinations based on the stay duration. 

+

This can be done using the parameter viewBy which returns flight destinations by DATE, DESTINATION, DURATION, WEEK, or COUNTRY. In our scenario we need to pass the value DURATION to the parameter viewBy, like in the example below. Also, as input we give a duration of six days and origin Miami. The departure date will be between the 1st and 3rd of September 2021.

+

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?departureDate=2021-09-01,2021-09-03&duration=6&origin=MIA&viewBy=DURATION

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
  {
+            "type": "flight-destination",
+            "origin": "MIA",
+            "destination": "MSP",
+            "departureDate": "2021-09-01",
+            "returnDate": "2021-09-07",
+            "price": {
+                "total": "136.79"
+            },
+            "links": {
+                "flightDates": "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MIA&destination=MSP&departureDate=2021-09-01,2021-09-03&oneWay=false&duration=6&nonStop=false&viewBy=DURATION",
+                "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MIA&destinationLocationCode=MSP&departureDate=2021-09-01&returnDate=2021-09-07&adults=1&nonStop=false"
+            }
+        },
+        {
+            "type": "flight-destination",
+            "origin": "MIA",
+            "destination": "STT",
+            "departureDate": "2021-09-02",
+            "returnDate": "2021-09-08",
+            "price": {
+                "total": "137.36"
+            },
+            "links": {
+                "flightDates": "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MIA&destination=STT&departureDate=2021-09-01,2021-09-03&oneWay=false&duration=6&nonStop=false&viewBy=DURATION",
+                "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MIA&destinationLocationCode=STT&departureDate=2021-09-02&returnDate=2021-09-08&adults=1&nonStop=false"
+            }
+        }
+
+

As you can see, all the recommendations have a duration of six days and are sorted by the lowest price. The API also provides link to the Flight Offers Search API for each result in order to check for available flights.

+

Search for cheapest flights regardless of the dates

+

The Flight Cheapest Date Search API finds the cheapest dates to travel from one +city to another. The API provides a list of flight options with dates and prices, +and allows you to order by price, departure date or duration.

+
+

Information

+

The Flight Cheapest Date Search API uses dynamic cache data. This cache data is created daily based on the most trending options that are derived from past searches and bookings. In this way, only the most trending options are included in the response.

+
+
+

Information

+

This API returns cached prices. Once the dates are chosen, use the Flight Offers Search API to get real-time pricing and availability.

+
+

The origin and destination are the two mandatory query parameters:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=MUC
+
+

We can further refine our search query by the departure dates, one-way/round-trip, trip duration, connecting flights or maximum price.

+

The API supports one or multiple departure dates in the query provided the dates are speficied in the ISO 8601 YYYY-MM-DD format and separated by a comma:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&destination=CHI&departureDate=2022-08-15,2022-08-28
+
+

If the oneWay parameter set to true, only one way flight options will be provided in the response. Alternatively, if the oneWay parameter set to false, the search results will show round-trip flights. Otherwise, both flight options will be included in the results. For example, the following request shows one-way flights out of Boston:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&oneWay=true
+
+

One-way journeys can be optionally refined by the journey duration provided in days with the duration parameter:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&oneWay=true&duration=2
+
+

The nonStop parameter filters the search query to direct flights only:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&nonStop=true
+
+

If you need to cap the maximum ticket price, just specify the maximum price in decimals using the maxPrice parameter:

+
GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&maxPrice=100
+
+

The API provides a link to the Flight Offers Search API to search for flights once a +destination is chosen, in order to proceed with the booking flow.

+

Search for best flight offers

+

The Flight Offers Search API searches over 500 airlines to find the cheapest +flights for a given itinerary. The API lets you search flights between two +cities, perform multi-city searches for longer itineraries and access one-way +combinable fares to offer the cheapest options possible. For each itinerary, +the API provides a list of flight offers with prices, fare details, airline +names, baggage allowances and departure terminals.

+
+

Tip

+ +
+
+

Warning

+
    +
  • Flights from low-cost carriers and American Airlines are currently unavailable.
  • +
+
+

The Flight Offers Search API starts the booking cycle with a search for the +best fares. The API returns a list of the cheapest flights given a city/airport +of departure, a city/airport of arrival, the number and type of passengers and +travel dates. The results are complete with airline name and fares as well as +additional information, such as bag allowance and pricing for additional baggage.

+

The API comes in two flavors:

+
    +
  • Simple version: GET operation with few parameters but which is quicker to integrate.
  • +
  • On steroids: POST operation offering the full functionalities of the API.
  • +
+

The minimum GET request has following mandatory query parameters:

+
    +
  • IATA code for the origin location
  • +
  • IATA code for the destination location
  • +
  • Departure date in the ISO 8601 YYYY-MM-DD format
  • +
  • Number of adult travellers
  • +
+
GET https://test.api.amadus.com/v2/shopping/flight-offers?adults=1&originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22
+
+

Let's have a look at all the optional parameters that we can use to refine the search query. One or more of these parameters can be used in addition to the mandatory query parameters.

+

Return date in the ISO 8601 YYYY-MM-DD format, same as the departure date:

+
GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22&returnDate=2022-07-26&adults=1
+
+

Number of children travelling, same as the number of adults:

+
GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&children=1
+
+

Number of infants travelling, same as the number of adults:

+
GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&infants=1
+
+

Travel class, which includes economy, premium economy, business or first:

+
GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&travelClass=ECONOMY
+
+

We can limit the search to a specific airline by providing its IATA airline code, such as BA for the British Airways:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&includedAirlineCodes=BA

+

Alternatively, we can exclude an airline from the search in a similar way:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&excludedAirlineCodes=BA

+

The nonStop parameter filters the search query to direct flights only:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&nonStop=true

+

The currencyCode defines the currency in which we will see the offer prices:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&currencyCode=EUR

+

We can limit the maximum price to a certain amount and specify the currency as described above:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&maxPrice=500&currencyCode=EUR

+

The maximum number of results retrieved can be limited using the max parameter in the search query:

+

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&max=1

+

The API returns a list of flight-offer objects (up to 250), including +information such as itineraries, price, pricing options, etc.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
"data": [
+    {
+      "type": "flight-offer",
+      "id": "1",
+      "source": "GDS",
+      "instantTicketingRequired": false,
+      "nonHomogeneous": false,
+      "oneWay": false,
+      "lastTicketingDate": "2022-07-02",
+      "numberOfBookableSeats": 9,
+      "itineraries": [ ],
+      "price": {
+        "currency": "EUR",
+        "total": "22.00",
+        "base": "13.00",
+        "fees": [
+          {
+            "amount": "0.00",
+            "type": "SUPPLIER"
+          },
+          {
+            "amount": "0.00",
+            "type": "TICKETING"
+          }
+        ],
+        "grandTotal": "22.00"
+      }
+    }
+  ]
+
+

The POST endpoint consumes JSON data in the format described below. So, instead of constructing a search query, we can specify all the required parameters in the payload and pass it onto the API in the request body. In addition to this, a X-HTTP-Method-Override header parameter is required.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
{
+  "currencyCode": "USD",
+  "originDestinations": [
+    {
+      "id": "1",
+      "originLocationCode": "RIO",
+      "destinationLocationCode": "MAD",
+      "departureDateTimeRange": {
+        "date": "2022-11-01",
+        "time": "10:00:00"
+      }
+    },
+    {
+      "id": "2",
+      "originLocationCode": "MAD",
+      "destinationLocationCode": "RIO",
+      "departureDateTimeRange": {
+        "date": "2022-11-05",
+        "time": "17:00:00"
+      }
+    }
+  ],
+  "travelers": [
+    {
+      "id": "1",
+      "travelerType": "ADULT"
+    },
+    {
+      "id": "2",
+      "travelerType": "CHILD"
+    }
+  ],
+  "sources": [
+    "GDS"
+  ],
+  "searchCriteria": {
+    "maxFlightOffers": 2,
+    "flightFilters": {
+      "cabinRestrictions": [
+        {
+          "cabin": "BUSINESS",
+          "coverage": "MOST_SEGMENTS",
+          "originDestinationIds": [
+            "1"
+          ]
+        }
+      ],
+      "carrierRestrictions": {
+        "excludedCarrierCodes": [
+          "AA",
+          "TP",
+          "AZ"
+        ]
+      }
+    }
+  }
+}
+
+

Search for flights including or excluding specific airlines

+

If you want your search to return flights with only specified airlines, you can use the parameter includedAirlineCodes to consider specific airlines. For example, there is a traveler who wants to travel from Berlin to Athens only with Aegean Airlines (A3):

+

GET https://test.api.amadeus.com/v2/shopping/flight-offers?max=3&adults=1&includedAirlineCodes=A3&originLocationCode=BER&destinationLocationCode=ATH&departureDate=2022-12-06

+

With the parameter excludedAirlineCodes you can ignore specific airlines. For example, there is a traveler who wants to travel from Berlin to Athens ignoring both Aegean Airlines (A3) and Iberia (IB):

+

GET https://test.api.amadeus.com/v2/shopping/flight-offers?max=3&adults=1&excludedAirlineCodes=A3,IB&originLocationCode=BER&destinationLocationCode=ATH&departureDate=2021-09-06

+

Interactive code examples

+

Check out this interactive code example which provides a flight search form to help you build your app. You can easily customize it and use the Flight Offers Search API to get the cheapest flight offers.

+

Search for the best flight option

+

The Flight Choice Prediction API predicts the flight your users will choose. +Our machine-learning models have analyzed historical interactions with the +Flight Offers Search API and can determine each flight’s probability of being +chosen. Boost conversions and create a personalized experience by filtering out +the noise and showing your users the flights which are best for them.

+

Here is a quick cURL example piping the Flight Offers Search API results directly to the prediction API. Please note that a X-HTTP-Method-Override header parameter is required.

+

Let’s look at flight offers for a Madrid-New York round trip (limiting to four options for this test illustration)

+
1
+2
+3
+4
+5
+6
+7
+8
curl --request GET \
+     --header 'Authorization: Bearer <token>' \
+     --url https://test.api.amadeus.com/v2/shopping/flight-offers\?origin\=MAD\&destination\=NYC\&departureDate\=2019-08-24\&returnDate\=2019-09-19\&adults\=1 \
+| curl --request POST \
+       --header 'content-type: application/json' \
+       --header 'Authorization: Bearer <token>' \
+       --header 'X-HTTP-Method-Override: POST' \
+       --url https://test.api.amadeus.com/v2/shopping/flight-offers/prediction --data @-
+
+

The prediction API returns the same content as the Low Fare search with the +addition of the choiceProbability field for each flight offer element.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
 {
+  "data": [
+    {
+      "choiceProbability": "0.9437563627430908",
+      "id": "1558602440311-352021104",
+      "offerItems": [...],
+      "type": "flight-offer"
+    },
+    {
+      "choiceProbability": "0.0562028823257711",
+      "id": "1558602440311--1831925786",
+      "offerItems": [...],
+      "type": "flight-offer"
+    },
+    {
+      "choiceProbability": "0.0000252425060482",
+      "id": "1558602440311-480701674",
+      "offerItems": [...],
+      "type": "flight-offer"
+    },
+    {
+      "choiceProbability": "0.0000155124250899",
+      "id": "1558602440311--966634676",
+      "offerItems": [...],
+      "type": "flight-offer"
+    }
+  ],
+  "dictionaries": {...}
+  },
+  "meta": {...}
+  }
+}
+
+

Search for flight offers for multiple cities

+

Many travelers take advantage of their international trips to visit several +destinations. Multi-city search is a functionality that lets you search for +consecutive one-way flights between multiple destinations in a single request. +The returned flights are packaged as a complete, bookable itinerary.

+

To perform multi-city searches, you must use the POST method of the Flight Offers Search API. The API lets you search for up to six origin and +destination city pairs.

+

In the following example, we’ll fly from Madrid to Paris, where we’ll spend a couple of +days, then fly to Munich for three days. Next, we’ll visit Amsterdam for two +days before finishing our journey with a return to Madrid. We'll use the +following IATA city codes: MAD > PAR > MUC > AMS > MAD

+

The request will look like this:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
curl https://test.api.amadeus.com/v2/shopping/flight-offers \
+-d '{ 
+  "originDestinations": [ 
+    { 
+      "id": "1", 
+      "originLocationCode": "MAD", 
+      "destinationLocationCode": "PAR", 
+      "departureDateTimeRange": { 
+        "date": "2022-10-03" 
+      } 
+    }, 
+    { 
+      "id": "2", 
+      "originLocationCode": "PAR", 
+      "destinationLocationCode": "MUC", 
+      "departureDateTimeRange": { 
+        "date": "2022-10-05" 
+      } 
+    }, 
+    { 
+      "id": "3", 
+      "originLocationCode": "MUC", 
+      "destinationLocationCode": "AMS", 
+      "departureDateTimeRange": { 
+        "date": "2022-10-08" 
+      } 
+    }, 
+    { 
+      "id": "4", 
+      "originLocationCode": "AMS", 
+      "destinationLocationCode": "MAD", 
+      "departureDateTimeRange": { 
+        "date": "2022-10-11" 
+      } 
+    } 
+  ], 
+  "travelers": [ 
+    { 
+      "id": "1", 
+      "travelerType": "ADULT", 
+      "fareOptions": [ 
+        "STANDARD" 
+      ] 
+    } 
+  ], 
+  "sources": [ 
+    "GDS" 
+  ], 
+  "searchCriteria": { 
+    "maxFlightOffers": 1 
+  } 
+}' 
+
+

Search using loyalty programs

+

The Flight Offers Price API and the Seatmap Display API both accept Frequent Flyer information so end-users can benefit from their loyalty program. When adding Frequent Flyer information, please remember that each airline policy is different, and some require additional information, such as passenger name, email or phone number to validate the account. If the validation fails, your user won’t receive their loyalty program advantages.

+

Search for routes from a specific airport

+

The Airport Routes API shows all destinations from a given airport. To follow up on our previous example, let's check where we can fly to from Madrid (MAD). The options are obviously quite broad, so we can limit the maximum number of results to 10. Keep in mind that this limit will apply from the beginning of the results list in the alphabetical order of the airport IATA codes.

+

The request will look like this:

+
1
+2
+3
curl --request GET \
+     --header 'Authorization: Bearer <token>' \
+     --url https://test.api.amadeus.com/v1/airport/direct-destinations?departureAirportCode=MAD&max=10 \
+
+

So we can see the the following results:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
{
+  "meta": {
+    "count": 10,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/airport/direct-destinations?departureAirportCode=MAD&max=10"
+    }
+  },
+  "data": [
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ALBACETE",
+      "iataCode": "ABC"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "LANZAROTE",
+      "iataCode": "ACE"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "MALAGA",
+      "iataCode": "AGP"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ALGHERO",
+      "iataCode": "AHO"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ALICANTE",
+      "iataCode": "ALC"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ALGIERS",
+      "iataCode": "ALG"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "AMMAN",
+      "iataCode": "AMM"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "AMSTERDAM",
+      "iataCode": "AMS"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ASUNCION",
+      "iataCode": "ASU"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "ATHENS",
+      "iataCode": "ATH"
+    }
+  ]
+}
+
+

Search for routes for a specific airline

+

The Airline Routes API shows all destinations for a given airline. To follow up on our previous example, let's check what destinations the British Airways fly to. There's definitely plenty of options, so we can limit the maximum number of results to two for the sake of simplicity. Keep in mind that this limit will apply from the beginning of the results list in the alphabetical order of the city names.

+

The request will look like this:

+
1
+2
+3
curl --request GET \
+     --header 'Authorization: Bearer <token>' \
+     --url https://test.api.amadeus.com/v1/airline/destinations?airlineCode=BA&max=2 \
+
+

So we can see the the following results:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
{
+  "data": [
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "Bangalore",
+      "iataCode": "BLR"
+    },
+    {
+      "type": "location",
+      "subtype": "city",
+      "name": "Paris",
+      "iataCode": "PAR"
+    }
+  ],
+  "meta": {
+    "count": "2",
+    "sort": "iataCode",
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/airline/destinations?airlineCode=BA&max=2"
+    }
+  }
+}
+
+

Look up the airline ICAO code by the IATA code

+

If we need to know the IATA code for a particular airline but only have the airline's ICAO code, the Airline Code Lookup API can help us out. Just specify the IATA code in the query and send out the request:

+
1
+2
+3
curl --request GET \
+     --header 'Authorization: Bearer <token>' \
+     --url https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA \
+
+

The response is pretty straightforward:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
{
+  "meta": {
+    "count": 1,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA"
+    }
+  },
+  "data": [
+    {
+      "type": "airline",
+      "iataCode": "BA",
+      "icaoCode": "BAW",
+      "businessName": "BRITISH AIRWAYS",
+      "commonName": "BRITISH A/W"
+    }
+  ]
+}
+
+

Search for flight and fare availability

+

With the Flight Availabilities Search API you can check the flight and fare availability for any itinerary. This refers to the full inventory of fares available for an itinerary at any given time. The concept of flight availability originated in the early days of flight booking as a way for agents to check what options existed for their travelers’ itineraries.

+

You can build the request by passing into the body of the POST request an object that you can customise to your needs. An example of such object is provided in the specification of the Flight Availabilities Search API. In addition to this, a X-HTTP-Method-Override header parameter is required.

+

Here’s an example request for a one-way flight from Mad (MIA) to Atlanta (ATL) for one traveler departing on December 12, 2021:

+

POST https://test.api.amadeus.com/v1/shopping/availability/flight-availabilities

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
{
+    "originDestinations": [
+        {
+            "id": "1",
+            "originLocationCode": "MIA",
+            "destinationLocationCode": "ATL",
+            "departureDateTime": {
+                "date": "2021-11-01"
+            }
+        }
+    ],
+    "travelers": [
+        {
+            "id": "1",
+            "travelerType": "ADULT"
+        }
+    ],
+    "sources": [
+        "GDS"
+    ]
+}
+
+

The response contains a list of available flights matching our request criteria (for the sake of this example, we only show the first result). Each flight availability includes descriptive data about the flight and an availabilityClasses list containing the available fare classes and the number of bookable seats remaining in each fare class.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
"data": [
+        {
+            "type": "flight-availability",
+            "id": "1",
+            "originDestinationId": "1",
+            "source": "GDS",
+            "instantTicketingRequired": false,
+            "paymentCardRequired": false,
+            "duration": "PT1H54M",
+            "segments": [
+                {
+                    "id": "1",
+                    "numberOfStops": 0,
+                    "blacklistedInEU": false,
+                    "departure": {
+                        "iataCode": "MIA",
+                        "at": "2021-11-01T05:30:00"
+                    },
+                    "arrival": {
+                        "iataCode": "ATL",
+                        "terminal": "S",
+                        "at": "2022-11-01T07:24:00"
+                    },
+                    "carrierCode": "DL",
+                    "number": "2307",
+                    "aircraft": {
+                        "code": "321"
+                    },
+                    "operating": {},
+                    "availabilityClasses": [
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "J"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "C"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "D"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "I"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "Z"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "W"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "Y"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "B"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "M"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "H"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "Q"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "K"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "L"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "U"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "T"
+                        },
+                        {
+                            "numberOfBookableSeats": 9,
+                            "class": "E"
+                        }
+                    ]
+                }
+            ]
+        },
+
+

Note that airlines’ bookable seat counters goe up to a maximum of 9, even if more seats are available in that fare class. If there are less than 9 bookable seats available, the exact number is displayed.

+

Search branded fares

+

Branded fares are airfares that bundle tickets with extras, such as checked bags, seat selection, refundability or loyalty points accrual. Each airline defines and packages its own branded fares and they vary from one airline to another. Branded fares not only help build brand recognition and loyalty, but also offer travelers an attractive deal as the incremental cost of the fare is usually less than that of buying the included services à la carte.

+

The Branded Fares Upsell API receives flight offers from the Flight Offers Search API and returns branded fares as flight offers which can be easily passed to the next step in the booking funnel. The booking flow is the following:

+ +

Let's see an example of how to search for branded fares.

+

You can build the request by passing the flight-offer object from the Flight Offers Search API into the body of the POST request including the mandatory X-HTTP-Method-Override header parameter:

+
POST https://test.api.amadeus.com/v1/shopping/flight-offers/upselling
+
+

Please not that the X-HTTP-Method-Override header parameter is required to make this call.

+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
{ 
+  "data": { 
+    "type": "flight-offers-upselling", 
+    "flightOffers": [ 
+      {
+            "type": "flight-offer",
+            "id": "1",
+            "source": "GDS",
+            "instantTicketingRequired": false,
+            "nonHomogeneous": false,
+            "oneWay": false,
+            "lastTicketingDate": "2022-06-12",
+            "numberOfBookableSeats": 3,
+            "itineraries": [
+                {
+                    "duration": "PT6H10M",
+                    "segments": [
+                        {
+                            "departure": {
+                                "iataCode": "MAD",
+                                "terminal": "1",
+                                "at": "2022-06-22T17:40:00"
+                            },
+                            "arrival": {
+                                "iataCode": "FCO",
+                                "terminal": "1",
+                                "at": "2022-06-22T20:05:00"
+                            },
+                            "carrierCode": "AZ",
+                            "number": "63",
+                            "aircraft": {
+                                "code": "32S"
+                            },
+                            "operating": {
+                                "carrierCode": "AZ"
+                            },
+                            "duration": "PT2H25M",
+                            "id": "13",
+                            "numberOfStops": 0,
+                            "blacklistedInEU": false
+                        },
+                        {
+                            "departure": {
+                                "iataCode": "FCO",
+                                "terminal": "1",
+                                "at": "2022-06-22T21:50:00"
+                            },
+                            "arrival": {
+                                "iataCode": "ATH",
+                                "at": "2022-06-23T00:50:00"
+                            },
+                            "carrierCode": "AZ",
+                            "number": "722",
+                            "aircraft": {
+                                "code": "32S"
+                            },
+                            "operating": {
+                                "carrierCode": "AZ"
+                            },
+                            "duration": "PT2H",
+                            "id": "14",
+                            "numberOfStops": 0,
+                            "blacklistedInEU": false
+                        }
+                    ]
+                }
+            ],
+            "price": {
+                "currency": "EUR",
+                "total": "81.95",
+                "base": "18.00",
+                "fees": [
+                    {
+                        "amount": "0.00",
+                        "type": "SUPPLIER"
+                    },
+                    {
+                        "amount": "0.00",
+                        "type": "TICKETING"
+                    }
+                ],
+                "grandTotal": "81.95",
+                "additionalServices": [
+                    {
+                        "amount": "45.00",
+                        "type": "CHECKED_BAGS"
+                    }
+                ]
+            },
+            "pricingOptions": {
+                "fareType": [
+                    "PUBLISHED"
+                ],
+                "includedCheckedBagsOnly": false
+            },
+            "validatingAirlineCodes": [
+                "AZ"
+            ],
+            "travelerPricings": [
+                {
+                    "travelerId": "1",
+                    "fareOption": "STANDARD",
+                    "travelerType": "ADULT",
+                    "price": {
+                        "currency": "EUR",
+                        "total": "81.95",
+                        "base": "18.00"
+                    },
+                    "fareDetailsBySegment": [
+                        {
+                            "segmentId": "13",
+                            "cabin": "ECONOMY",
+                            "fareBasis": "OOLGEU1",
+                            "class": "O",
+                            "includedCheckedBags": {
+                                "quantity": 0
+                            }
+                        },
+                        {
+                            "segmentId": "14",
+                            "cabin": "ECONOMY",
+                            "fareBasis": "OOLGEU1",
+                            "brandedFare": "ECOLIGHT",
+                            "class": "O",
+                            "includedCheckedBags": {
+                                "quantity": 0
+                            }
+                        }
+                    ]
+                }
+            ]
+        } 
+    ]
+  } 
+}  
+
+

The API will procide the following JSON in the response:

+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
{
+    "meta": {
+        "count": 5
+    },
+    "data": [{
+                "type": "flight-offer",
+                "id": "2",
+                "source": "GDS",
+                "instantTicketingRequired": false,
+                "paymentCardRequired": false,
+                "lastTicketingDate": "2022-11-30",
+                "itineraries": [{
+                    "segments": [{
+                        "departure": {
+                            "iataCode": "MAD",
+                            "terminal": "2",
+                            "at": "2022-12-01T07:10:00"
+                        },
+                        "arrival": {
+                            "iataCode": "ORY",
+                            "at": "2022-12-01T09:05:00"
+                        },
+                        "carrierCode": "UX",
+                        "number": "1027",
+                        "aircraft": {
+                            "code": "333"
+                        },
+                        "operating": {
+                            "carrierCode": "UX"
+                        },
+                        "duration": "PT1H55M",
+                        "id": "7",
+                        "numberOfStops": 0,
+                        "blacklistedInEU": false
+                    }]
+                }],
+                "price": {
+                    "currency": "EUR",
+                    "total": "228.38",
+                    "base": "210.00",
+                    "fees": [{
+                        "amount": "0.00",
+                        "type": "TICKETING"
+                    }],
+                    "grandTotal": "228.38"
+                },
+                "pricingOptions": {
+                    "fareType": [
+                        "PUBLISHED"
+                    ],
+                    "includedCheckedBagsOnly": false,
+                    "refundableFare": false,
+                    "noRestrictionFare": false,
+                    "noPenaltyFare": false
+                },
+                "validatingAirlineCodes": [
+                    "UX"
+                ],
+                "travelerPricings": [{
+                            "travelerId": "1",
+                            "fareOption": "STANDARD",
+                            "travelerType": "ADULT",
+                            "price": {
+                                "currency": "EUR",
+                                "total": "228.38",
+                                "base": "210.00",
+                                "taxes": [{
+                                        "amount": "3.27",
+                                        "code": "QV"
+                                    },
+                                    {
+                                        "amount": "0.63",
+                                        "code": "OG"
+                                    },
+                                    {
+                                        "amount": "14.48",
+                                        "code": "JD"
+                                    }
+                                ]
+                            },
+                            "fareDetailsBySegment": [{
+                                "segmentId": "7",
+                                "cabin": "ECONOMY",
+                                "fareBasis": "KYYO5L",
+                                "brandedFare": "LITE",
+                                "class": "K",
+                                "includedCheckedBags": {
+                                    "quantity": 0
+                                },
+                                "amenities": [{
+                                        "code": "0L5",
+                                        "description": "CARRY ON HAND BAGGAGE",
+                                        "isChargeable": false,
+                                        "amenityType": "BAGGAGE"
+                                    },
+                                    {
+                                        "code": "0CC",
+                                        "description": "FIRST PREPAID BAG",
+                                        "isChargeable": true,
+                                        "amenityType": "BAGGAGE"
+                                    },
+                                    {
+                                        "code": "0GO",
+                                        "description": "PREPAID BAG",
+                                        "isChargeable": true,
+                                        "amenityType": "BAGGAGE"
+                                    },
+                                    {
+                                        "code": "059",
+                                        "description": "CHANGEABLE TICKET",
+                                        "isChargeable": true,
+                                        "amenityType": "BRANDED_FARES"
+                                    },
+                                    {
+                                        "code": "0B5",
+                                        "description": "PRE RESERVED SEAT ASSIGNMENT",
+                                        "isChargeable": true,
+                                        "amenityType": "PRE_RESERVED_SEAT"
+                                    },
+                                    {
+                                        "code": "0G6",
+                                        "description": "PRIORITY BOARDING",
+                                        "isChargeable": true,
+                                        "amenityType": "TRAVEL_SERVICES"
+                                    }
+                                ]
+                            }],
+                            "dictionaries": {
+                                "locations": {
+                                    "MAD": {
+                                        "cityCode": "MAD",
+                                        "countryCode": "ES"
+                                    },
+                                    "ORY": {
+                                        "cityCode": "PAR",
+                                        "countryCode": "FR"
+                                    }
+                                }
+                            }
+                        }
+
+

You can also see the process step to step How to upsell with branded fares in this video tutorial from Advanced flight booking engine series.

+

+

Search for personalized destination recommendations

+

The Travel Recommendations API provides personalized destinations based on the traveler's location and an input destination, such as a previously searched flight destination or city of interest.

+

For example, for a traveler based in San Francisco who has searched for multiple flights to Barcelona, what other similar destinations the API could recommend? The API takes as input the country of the traveler and the IATA code of the city that was searched, in our case this will be US and BCN respectively.

+

GET https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=BCN&travelerCountryCode=US

+

The response will look like this:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
{
+     "type": "flight-date",
+     "origin": "SFO",
+     "destination": "ROM",
+     "departureDate": "2021-09-19",
+     "returnDate": "2021-09-23",
+     "price": {
+         "total": "348.75"
+     },
+     "links": {
+         "flightDestinations": "https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=SFO&departureDate=2021-04-15,2021-10-11&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION",
+         "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=SFO&destinationLocationCode=ROM&departureDate=2021-09-19&returnDate=2021-09-23&adults=1&nonStop=false"
+     }
+ }
+
+

The only required parameter for the Travel Recommendations API is the city code. So, the API is capable of suggesting flight based on that input alone:

+
https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=PAR
+
+

You can also narrow the query down by using the destinationCountryCodes parameter, which supports one or more IATA country codes, separated by a comma:

+
https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=PAR&destinationCountryCodes=US
+
+

To expand the example of the San Francisco-based traveler searching for multiple flights to Barcelona, we can specify the destination country as well:

+
https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=BCN&travelerCountryCode=US&destinationCountryCodes=ES
+
+

If you want to take it to the next level, you can call the Flight Cheapest Date Search API to let the users know not only the recommended destinations but also what are the cheapest dates to visit any of these cities. For real-time flights, you can also call the Flight Offers Search API. The Travel Recommendations API has returned links to both APIs.

+ +

With the Airport Nearest Relevant API you can find the closest major airports to a starting point. By default, results are sorted by relevance but they can also be sorted by distance, flights, travelers using the parameter sort.

+
+

Information

+

To get the latitude and longitude of a city you can use the Airport & City Search API using the city's IATA code.

+
+

Let's call the Airport Nearest Relevant API to find airports within the 500km radius of Madrid.

+

GET https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=40.416775&longitude=-3.703790&radius=500

+

A part of the response looks like:

+

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
        {
+            "type": "location",
+            "subType": "AIRPORT",
+            "name": "AIRPORT",
+            "detailedName": "BARCELONA/ES:AIRPORT",
+            "timeZoneOffset": "+02:00",
+            "iataCode": "BCN",
+            "geoCode": {
+                "latitude": 41.29694,
+                "longitude": 2.07833
+            },
+            "address": {
+                "cityName": "BARCELONA",
+                "cityCode": "BCN",
+                "countryName": "SPAIN",
+                "countryCode": "ES",
+                "regionCode": "EUROP"
+            },
+            "distance": {
+                "value": 496,
+                "unit": "KM"
+            },
+            "analytics": {
+                "flights": {
+                    "score": 25
+                },
+                "travelers": {
+                    "score": 25
+                }
+            },
+            "relevance": 5.11921
+        }
+
+What we want to do at this point, is to find the cheapest dates for all these destinations.

+

We can do this by calling the Flight Cheapest Date Search API which finds the cheapest dates to travel from one city to another. Let's see, for example, the cheapest dates to fly to Barcelona in November 2021.

+

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=BCN&departureDate=2021-05-01,2021-05-30

+

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
{
+    "type": "flight-date",
+    "origin": "MAD",
+    "destination": "BCN",
+    "departureDate": "2021-05-29",
+    "returnDate": "2021-06-11",
+    "price": {
+        "total": "73.61"
+    },
+    "links": {
+        "flightDestinations": "https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION",
+        "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2022-09-29&returnDate=2021-06-11&adults=1&nonStop=false"
+    },
+{
+    "type": "flight-date",
+    "origin": "MAD",
+    "destination": "BCN",
+    "departureDate": "2021-05-05",
+    "returnDate": "2021-05-06",
+    "price": {
+        "total": "79.67"
+    },
+    "links": {
+        "flightDestinations": "https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION",
+        "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-05&returnDate=2021-05-06&adults=1&nonStop=false"
+    }
+},
+{
+    "type": "flight-date",
+    "origin": "MAD",
+    "destination": "BCN",
+    "departureDate": "2021-05-02",
+    "returnDate": "2021-05-06",
+    "price": {
+        "total": "80.61"
+    },
+    "links": {
+        "flightDestinations": "https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION",
+        "flightOffers": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-02&returnDate=2021-05-06&adults=1&nonStop=false"
+    }
+}
+
+As you can see above, in the results we have a list of dates for a roundtrip from Madrid to Barcelona ordered by the lowest price.

+

In the last step, we want to let the traveler perform a flight search for any of the above dates that are convenient for them. That is very easy with our APIs, as the Flight Cheapest Date Search API for each result contains a link to the Flight Offers Search API. For example, if we want to perform a flight search for the first result, we only have to take the link provided and make an API call:

+

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-29&returnDate=2021-06-11&adults=1&nonStop=false

+

Search for a city that has an airport

+

The Airport & City Search API finds airports and cities that match a specific word or a string of letters. Using this API, you can automatically suggest +airports based on what the traveler enters in the search field. The API provides a list of airports/cities ordered by yearly passenger volume with the name, 3-letter IATA code, time zone and coordinates of each airport.

+
+

Information

+

Please keep in mind that Airport & City Search API only returns the cities which have an airport. +If you want to retrieve any city that matches a search keyword, check out City Search API.

+
+

The Airport & City Search API has two endpoints:

+

You can see the process step to step in this video tutorial.

+

+
    +
  • GET ​/reference-data​/locations to return a list of airports and cities by a keyword
  • +
  • GET ​/reference-data​/locations//reference-data/locations/{locationId} to return an airport or city by Id
  • +
+

To get a list of airports and cities by a keyword, we need to two mandatory query parameters:

+
    +
  • subType - this defines whether we are looking for an airport or a city
  • +
  • keyword - this defines the keyword (or a part of it) used in our search, which can be any character in the range of A-Za-z0-9./:-'()"
  • +
+

Here is a basic query to look for any airport whose name starts with a letter M:

+
https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M
+
+

To narrow the search down, we can use an optional parameter countryCode, which is a location code in the ISO 3166-1 alpha-2 format:

+
https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US
+
+

The Airport & City Search API supports pagination and dynamic sorting. The dynamic sorting enables you to sort by the results by the number of travelers by airport or city where the airports and cities with the highest traffic will be on top of the list:

+
https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US&sort=analytics.travelers.score
+
+

In addition to that, we can select how detailed the response will be. This is done by the optional view parameter, which can be:

+
    +
  • LIGHT - to only show the iataCode, name, detailedName, cityName and countryName
  • +
  • FULL - to add on top of the LIGHT information the timeZoneOffset, geoCode, detailed address and travelers.score
  • +
+

The default option is FULL:

+
https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US&sort=analytics.travelers.score&view=FULL
+
+

To search an airport or city by Id, we need to obtain the Id by using the GET ​/reference-data​/locations endpoint. For example:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
{
+  "meta": {
+    "count": 2,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/reference-data/locations?subType=CITY,AIRPORT&keyword=MUC&countryCode=DE"
+    }
+  },
+  "data": [
+    {
+      "type": "location",
+      "subType": "CITY",
+      "name": "MUNICH INTERNATIONAL",
+      "detailedName": "MUNICH/DE:MUNICH INTERNATIONAL",
+      "id": "CMUC",
+      "self": {
+        "href": "https://test.api.amadeus.com/v1/reference-data/locations/CMUC",
+        "methods": [
+          "GET"
+        ]
+      },
+      "timeZoneOffset": "+02:00",
+      "iataCode": "MUC",
+      "geoCode": {
+        "latitude": 48.35378,
+        "longitude": 11.78609
+      },
+      "address": {
+        "cityName": "MUNICH",
+        "cityCode": "MUC",
+        "countryName": "GERMANY",
+        "countryCode": "DE",
+        "regionCode": "EUROP"
+      },
+      "analytics": {
+        "travelers": {
+          "score": 27
+        }
+      }
+    },
+    {
+      "type": "location",
+      "subType": "AIRPORT",
+      "name": "MUNICH INTERNATIONAL",
+      "detailedName": "MUNICH/DE:MUNICH INTERNATIONAL",
+      "id": "AMUC",
+      "self": {
+        "href": "https://test.api.amadeus.com/v1/reference-data/locations/AMUC",
+        "methods": [
+          "GET"
+        ]
+      },
+      "timeZoneOffset": "+02:00",
+      "iataCode": "MUC",
+      "geoCode": {
+        "latitude": 48.35378,
+        "longitude": 11.78609
+      },
+      "address": {
+        "cityName": "MUNICH",
+        "cityCode": "MUC",
+        "countryName": "GERMANY",
+        "countryCode": "DE",
+        "regionCode": "EUROP"
+      },
+      "analytics": {
+        "travelers": {
+          "score": 27
+        }
+      }
+    }
+  ]
+}
+
+

The Id for the city of Munich is CMUC. However, for the Munich Airport the Id will be AMUC. Once we know this Id, we can use it to call the GET ​/reference-data​/locations//reference-data/locations/{locationId}, as it is the only parameter that the query requires:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/CMUC
+
+

Compare the flight price to historical fares

+

When booking a flight, travelers need to be confident that they're getting a good deal. You can compare a flight price to historical fares for the same flight route using the Flight Price Analysis API. It uses an Artificial Intelligence algorithm trained on Amadeus historical flight booking data to show how current flight prices compare to historical fares and whether the price of a flight is below or above average.

+

The only mandatory parameters for this search are the origin airport IATA code, destination airport IATA code and the departure date in the ISO 8601 YYYY-MM-DD format.

+

Let's see how it works. In our example we will be flying from Madrid (MAD) to Paris (CDG) on 12 December 2022:

+
https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2022-12-12
+
+

This is what we get in the response:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
{
+  "warnings": [],
+  "data": [
+    {
+      "type": "itinerary-price-metric",
+      "origin": {
+        "iataCode": "MAD"
+      },
+      "destination": {
+        "iataCode": "CDG"
+      },
+      "departureDate": "2022-12-12",
+      "transportType": "FLIGHT",
+      "currencyCode": "EUR",
+      "oneWay": true,
+      "priceMetrics": [
+        {
+          "amount": "29.59",
+          "quartileRanking": "MINIMUM"
+        },
+        {
+          "amount": "76.17",
+          "quartileRanking": "FIRST"
+        },
+        {
+          "amount": "129.24",
+          "quartileRanking": "MEDIUM"
+        },
+        {
+          "amount": "185.59",
+          "quartileRanking": "THIRD"
+        },
+        {
+          "amount": "198.15",
+          "quartileRanking": "MAXIMUM"
+        }
+      ]
+    }
+  ],
+  "meta": {
+    "count": 1,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/analytics/flight-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2022-12-12&currencyCode=EUR&oneWay=True"
+    }
+  }
+}
+
+

By default the price will be shown in Euros. In this example we can see that the lowest price for such ticket should be 29.59 Euros and the highest 198.15 Euros. The first, medium and trird choices give you an idea about the possible price ranges for this flight.

+

We also have an option to request the result in a different currency. This is done by using the currencyCode parameter, which is an ISO 4217 format currency code. In addition, we can specify whether we are inquiring about a round trip or a one way ticket.

+
GET https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2021-03-21&currencyCode=EUR&oneWay=true
+
+

Confirm Fares

+

The availability and price of airfare fluctuate, so it’s important to confirm +before proceeding to book. This is especially true if time passes between the +initial search and the decision to book, as fares are limited and there are +thousands of bookings occurring every minute. During this step, you can also +add ancillary products like extra bags or legroom. For that you can use the Flight Offers Price API.

+

Once a flight has been selected, you’ll need to confirm the availability and +price of the fare. This is where the Flight Offers Price API comes in. This API +returns the final fare price (including taxes and fees) of flights from the +Flight Offers Search as well as pricing for ancillary products and the +payment information that will be needed to make the final booking.

+

The body to be sent via POST is built by a new object of type +flight-offers-pricing composed by a list of flight-offers (up to 6) + +payment information. In addition to this, a X-HTTP-Method-Override header parameter is required.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
{
+   "data": {
+        "type": "flight-offers-princing",
+        "flightOffers": [
+            { "type": "flight-offer" }
+        ],
+        "payment" : [
+            { Payment_Object }
+        ]
+    }
+
+

Return fare rules

+

The Flight Offers Price API confirms the final price and availability of a fare. It also returns detailed fare rules, including the cancellation policy and other information. In addition to this, a X-HTTP-Method-Override header parameter is required. To get the fare rules, add the parameter include=detailed-fare-rules to your API call, as shown below:

+
POST https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules
+
+

The FareRules object represents a collection of fare rules and penalties associated with a specific fare. Each rule is represented as a TermAndCondition object, containing information about the rule category, circumstances, applicability, maximum penalty amount, and detailed descriptions.

+
    +
  • +

    FareRules:

    +
      +
    • currency: The currency in which the penalties are expressed.
    • +
    • rules: An array of TermAndCondition objects, each representing a specific fare rule or condition.
    • +
    +
  • +
  • +

    TermAndCondition:

    +
      +
    • category: A string defining the type of modification concerned in the rule, such as REFUND, EXCHANGE, REVALIDATION, REISSUE, REBOOK, or CANCELLATION.
    • +
    • circumstances: A string providing additional information on the circumstances under which the rule applies.
    • +
    • notApplicable: A boolean indicating if the rule does not apply to the fare.
    • +
    • maxPenaltyAmount: A string representing the maximum penalty amount for the given rule.
    • +
    • descriptions: An array of Description objects that provide further details on the rule. Each Description object includes:
        +
      • descriptionType: A string representing the type of description.
      • +
      • text: The actual text of the description, providing more context or explanation for the rule.
      • +
      +
    • +
    +
  • +
+

You can also see the process step to step How to display farerules in this video tutorial from Advanced flight booking engine series.

+

+

Book a Flight

+

Once the fare is confirmed, you’re ready to use the Flight Create Orders API +to perform the actual booking. This API lets you log a reservation in the +airlines’ systems and create a PNR, and returns a unique Id number and the +reservation details. If you’re using an airline consolidator, the PNR will be +automatically sent to the consolidator for ticket issuance. Visit the Flight +Create Orders documentation +page +for more details on this API.

+

Remember, you need to be able to issue a ticket to make bookings with our +Flight Create Orders API. To access the API in production, you need to either +sign a contract with an airline consolidator or be accredited to issue tickets +yourself.

+

Issue a ticket

+

Once the booking is made, you need to complete payment. In most cases, you’ll +receive payment from the customer and then pay the airline, typically via an +industry-specific settlement procedure like the BSP or ARC (more on those +later).

+

In the final step, a flight ticket is issued. In industry terms, a flight +ticket is a confirmation that payment has been received, the reservation has +been logged, and the customer has the right to enjoy the flight. For IATA +member airlines, +only certain accredited parties can issue tickets. In the next section, we’ll +go into detail about your options for managing this final step in the booking +process.

+

You can see How to manage and issue flight booking process in this video tutorial from Flight Booking Engine 101 series.

+

+

If you are interested in knowing more about issuing tickets in travel industry, please check out this article.

+

View the aircraft cabin layout

+

With the Seatmap Display API you can view the aircraft cabin layout:

+
    +
  • deckConfiguration - the dimensions of the passenger deck in (x,y) coordinates, including the location of the wings, exit rows, and cabins. These dimensions form a grid on which you will later place facilities and seats.
  • +
  • facilities - the (x,y) coordinates of aircraft facilities, such as bathrooms or galleys.
  • +
  • seats - the (x,y) coordinates of all seats on the aircraft, with their respective availability status, characteristics, and prices.
  • +
+

To help you build a more consistent display, the API returns a uniform width for all cabins and classes. Rows with special seating like business class or extra-legroom seats have fewer seats per row (e.g., 4 seats for width of 7 coordinates) than economy rows (e.g. 7 seats for a width of 7 coordinates).

+

You can see the more details about the aircraft cabin layout in the video below.

+

+

Display in-flight amenities

+

Both endpoints of the Seatmap Display API return information about the following in-flight amenities:

+
    +
  • Seat
  • +
  • Wi-fi
  • +
  • Entertainment
  • +
  • Power
  • +
  • Food
  • +
  • Beverage
  • +
+

Select a seat

+

Requests to either endpoint of the Seatmap Display API will return a list of seating options with their characteristics, pricing, and coordinates. Let's look at an example response:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
{
+                "cabin": "M",
+                "number": "20D",
+                "characteristicsCodes": [
+                  "A",
+                  "CH",
+                  "RS"
+                ],
+                "travelerPricing": [
+                  {
+                    "travelerId": "1",
+                    "seatAvailabilityStatus": "AVAILABLE",
+                    "price": {
+                      "currency": "EUR",
+                      "total": "17.00",
+                      "base": "17.00",
+                      "taxes": [
+                        {
+                          "amount": "0.00",
+                          "code": "SUPPLIER"
+                        }
+                      ]
+                    }
+                  }
+                ],
+                "coordinates": {
+                  "x": 10,
+                  "y": 4
+                }
+              },
+
+

For each seat, the Seatmap Display API provides a seatAvailabilityStatus so you can indicate which seats are currently available for booking. Seats may have one of three availability statuses:

+
    +
  • AVAILABLE – the seat is not occupied and is available to book.
  • +
  • BLOCKED – the seat is not occupied but isn’t available to book for the user. This is usually due to the passenger type (e.g., children may not sit in exit rows) or their fare class (e.g., some seats may be reserved for flyers in higher classes).
  • +
  • OCCUPIED – the seat is  occupied and unavailable to book.
  • +
+

If a flight is fully booked, the API returns an OCCUPIED status for all seats. In most cases, fully booked flights are filtered out during search with the Flight Offers Search API or when confirming the price with the Flight Offers Price API. The Flight Create Orders API returns an error message if you try to book an unavailable seat. For more information on the booking flow, check out how to build a flight booking engine.

+

Once your user has selected their seat, the next step is to add the desired seat to the flight offer and prepare them for booking.

+

In the above example response, seat 20D is indicated as AVAILABLE. For your user to be able to book the seat, you must add the seat to the flightOffer object and call Flight Offers Price to get a final order summary with the included seat.

+

To include the seat in the flightOffer object, add it to fareDetailsBySegmentadditionalServiceschargeableSeatNumber, as shown below:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
"fareDetailsBySegment": [
+            {
+            "additionalServices": {
+             "chargeableSeatNumber": "20D"
+              },
+              "segmentId": "60",
+              "cabin": "ECONOMY",
+              "fareBasis": "NLYO5L",
+              "brandedFare": "LITE",
+              "class": "N",
+              "includedCheckedBags": {
+                "quantity": 0
+              }
+            }
+          ]
+
+

The Flight Offers Price API then returns the flightOffer object with the price of the chosen seat included within additionalServices:

+
1
+2
+3
+4
+5
"additionalServices":
+            {
+              "type": "SEATS",
+              "amount": "17.00"
+            }
+
+

You can use the same process to select seats for multiple passengers. For each passenger, you must add the selected seats in fareDetailsBySegment for each travelerId within the flight offer.

+

At this point, you now have a priced flightOffer which includes your user's selected seat. The final step is to book the flight using the Flight Create Orders API. To do this, simply pass the flightOffer object into a request to the Flight Create Orders API, which will book the flight and return an order summary and a booking Id.

+

Add additional baggage

+

Search additional baggage options

+

The first step is to find the desired flight offer using the Flight Offers Search API. Each flight offer contains an additionalServices field with the types of additional services available, in this case bags, and the maximum price of the first additional bag. Note that at this point, the price is for informational purposes only.

+

To get the final price of the added baggage with the airline policy and the traveler's tier level taken into account, you must call the Flight Offers Price API. To do this, add the include=bags parameter in the path of the Flight Offers Price API:

+
POST https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=bags 
+
+

As you see below, the API returns the catalog of baggage options with the price and quantity (or weight):

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
"bags": { 
+    "1": { 
+        "quantity": 1, 
+        "name": "CHECKED_BAG", 
+        "price": { 
+            "amount": "25.00", 
+            "currencyCode": "EUR" 
+        }, 
+        "bookableByItinerary": true, 
+        "segmentIds": [ 
+            "1", 
+            "14" 
+        ], 
+        "travelerIds": [ 
+            "1" 
+        ] 
+    } 
+    "2": {  
+        "quantity": 2, 
+        "name": "CHECKED_BAG", 
+        "price": { 
+            "amount": "50.00", 
+            "currencyCode": "EUR" 
+        }, 
+        "bookableByItinerary": true, 
+        "segmentIds": [ 
+            "1", 
+            "14" 
+        ], 
+        "travelerIds": [ 
+            "1" 
+        ] 
+    } 
+} 
+
+

The Flight Offers Price API returns two bag offers for the given flight. The catalog shows that either one or two bags are available to be booked per passenger. Higher bag quantity will be rejected due to the airline's policy.

+

In the example above, the price of two bags is double that of one bag, though some airlines do offer discounts for purchasing more than one checked bag. Each bag offer is coupled to the specific segment and traveler Id returned in each bag offer.

+

If there is no extra baggage service available, the API won’t return a baggage catalog.

+

Add additional baggage to the flight offer

+

Next, you need to add the additional baggage to the desired flight segments. This gives you the flexibility to include extra bags on only certain segments of the flight.

+

Fill in chargeableCheckedBags with the desired quantity (or weight, depending on what the airline returns) in travelerPricings/fareDetailsBySegment/additionalServices, as shown below:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
"fareDetailsBySegment": [{ 
+    "segmentId": "1", 
+    "cabin": "ECONOMY", 
+    "fareBasis": "TNOBAGD", 
+    "brandedFare": "GOLIGHT", 
+    "class": "T", 
+    "includedCheckedBags": { 
+        "quantity": 0 
+    }, 
+    "additionalServices": { 
+        "chargeableCheckedBags": { 
+            "quantity": 1 
+        } 
+    } 
+}] 
+
+

Confirm the final price and book

+

Once you’ve added the desired bags to the flight order, you need to call the Flight Offers Price API to get the final price of the flight with all additional services included. Once this is done, you can then call the Flight Create Orders API to book the flight. If you want to add different numbers of bags for different itineraries, you can do it following the same flow.

+

If the desired flight you want to book, does not permit the additional service, the Flight Create Orders API will reject the booking and return the following error:

+

1
+2
+3
+4
+5
+6
+7
+8
{ 
+    "errors": [{ 
+        "status": 400, 
+        "code": 38034, 
+        "title": "ONE OR MORE SERVICES ARE NOT AVAILABLE", 
+        "detail": "Error booking additional services" 
+    }] 
+} 
+
+You can see the process step to step in this video tutorial.

+

+

Video Tutorial

+

You can also see the process step to step How to add additional baggages in this video tutorial from Advanced flight booking engine series.

+

+

Check the flight status

+

The On-Demand Flight Status API provides real-time flight schedule data including up-to-date departure and arrival times, terminal and gate information, flight duration and real-time delay status.

+

To get this information, the only mandatory parameters to send a query are the IATA carrier code, flight number and scheduled departure date, and you'll be up to date about your flight schedule. For example, checking the Iberia flight 532 on 23 March 2022:

+
https://test.api.amadeus.com/v2/schedule/flights?carrierCode=IB&flightNumber=532&scheduledDepartureDate=2022-03-23
+
+

If the flight changes and the carrier assigns a prefix to the flight number to indicate the change, you can specify it in the query using the additional one-letter operationalSuffix parameter:

+
https://test.api.amadeus.com/v2/schedule/flights?carrierCode=IB&flightNumber=532&scheduledDepartureDate=2021-03-23&operationalSuffix=A
+
+

The example response looks as follows:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
{
+  "meta": {
+    "count": 1,
+    "links": {
+      "self": "https://test.api.amadeus.com/v2/schedule/flights?carrierCode=AZ&flightNumber=319&scheduledDepartureDate=2021-03-13"
+    }
+  },
+  "data": [
+    {
+      "type": "DatedFlight",
+      "scheduledDepartureDate": "2021-03-13",
+      "flightDesignator": {
+        "carrierCode": "AZ",
+        "flightNumber": 319
+      },
+      "flightPoints": [
+        {
+          "iataCode": "CDG",
+          "departure": {
+            "timings": [
+              {
+                "qualifier": "STD",
+                "value": "2021-03-13T11:10+01:00"
+              }
+            ]
+          }
+        },
+        {
+          "iataCode": "FCO",
+          "arrival": {
+            "timings": [
+              {
+                "qualifier": "STA",
+                "value": "2021-03-13T13:15+01:00"
+              }
+            ]
+          }
+        }
+      ],
+      "segments": [
+        {
+          "boardPointIataCode": "CDG",
+          "offPointIataCode": "FCO",
+          "scheduledSegmentDuration": "PT2H5M"
+        }
+      ],
+      "legs": [
+        {
+          "boardPointIataCode": "CDG",
+          "offPointIataCode": "FCO",
+          "aircraftEquipment": {
+            "aircraftType": "32S"
+          },
+          "scheduledLegDuration": "PT2H5M"
+        }
+      ]
+    }
+  ]
+}
+
+

Check for any flight delays

+

For any traveller it's quite important to know how far in advance they should get to the airport. The Flight Delay Prediction API estimates the probability of a specific flight being delayed.

+

The query consists of ten mandatory parameters:

+
    +
  • originLocationCode - IATA code of the city or airport from which the traveler is departing, e.g. PAR for Paris
  • +
  • destinationLocationCode - IATA code of the city or airport to which the traveler is going, e.g. PAR for Paris
  • +
  • departureDate - the date on which the traveler will depart from the origin to go to the destination in the ISO 8601 YYYY-MM-DD format, e.g. 2019-12-25
  • +
  • departureTime - local time relative to originLocationCode on which the traveler will depart from the origin in the ISO 8601 format, e.g. 13:22:00
  • +
  • arrivalDate - the date on which the traveler will arrive to the destination from the origin in the ISO 8601 in the YYYY-MM-DD format, e.g. 2019-12-25
  • +
  • arrivalTime - local time relative to destinationLocationCode on which the traveler will arrive to destination in the ISO 8601 standard. e.g. 13:22:00
  • +
  • aircraftCode - IATA aircraft code
  • +
  • carrierCode - airline / carrier code, e.g. TK
  • +
  • flightNumber - flight number as assigned by the carrier, e.g. 1816
  • +
  • duration - flight duration in the ISO 8601 PnYnMnDTnHnMnS format, e.g. PT2H10M
  • +
+
GET https://test.api.amadeus.com/v1/travel/predictions/flight-delay?originLocationCode=NCE&destinationLocationCode=IST&departureDate=2020-08-01&departureTime=18%3A20%3A00&arrivalDate=2020-08-01&arrivalTime=22%3A15%3A00&aircraftCode=321&carrierCode=TK&flightNumber=1816&duration=PT31H10M
+
+

The response result will look as follows:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
{
+  "data": [
+    {
+      "id": "TK1816NCEIST20200801",
+      "probability": "0.13336977",
+      "result": "LESS_THAN_30_MINUTES",
+      "subType": "flight-delay",
+      "type": "prediction"
+    },
+    {
+      "id": "TK1816NCEIST20200801",
+      "probability": "0.42023364",
+      "result": "BETWEEN_30_AND_60_MINUTES",
+      "subType": "flight-delay",
+      "type": "prediction"
+    },
+    {
+      "id": "TK1816NCEIST20200801",
+      "probability": "0.34671372",
+      "result": "BETWEEN_60_AND_120_MINUTES",
+      "subType": "flight-delay",
+      "type": "prediction"
+    },
+    {
+      "id": "TK1816NCEIST20200801",
+      "probability": "0.09968289",
+      "result": "OVER_120_MINUTES_OR_CANCELLED",
+      "subType": "flight-delay",
+      "type": "prediction"
+    }
+  ],
+  "meta": {
+    "count": 4,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/travel/predictions/flight-delay?originLocationCode=NCE&destinationLocationCode=IST&departureDate=2020-08-01&departureTime=18:20:00&arrivalDate=2020-08-01&arrivalTime=22:15:00&aircraftCode=321&carrierCode=TK&flightNumber=1816&duration=PT31H10M"
+    }
+  }
+}
+
+

The main parameter of the dataset is the result, which contains a self-explanatory value, e.g. LESS_THAN_30_MINUTES, BETWEEN_30_AND_60_MINUTES, etc.

+

Check the on-time performance of an airport

+

Another way to get prepared for any delays, is checking the on-time performance of the actual airport. The Airport On-Time Performance API estimates the probability of a specific flight being delayed.

+

The search query is very simple. In our query we only need to provide our flight departure date and the departure airport. For example, JFK on 12 December 2022.

+
GET https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2022-12-12 
+
+

This is the result:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
{
+  "data": {
+    "id": "JFK20221212",
+    "probability": "0.928",
+    "result": "0.77541769",
+    "subType": "on-time",
+    "type": "prediction"
+  },
+  "meta": {
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2022-12-12"
+    }
+  }
+}
+
+

The probability parameter shows the probability of the airport running smoothly. In our example, this metric means that there is a 92.8% chance that there will be no delays.

+ +

Suppose we are building an app with an integrated check-in flow for a particular airline. In this case, we can leverage the Flight Check-in Links API to generate a link to the airline's official check-in page in a required language for both web and mobile platforms. The only parameter that we need to provide in our search query is the airline's IATA code. If required, we can request the links in a specific language, such as UK English (en-GB). This is what our request would look like:

+
1
+2
+3
curl --request GET \
+     --header 'Authorization: Bearer <token>' \
+     --url https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA&language=en-GB \
+
+

This is what we get in the response:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
{
+  "meta": {
+    "count": 3,
+    "links": {
+      "self": "https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA&language=EN-GB"
+    }
+  },
+  "data": [
+    {
+      "type": "checkin-link",
+      "id": "BAEN-GBAll",
+      "href": "https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb",
+      "channel": "All"
+    },
+    {
+      "type": "checkin-link",
+      "id": "BAEN-GBMobile",
+      "href": "https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb/device-mobile",
+      "channel": "Mobile"
+    },
+    {
+      "type": "checkin-link",
+      "id": "BAEN-GBWeb",
+      "href": "https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb",
+      "channel": "Web"
+    }
+  ]
+}
+
+

Here we've got a dedicated link for web applications, a dedicated link for mobile applications and a link that works on all platforms.

+

Cancel a reservation

+

Just as you can help users book a flight with the Flight Create Orders API, you can now also help them cancel their reservations with the Flight Order Management API. However, you have a limited window of time to cancel via API. If you’re working with an airline consolidator for ticketing, cancellations via API are generally only allowed while the order is queued for ticketing. Once the ticket has been issued, you’ll have to contact your consolidator directly to handle the cancellation.

+

To call the Flight Order Management API, you have pass as a parameter the flight-orderId from the Flight Create Orders API.

+

To retrieve the flight order data:

+
GET https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY
+
+

To delete the flight order data:

+
DELETE https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY
+
+

View reservation details

+

With the Flight Order Management API you can consult and check your flight reservation.

+

To call the Flight Order Management API, you have pass as a parameter the flight-orderId from the Flight Create Orders API, such as:

+
GET https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY
+
+

Common Errors

+

Issuance not allowed in Self Service

+

Self-Service users must work with an airline consolidator that can issue +tickets on your behalf. In that case, the payment is not processed by the API +but directly between you and the consolidator. Adding a form of payment to +the Flight Create Orders API will be rejected by error INVALID FORMAT.

+

Price discrepancy

+

The price of airfare fluctuates constantly. Creating an order for a flight whose price is no longer valid at the time of booking will trigger the +following error:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
{
+  "errors": [
+    {
+      "status": 400,
+      "code": 37200,
+      "title": "PRICE DISCREPANCY",
+      "detail": "Current grandTotal price (2780.28) is different from request one (2779.58)"
+    }
+  ]
+}
+
+

If you receive this error, reconfirm the fare price with the Flight Offers Price API before booking.

+

The following is a common error in the test environment, as you can perform many bookings without restrictions (no real payment), but the inventory is a copy of the real one, so if you book many seats, the inventory will be empty and you won't be able to book anymore.

+
1
+2
+3
+4
+5
+6
{
+            "status": 400,
+            "code": 34651,
+            "title": "SEGMENT SELL FAILURE",
+            "detail": "Could not sell segment 1"
+        }
+
+

Notes

+

Carriers and rates

+
    +
  • Low cost carriers (LCCs), American Airlines are not available. Depending on the market, British Airways is also not available.
  • +
  • Published rates only returned in Self-Service. Cannot access to negotiated rates, or any other special rates.
  • +
+

Post-booking modifications

+

With the current version of our Self-Service APIs, you can’t add additional baggage after the flight has been booked. This and other post-booking modifications must be handled directly with the airline consolidator that is issuing tickets on your behalf.

+

How payment works

+

There are two things to consider regarding payments for flight booking:

+
    +
  • The payment between you (the app owner) and your customers (for the services provided + the price of the flight ticket). You decide how to collect this payment, it is not included in the API. A third party payment gateway, such as Stripe will be an easier solution for this.
  • +
  • The payment between you and the consolidator (to be able to pay the airline and issue the flight ticket). This will be done between you and your consolidator of choice, and is to be agreed with the consolidator.
  • +
+

Flight Booking Engine 101 Video tutorial

+

A video tutorial series to Explain Flight Booking Engine is available in Youtube channel.

+

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/hotels/index.html b/resources/hotels/index.html new file mode 100644 index 00000000..957e08ca --- /dev/null +++ b/resources/hotels/index.html @@ -0,0 +1,3084 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hotels - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Hotels

+

The Hotels category contains APIs that can help you find the right hotel and complete the booking.

+
+

Information

+

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
APIsDescription
Hotel ListReturns the name, address, geoCode, and time zone for each hotel bookable in Amadeus.
Hotel RatangsUses sentiment analysis of hotel reviews to provide an overall hotel ratings and ratings for categories like location, comfort, service, staff, internet, food, facilities, pool or sleep quality.
Hotel SearchProvides a list of the cheapest hotels in a given location with detailed information on each hotel and the option to filter by category, chain, facilities or budget range.
Hotel BookingLets you complete bookings at over 150,000 hotels and accommodations around the world.
Hotel Name Autocomplete APIProvides a list of up to 20 hotels whose names most closely match the search query string.
+

Let's learn how to get started and help your users book the perfect rooms at over 150,000 hotels worldwide.

+
+

Information

+

This page has been updated based on Hotel Search V3 updates since MAY 2022.

+
+

Search hotels

+

Get a list of hotels by location

+

First, users should be able to search hotels for a given location. The Hotel List API returns a list of hotels based on a city, a geographic code or the unique Amadeus hotel Id. To answer a question, such as "what are the hotels closed to the city hall?" the Hotel List API has three endpoints to utilize based on your search criteria. It returns hotel name, location, and hotel id for you to proceed to the next steps of the hotel search.

+

The Hotel List API contains the following endpoints:

+
    +
  • GET ​/reference-data​/locations​/hotels​/by-city - searches hotels by a city code
  • +
  • GET ​/reference-data​/locations​/hotels​/by-geocode - searches hotels by geographic coordinates
  • +
  • GET /reference-data​/locations​/hotels​/by-hotels - searches hotels by a unique Amadeus hotel Id
  • +
+

Search hotels by a city

+

You can specify an IATA city code or Geocode to search a more specific area to get the list of hotels. You can customize the request using parameters, such as radius, chain code, amenities, star ratings, and hotel source.

+

To search a hotel by a city code, the IATA city code is the only required query parameter:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR
+
+

To include places within a certain radius of the queried city, you can use the optional radius parameter in conjunction with the radiusUnit parameter that defines the unit of measurement for the radius. For example, to look for places within 100 km from Paris:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&radius=100&radiusUnit=KM
+
+

Another way to narrow down our search query is to limit the search to a specific hotel chain. To do this, we need to pass the hotel chain code (which is a two letters string) as the chainCodes parameter, such as EM for Marriott:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&chainCodes=EM
+
+

If you are looking for hotels with certain amenities, such as a spa or a swimming pool, you can use the amenities parameter, which is an enum with the following options:

+
    +
  • FITNESS_CENTER
  • +
  • AIR_CONDITIONING
  • +
  • RESTAURANT
  • +
  • PARKING
  • +
  • PETS_ALLOWED
  • +
  • AIRPORT_SHUTTLE
  • +
  • BUSINESS_CENTER
  • +
  • DISABLED_FACILITIES
  • +
  • WIFI
  • +
  • MEETING_ROOMS
  • +
  • NO_KID_ALLOWED
  • +
  • TENNIS
  • +
  • GOLF
  • +
  • KITCHEN
  • +
  • ANIMAL_WATCHING
  • +
  • BABY-SITTING
  • +
  • BEACH
  • +
  • CASINO
  • +
  • JACUZZI
  • +
  • SAUNA
  • +
  • SOLARIUM
  • +
  • MASSAGE
  • +
  • VALET_PARKING
  • +
  • BAR or LOUNGE
  • +
  • KIDS_WELCOME
  • +
  • NO_PORN_FILMS
  • +
  • MINIBAR
  • +
  • TELEVISION
  • +
  • WI-FI_IN_ROOM
  • +
  • ROOM_SERVICE
  • +
  • GUARDED_PARKG
  • +
  • SERV_SPEC_MENU
  • +
+

The query to find a hotel in Paris with a swimming pool will look like this:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&chainCodes=&amenities=SWIMMING_POOL
+
+

If stars rating is important for the search, you can include up to four values separated by comma in the ratings parameter:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&ratings=5
+
+

The source data for the Hotel List API comes from BEDBANK for aggregators and DIRECTCHAIN for GDS/Distribution. You can select both sources or include/ exclude a particular source:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&hotelSource=ALL
+
+

The response will also include a dedicated Amadeus hotelId:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
        {
+            "chainCode": "AC",
+            "iataCode": "PAR",
+            "dupeId": 700169556,
+            "name": "ACROPOLIS HOTEL PARIS BOULOGNE",
+            "hotelId": "ACPARH29",
+            "geoCode": {
+                "latitude": 48.83593,
+                "longitude": 2.24922
+            },
+            "address": {
+                "countryCode": "FR"
+            },
+            "lastUpdate": "2022-03-01T15:22:17"
+        }
+
+

Search hotels by Geocode

+

Using the by-geocode endpoint, get a list of hotels in Paris (latitude=41.397158 and longitude=2.160873):

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873
+
+

To include places within a certain radius of the queried city, you can use the optional radius parameter in conjunction with the radiusUnit parameter that defines the unit of measurement for the radius. For example, to look for places within 100 km from Paris:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&radius=100&radiusUnit=KM
+
+

Another way to narrow down our search query is to limit the search to a specific hotel chain. To do this, we need to pass the hotel chain code (which is a two letters string) as the chainCodes parameter, such as EM for Marriott:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&chainCodes=EM
+
+

If you are looking for hotels with certain amenities, such as a spa or a swimming pool, you can use the amenities parameter, which is an enum with the following options:

+
    +
  • FITNESS_CENTER
  • +
  • AIR_CONDITIONING
  • +
  • RESTAURANT
  • +
  • PARKING
  • +
  • PETS_ALLOWED
  • +
  • AIRPORT_SHUTTLE
  • +
  • BUSINESS_CENTER
  • +
  • DISABLED_FACILITIES
  • +
  • WIFI
  • +
  • MEETING_ROOMS
  • +
  • NO_KID_ALLOWED
  • +
  • TENNIS
  • +
  • GOLF
  • +
  • KITCHEN
  • +
  • ANIMAL_WATCHING
  • +
  • BABY-SITTING
  • +
  • BEACH
  • +
  • CASINO
  • +
  • JACUZZI
  • +
  • SAUNA
  • +
  • SOLARIUM
  • +
  • MASSAGE
  • +
  • VALET_PARKING
  • +
  • BAR or LOUNGE
  • +
  • KIDS_WELCOME
  • +
  • NO_PORN_FILMS
  • +
  • MINIBAR
  • +
  • TELEVISION
  • +
  • WI-FI_IN_ROOM
  • +
  • ROOM_SERVICE
  • +
  • GUARDED_PARKG
  • +
  • SERV_SPEC_MENU
  • +
+

The query to find a hotel in Paris with a swimming pool will look like this:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&chainCodes=&amenities=SWIMMING_POOL&ratings=
+
+

If stars rating is important for the search, you can include up to four values separated by comma in the ratings parameter:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&ratings=5
+
+

The source data for the Hotel List API comes from BEDBANK for aggregators and DIRECTCHAIN for GDS/Distribution. You can select both sources or include/ exclude a particular source:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&hotelSource=ALL
+
+

The response will also include a dedicated Amadeus hotelId:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
        {
+            "chainCode": "AC",
+            "iataCode": "PAR",
+            "dupeId": 700169556,
+            "name": "ACROPOLIS HOTEL PARIS BOULOGNE",
+            "hotelId": "ACPARH29",
+            "geoCode": {
+                "latitude": 48.83593,
+                "longitude": 2.24922
+            },
+            "address": {
+                "countryCode": "FR"
+            },
+            "lastUpdate": "2022-03-01T15:22:17"
+        }
+
+

Search hotels by hotel ids

+

If you already know the Id of a hotel that you would like to check, you can use it to call the Hotel List API.

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-hotels?hotelIds=ACPARF58
+
+

Interactive code examples

+

Check out this interactive code example which provides a hotel search form to help you build your app. You can easily customize it and use the Hotel Search API to get the cheapest flight offers.

+

Autocomplete Hotel Names

+

Your application can also display a list of suggested hotel names based on keywords used in the search query.

+

Hotel Name Autocomplete API provides a list of up to 20 hotels whose names most closely match the search query string. For each hotel in the results, the API also provides descriptive data, including the hotel name, address, geocode, property type, IATA hotel code and the Amadeus hotel ID.

+

The two mandatory query parameters for this API are the keyword and subtype. The keyword can be anything from four to fourty letters. The sub type is the category of search, which can be either HOTEL_LEISURE to target aggregators or HOTEL_GDS to target the chains directly.

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
{
+    "data": [
+        {
+            "id": 2969353,
+            "name": "BEST WESTERN PREMIER OPERA FAUBOURG PARI",
+            "iataCode": "PAR",
+            "subType": "HOTEL_LEISURE",
+            "relevance": 70,
+            "type": "location",
+            "hotelIds": [
+                "TEPARCFG"
+            ],
+            "address": {
+                "cityName": "PARIS",
+                "countryCode": "FR"
+            },
+            "geoCode": {
+                "latitude": 48.86821,
+                "longitude": 2.40085
+            }
+        },
+        {
+            "id": 3012697,
+            "name": "HOTEL PARI MAHAL",
+            "iataCode": "SXR",
+            "subType": "HOTEL_LEISURE",
+            "relevance": 70,
+            "type": "location",
+            "hotelIds": [
+                "TKSXRAHS"
+            ],
+            "address": {
+                "cityName": "SRINAGAR",
+                "countryCode": "IN"
+            },
+            "geoCode": {
+                "latitude": 34.08106,
+                "longitude": 74.83126
+            }
+        },
+
+

We can narrow the search down to a country specified by a code in the ISO 3166-1 alpha-2 format:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&countryCode=FR
+
+

We can request the results in various languages, although if a language is not supported, the results will be shown in English by default:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&lang=FR
+
+

We can also define the maximum number of results by using the max parameter:

+
GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&countryCode=FR&lang=EN&max=20
+
+

Display Hotel Ratings

+

When users search for hotels in a desired area, they may wonder about the hotel rating. Hotel Ratings API returns ratings for many crucial elements of a hotel, such as sleep quality, services, facilities, room comfort, value for money, location and many others. Hotel Ratings API guarantees high-quality service for your customers.

+

The sentiment analysis, just like the one below, is displayed in a simple flow to allow you to easily identify the best hotels based on traveler reviews:

+
GET https://test.api.amadeus.com/v2/e-reputation/hotel-sentiments?hotelIds=TELONMFS,ADNYCCTB,XXXYYY01
+
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
{ "data": [  {
+    "type": "hotelSentiment",
+    "numberOfReviews": 218,
+    "numberOfRatings": 278,
+   "hotelId": "ADNYCCTB",
+    "overallRating": 93,
+    "sentiments": {
+      "sleepQuality": 87,
+      "service": 98,
+      "facilities": 90,
+      "roomComforts": 92,
+      "valueForMoney": 87,
+      "catering": 89,
+      "location": 98,
+      "pointsOfInterest": 91,
+      "staff": 100
+    }
+  },
+  {
+    "type": "hotelSentiment",
+    "numberOfReviews": 2667,
+    "numberOfRatings": 2666,
+    "hotelId": "TELONMFS",
+    "overallRating": 81,
+    "sentiments": {
+      "sleepQuality": 78,
+      "service": 80,
+      "facilities": 75,
+      "roomComforts": 87,
+      "valueForMoney": 75,
+      "catering": 81,
+     "location": 89,
+      "internet": 72,
+      "pointsOfInterest": 81,
+      "staff": 89
+    }
+  }
+]
+
+

With these additional filters, your booking process becomes more efficient and you can offer your customers an enriched shopping experience. In this way, you can be confident that you are offering a highly rated hotels selection in the areas that customers appreciate the most.

+

Check Availabilities and Prices

+

Once users have explored the list of hotels in their desired area, they would want to check the price of a specific hotel or compare the prices of hotels on the list. With the hotelIds that you got from Hotel List API, you now can check the available rooms with real-time prices and room descriptions by calling the Hotel Search API.

+

An example to request available rooms and prices for one room in Hilton Paris Opera for one adult with check-in date 2022-11-22:

+
GET https://test.api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=1&checkInDate=2022-11-22&roomQuantity=1
+
+

The API returns a list of offers objects containing the price of the cheapest available room as well as information including the room description and payment policy.

+
+

Note

+

The response of Hotel Search V3 contains real-time data, so you don't need an additional validation step anymore. However, as there are thousands of people reserving hotels at any given second, the availability of a given room may change between the moment you search and the moment you decide to book. It is therefore advised that you proceed with booking as soon as possible or add a validation step by searching by offerid described below.

+
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
{
+    "data": [
+        {
+            "type": "hotel-offers",
+            "hotel": {
+                "type": "hotel",
+                "hotelId": "HLPAR266",
+                "chainCode": "HL",
+                "dupeId": "700006199",
+                "name": "Hilton Paris Opera",
+                "cityCode": "PAR",
+                "latitude": 48.8757,
+                "longitude": 2.32553
+            },
+            "available": true,
+            "offers": [
+                {
+                    "id": "ZBC0IYFMFV",
+                    "checkInDate": "2022-11-22",
+                    "checkOutDate": "2022-11-23",
+                    "rateCode": "RAC",
+                    "rateFamilyEstimated": {
+                        "code": "PRO",
+                        "type": "P"
+                    },
+                    "commission": {
+                        "percentage": "8"
+                    },
+                    "room": {
+                        "type": "A07",
+                        "typeEstimated": {
+                            "category": "SUPERIOR_ROOM"
+                        },
+                        "description": {
+                            "text": "ADVANCE PURCHASE\nSUPERIOR ROOM\nFREE WIFI/AIRCON\nHD/ SAT TV/SAFE",
+                            "lang": "EN"
+                        }
+                    },
+                    "guests": {
+                        "adults": 1
+                    },
+                    "price": {
+                        "currency": "EUR",
+                        "base": "359.01",
+                        "total": "361.89",
+                        "taxes": [
+                            {
+                                "code": "TOTAL_TAX",
+                                "pricingFrequency": "PER_STAY",
+                                "pricingMode": "PER_PRODUCT",
+                                "amount": "2.88",
+                                "currency": "EUR",
+                                "included": false
+                            }
+                        ],
+                        "variations": {
+                            "average": {
+                                "base": "359.01"
+                            },
+                            "changes": [
+                                {
+                                    "startDate": "2022-11-22",
+                                    "endDate": "2022-11-23",
+                                    "base": "359.01"
+                                }
+                            ]
+                        }
+                    },
+                    "policies": {
+                        "deposit": {
+                            "acceptedPayments": {
+                                "creditCards": [
+                                    "VI",
+                                    "CA",
+                                    "AX",
+                                    "DC",
+                                    "DS",
+                                    "JC",
+                                    "CU"
+                                ],
+                                "methods": [
+                                    "CREDIT_CARD"
+                                ]
+                            }
+                        },
+                        "paymentType": "deposit",
+                        "cancellation": {
+                            "amount": "361.89",
+                            "type": "FULL_STAY",
+                            "description": {
+                                "text": "Non refundable rate",
+                                "lang": "EN"
+                            }
+                        }
+                    },
+                    "self": "https://api.amadeus.com/v3/shopping/hotel-offers/ZBC0IYFMFV",
+                    "cancelPolicyHash": "F1DC3A564AF1C421C90F7DB318E70EBC688A5A70A93B944F6628D0338F9"
+                }
+            ],
+            "self": "https://api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=1&checkInDate=2022-11-22&roomQuantity=1"
+        }
+    ]
+}
+
+
+

Information

+

The commission information returned by the commission parameter is for information only. Hotels can voluntary provide commission. They are only obliged to do it if you are a IATA certified travel agency, in which case you need to contact our Enterprise APIs team to get access to our REST/JSON booking APIs. Once you have moved to the production environment and obtained the offerId, it will be necessary for you to directly communicate with the hotel to receive the commission on this offer.

+
+

If the time between displaying prices and booking the room is long enough to allow others to book the same room, you can consider requesting Hotel Search API again with the offerid that you got before. This is not mandatory as you always will see if the offer is available or not when you try to book the offer.

+

An example to request the offer information with offer id:

+
GET https://test.api.amadeus.com/v3/shopping/hotel-offers/ZBC0IYFMFV
+
+

Now that you have found the available offer (and its offerId) with the price, you're ready to book!

+

Booking the Hotel

+

The Hotel Booking API is the final step in the hotel booking flow. By making a POST request with the offer Id returned by the Hotel Search API, the guest information, and the payment information, you can create a booking directly in the hotel reservation system.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
POST https://test.api.amadeus.com/v1/booking/hotel-bookings \
+{
+  "data": {
+    "offerId": "ZBC0IYFMFV",
+    "guests": [
+      {
+        "id": 1,
+        "name": {
+          "title": "MR",
+          "firstName": "BOB",
+          "lastName": "SMITH"
+        },
+        "contact": {
+          "phone": "+33679278416",
+          "email": "bob.smith@email.com"
+        }
+      }
+    ],
+    "payments": [
+      {
+        "id": 1,
+        "method": "creditCard",
+        "card": {
+          "vendorCode": "VI",
+          "cardNumber": "4151289722471370",
+          "expiryDate": "2023-08"
+        }
+      }
+    ],
+    "rooms": [
+      {
+        "guestIds": [
+          1
+        ],
+        "paymentId": 1,
+        "specialRequest": "I will arrive at midnight"
+      }
+    ]
+  }
+}'
+
+

Congratulations! You’ve just performed your first hotel booking! Once the reservation is made, the API will return a unique booking confirmation ID which you can send to your users.

+

Notes about Payment

+

The Hotel Search API returns information about the payment policy of each hotel. The main policy types are:

+
    +
  • Guarantee: the hotel will save credit card information during booking but not make any charges to the account. In the case of a no-show or out-of-policy cancellation, the hotel may charge penalties to the card.
  • +
  • Deposit: at the time of booking or by a given deadline, the hotel will charge the guest a percentage of the total amount of the reservation. The remaining amount is paid by the traveler directly at the hotel.
  • +
  • Prepay: the total amount of the reservation fee must be paid by the traveler when making the booking.
  • +
+

The current version of the Hotel Booking API only permits booking at hotels that accept credit cards. During the booking process, Amadeus passes the payment and guest information to the hotel but does not validate this information. Be sure to validate the payment and guest information, as invalid information may result in the reservation being canceled.

+

As soon as your application stores transmits, or processes cardholder information, you will need to comply with PCI Data Security Standard (PCI DSS). For more information, visit the PCI Security Council website.

+

Guide for multiple hotel rooms

+

Now that we have gone through the hotel booking flow, you may wonder how to proceed to booking more than two rooms in a hotel.

+

Check availability and prices for multiple rooms

+

The first step to booking multiple rooms is to search for hotels in your destination with the desired number of available rooms. You can do this by specifying the roomQuantity parameter when you call the Hotel Search API using the hotelid that you got from the Hotel List API.

+

Here is an example of a search in Hilton Paris for two rooms for three adults:

+
GET https://test.api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=3&checkInDate=2022-11-22&roomQuantity=2
+
+

The API will then return the available offers where roomQuantityis equal to 2.

+
1
+2
+3
+4
+5
+6
 "offers": [ 
+            { 
+                "id": "48E6C8C7DAA0BA5C22663E2A2A2B7629F5468BCBE2722FE4AB8174", 
+                "roomQuantity": "2", 
+                "checkInDate": "2022-11-22", 
+                "checkOutDate": "2022-11-23",
+
+

Book multiple rooms with details for one guest

+

To call the Hotel Booking API, you must provide details for at least one guest per offer (the offer contains all rooms for the reservation). For example, the JSON query below provides details of one guest to book two rooms by offerId:

+

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
{ 
+   "data":{ 
+      "offerId":"F837D841218665647003CC9A8CA2A37CEC7276BBE14F9B9C525FBD1B7B69A8FF", 
+      "guests":[ 
+         { 
+            "name":{ 
+               "title":"MR", 
+               "firstName":"BOB", 
+               "lastName":"SMITH" 
+            }, 
+            "contact":{ 
+               "phone":"+33679278416", 
+               "email":"bob.smith@email.com" 
+            } 
+         } 
+      ], 
+      "payments":[ 
+         { 
+            "method":"creditCard", 
+            "card":{ 
+               "vendorCode":"VI", 
+               "cardNumber":"4111111111111111", 
+               "expiryDate":"2026-01" 
+            } 
+         } 
+      ] 
+   } 
+} 
+
+Once the booking is complete, the API will return the following confirmation:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
{ 
+    "data": [ 
+        { 
+            "type": "hotel-booking", 
+            "id": "HA_36000507", 
+            "providerConfirmationId": "36000507", 
+            "associatedRecords": [ 
+                { 
+                    "reference": "R622XL", 
+                    "originSystemCode": "GDS" 
+                } 
+            ] 
+        }, 
+        { 
+            "type": "hotel-booking", 
+            "id": "HA_36000506", 
+            "providerConfirmationId": "36000506", 
+            "associatedRecords": [ 
+                { 
+                    "reference": "R622XL", 
+                    "originSystemCode": "GDS" 
+                } 
+            ] 
+        } 
+    ] 
+}
+
+

Book multiple rooms with guest distribution

+

One common question is how to assign guest distribution among the booked rooms.

+

When you call the Hotel Booking API, the rooms object represents the rooms. Each room contains guests distributed per room. Specifically, each room object needs IDs of the guests staying in that room.

+

Below is a sample request to book two rooms with guest distribution. The first room is for guest ID’s 1 & 2 and the second room for guest Id 3.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
{ 
+  "data": { 
+    "offerId": "4A449AE835DD68F2E7C3571740FD00B76209D7311E719E3B66DE4E1100", 
+    "guests": [ 
+      { 
+        "id": 1, 
+        "name": { 
+          "title": "MR", 
+          "firstName": "BOB", 
+          "lastName": "SMITH" 
+        }, 
+        "contact": { 
+          "phone": "+33679278416", 
+          "email": "bob.smith@email.com" 
+        } 
+      }, 
+      { 
+        "id": 2, 
+        "name": { 
+          "title": "MRS", 
+          "firstName": "EMILY", 
+          "lastName": "SMITH" 
+        }, 
+        "contact": { 
+          "phone": "+33679278416", 
+          "email": "bob.smith@email.com" 
+        } 
+      }, 
+      { 
+        "id": 3, 
+        "name": { 
+          "firstName": "JOHNY", 
+          "lastName": "SMITH" 
+        }, 
+        "contact": { 
+          "phone": "+33679278416", 
+          "email": "bob.smith@email.com" 
+        } 
+      } 
+    ], 
+    "payments": [ 
+      { 
+        "id": 1, 
+        "method": "creditCard", 
+        "card": { 
+          "vendorCode": "VI", 
+          "cardNumber": "4151289722471370", 
+          "expiryDate": "2026-08" 
+        } 
+      } 
+    ], 
+    "rooms": [ 
+      { 
+        "guestIds": [ 
+          1, 2 
+        ], 
+        "paymentId": 1, 
+        "specialRequest": "I will arrive at midnight" 
+      }, 
+      { 
+        "guestIds": [ 
+          3 
+        ], 
+        "paymentId": 1, 
+        "specialRequest": "I will arrive at midnight" 
+      } 
+    ] 
+  } 
+} 
+
+

The API response will be the same as when you booked multiple rooms using the details of just one guest:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
{ 
+    "data": [ 
+        { 
+            "type": "hotel-booking", 
+            "id": "XK_88803316", 
+            "providerConfirmationId": "88803316", 
+            "associatedRecords": [ 
+                { 
+                    "reference": "MJ6HLK", 
+                    "originSystemCode": "GDS" 
+                } 
+            ] 
+        }, 
+        { 
+            "type": "hotel-booking", 
+            "id": "XK_88803315", 
+            "providerConfirmationId": "88803315", 
+            "associatedRecords": [ 
+                { 
+                    "reference": "MJ6HLK", 
+                    "originSystemCode": "GDS" 
+                } 
+            ] 
+        } 
+    ] 
+
+

Common Errors

+

AcceptedPayments must be creditCards

+

The current version of the Hotel Booking API only supports credit card payments, which are accepted by most hotels. The Hotel Search API returns the payment policy of each hotel under acceptedPayments in the policies section.

+

Empty response from the View Room endpoint

+

If you get an empty response from the Hotel Search API’s second endpoint, then the hotel is fully booked and has no vacancy for the requested dates. If you don't use the checkInDate and checkOutDate parameters in the request, the API will return results for a one-night stay starting on the current date. If the hotel is full, the response will be empty.

+

No rooms available at requested property

+
1
+2
+3
+4
+5
+6
+7
+8
+9
{
+    "errors": [
+        {
+            "status": 400,
+            "code": 3664,
+            "title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
+        }
+    ]
+}
+
+

The offer for the selected Hotel is no longer available. Please select a new one.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/index.html b/resources/index.html new file mode 100644 index 00000000..10cb5c03 --- /dev/null +++ b/resources/index.html @@ -0,0 +1,1676 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Self-Service API tutorials - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Self-Service API tutorials

+

In this section, you'll discover a comprehensive collection of tutorials for each Self-Service API, organized by their respective categories. These tutorials delve into the typical use cases for each API and offer illustrative examples of parameters, along with clear explanations of their function.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TutorialCoverage
Travel Safety
Destination Experiences
Flights
Hotels
Itinerary Management
Market insights
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/itinerary-managment/index.html b/resources/itinerary-managment/index.html new file mode 100644 index 00000000..303c1446 --- /dev/null +++ b/resources/itinerary-managment/index.html @@ -0,0 +1,2092 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Itinerary management - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Itinerary Management

+

In the Itinerary Management category, you can give travelers a simple and personalized way to view their itinerary.

+
+

Information

+

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

+
+ + + + + + + + + + + + + + + + + + + + + +
APIsDescription
Trip ParserBuild a single itinerary with information from different booking confirmation emails.
Trip Purpose PredictionAnalyze a flight itinerary and predict whether the trip is for business or leisure.
City SearchFinds cities that match a specific word or string of letters.
+

Parse the email confirmation into JSON

+

The Trip Parser API helps to extract information from different booking confirmation emails and compile it into a single structured JSON itinerary. This API can parse information from flight, hotel, rail, and rental car confirmation emails. It provides the result of your parsing immediately, thanks to our algorithm.

+

Encode your booking confirmation in Base64

+

The first step to parsing is to encode your booking confirmation file in Base64 format. This will give you the base of your API request. You should not add formatting or any other elements to your booking confirmation as it will affect the parsing.

+

There are many tools and software that you can use for Base64 encoding. Some programming languages implement encoding and decoding functionalities in their standard library. In python, for example, it will look similar to this:

+
1
+2
+3
+4
import base64 
+with open("booking.pdf", "rb") as booking_file: 
+    encoded_string = base64.b64encode(booking_file.read()) 
+print(encoded_string)
+
+

Get the parsing results

+

Next, add the encoded booking confirmation to the body of a POST request to the endpoint

+
POST https://test.api.amadeus.com/v3/travel/trip-parser
+
+
1
+2
+3
+4
+5
+6
+7
+8
{
+  "payload": "your Base64 code here",
+  "metadata": {
+    "documentType": "PDF",
+    "name": "BOOKING_DOCUMENT",
+    "encoding": "BASE_64"
+  }
+}
+
+
    +
  • documentType : pdf, xml, json or jpg
  • +
  • encoding : BASE_64 or BASE_64_URL
  • +
+

This will extract all the relevant data from the booking information into a structured JSON format, just like the example below.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
{
+  "data": {
+    "trip": {
+      "reference": "JUPDRM",
+      "stakeholders": [
+        {
+          "name": {
+            "firstName": "MIGUEL",
+            "lastName": "TORRES"
+          }
+        }
+      ],
+      "products": [
+        {
+          "air": {
+            "departure": {
+              "localDateTime": "2021-06-16T08:36:00"
+            },
+            "arrival": {
+              "localDateTime": "2021-06-17T00:00:00"
+            },
+            "marketing": {
+              "flightDesignator": {
+                "carrierCode": "CM",
+                "flightNumber": "644"
+              }
+            }
+          }
+        },
+        {
+          "air": {
+            "departure": {
+              "localDateTime": "2021-06-16T11:21:00"
+            },
+            "arrival": {
+              "localDateTime": "2021-06-17T00:00:00"
+            },
+            "marketing": {
+              "flightDesignator": {
+                "carrierCode": "CM",
+                "flightNumber": "426"
+              }
+            }
+          }
+        },
+        {
+          "air": {
+            "departure": {
+              "localDateTime": "2021-06-20T18:56:00"
+            },
+            "arrival": {
+              "localDateTime": "2021-06-21T00:00:00"
+            },
+            "marketing": {
+              "flightDesignator": {
+                "carrierCode": "CM",
+                "flightNumber": "645"
+              }
+            }
+          }
+        }
+      ]
+    }
+  }
+}
+
+

Predict the trip purpose from a flight

+

Another API in the itinerary management category, the Trip Purpose Prediction API, predicts whether a flight is searched for business or leisure. Our machine-learning models have detected which patterns of departure and arrival cities, flight dates, and search dates are associated with business and leisure trips. Understand why your users travel and show them the flights, fares, and ancillaries that suit them best.

+

Below is an example to see if the flight from New York to Madrid from 2022-12-01 to 2022-12-12 is leisure or business.

+
GET https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2022-12-01&returnDate=2022-12-12
+
+

The result? You can probably guess it. :)

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
{
+  "data": {
+    "id": "NYCMAD20221201",
+    "probability": "0.9970142",
+    "result": "LEISURE",
+    "subType": "trip-purpose",
+    "type": "prediction"
+  },
+  "meta": {
+    "defaults": {
+      "searchDate": "2022-06-30"
+    },
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2022-12-01&returnDate=2022-12-12&searchDate=2022-06-30"
+    }
+  }
+}
+
+

Find a city by keywords

+

If you are unsure of the exact spelling of a city, you can reach out to the City Search API. This API uses a keyword, which is a string containing a minimum of 3 and a maximum of 10 characters, to search for a city whose name contains this keyword. It is not critical whether you enter the entire city name or only a part of it. For example, Paris, Par or ari will all return Paris in the search results.

+

There are two optional parameters to help you make the query more precise - countryCode and max. The countryCode is a string for the ISO 3166 Alpha-2 code of the country where you need to locate a city, for example, FR for France. The max is an integer that defines the maximum number of search results.

+

You can also include a list of airports for each city returned in the search results. To do this, you need to add AIRPORTS to the include field, which is an array of strings defining additional resources for your search.

+

Let's check out the results for keyword PAR. We will limit the search scope to FR and the number of results to two.

+
GET https://test.api.amadeus.com/v1/reference-data/locations/cities?countryCode=FR&keyword=PAR&max=2
+
+

The results are probably rather predictable:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
{
+  "meta": {
+    "count": 2,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/reference-data/locations/cities?countryCode=FR&keyword=PAR&max=2"
+    }
+  },
+  "data": [
+    {
+      "type": "location",
+      "subType": "city",
+      "name": "Paris",
+      "iataCode": "PAR",
+      "address": {
+        "countryCode": "FR",
+        "stateCode": "FR-75"
+      },
+      "geoCode": {
+        "latitude": 48.85341,
+        "longitude": 2.3488
+      }
+    },
+    {
+      "type": "location",
+      "subType": "city",
+      "name": "Le Touquet-Paris-Plage",
+      "iataCode": "LTQ",
+      "address": {
+        "countryCode": "FR",
+        "stateCode": "FR-62"
+      },
+      "geoCode": {
+        "latitude": 50.52432,
+        "longitude": 1.58571
+      }
+    }
+  ]
+}
+
+

First of all we see the French capital at the top of the list. The second result refers to the town Le Touquet-Paris-Plage, whose official name contains three letters that match our keyword. If we want to see more results, we can always adjust the max number of results.

+

The main difference between the Airport & City Search API and City Search API is that the Airport & City Search API only shows cities that have an airport, while the City Search API retrieves any city that matches a keyword.

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/market-insight/index.html b/resources/market-insight/index.html new file mode 100644 index 00000000..684412f3 --- /dev/null +++ b/resources/market-insight/index.html @@ -0,0 +1,2184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Market insights - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Market insights

+

With Amadeus Self-Service APIs, you can get insights from millions of bookings and our technology partners. In the Market insights category, we have four APIs available.

+
+

Information

+

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
APIsDescription
Flight Most Traveled DestinationsSee the top destinations by passenger volume for a given city and month.
Flight Most Booked DestinationsSee the top destinations by booking volume for a given city and month.
Flight Busiest Traveling PeriodSee monthly air traffic levels by city to understand season trends.
Location ScoreAssess a neighborhood’s popularity for sightseeing, shopping, eating out, or nightlife.
+

Find the top destinations or the busiest period for a given city

+

You may wonder which destination the travelers travel to the most and when is the busiest period for a given city. You can get the travel insight from a given city and month with the following three endpoints.

+
+

Information

+
    +
  • The results of these three endpoints are based on estimated flight traffic summary data from the past 12 months.
  • +
  • Flight traffic summary data is based on bookings made over Amadeus systems.
  • +
+
+

The top destinations by passenger volume

+

Flight Most Traveled Destinations API returns the most visited destinations from a given city.

+
GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=NCE&period=2018-01
+
+

The top destinations by booking volume

+

Flight Most Booked Destinations API returns the most booked destinations from a given city.

+
GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=NCE&period=2018-01
+
+

The busiest month/period by air traffic

+

Flight Busiest Traveling Period API returns the peak periods for travel to/from a specific city.

+
GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=NCE&period=2018
+
+

Response

+

The three endpoints have the same response structure.

+

Response to the top destinations from a given city :

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
{
+    "meta": {
+        "count": 8,
+        "links": {
+            "self": "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=NCE&page%5Blimit%5D=10&page%5Boffset%5D=0&period=2018-01&sort=analytics.travelers.score"
+        }
+    },
+    "data": [
+        {
+            "type": "air-traffic",
+            "destination": "PAR",
+            "subType": "BOOKED",
+            "analytics": {
+                "flights": {
+                    "score": 100
+                },
+                "travelers": {
+                    "score": 100
+                }
+            }
+        },
+        {
+            "type": "air-traffic",
+            "destination": "MAD",
+            "subType": "BOOKED",
+            "analytics": {
+                "flights": {
+                    "score": 10
+                },
+                "travelers": {
+                    "score": 8
+                }
+            }
+        }
+    ]
+}
+
+

Response to the busines period from a given city :

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
{
+    "meta": {
+        "count": 3,
+        "links": {
+            "self": "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=PAR&direction=ARRIVING&period=2018"
+        }
+    },
+    "data": [
+        {
+            "type": "air-traffic",
+            "period": "2018-03",
+            "analytics": {
+                "travelers": {
+                    "score": 34
+                }
+            }
+        },
+        {
+            "type": "air-traffic",
+            "period": "2018-02",
+            "analytics": {
+                "travelers": {
+                    "score": 33
+                }
+            }
+        },
+        {
+            "type": "air-traffic",
+            "period": "2018-01",
+            "analytics": {
+                "travelers": {
+                    "score": 33
+                }
+            }
+        }
+    ]
+}
+
+
    +
  • subType is BOOKED or TRAVELED, depending on the endpoint.
  • +
  • In analytics, the score in flight is flights to this destination as a percentage of total departures, and the score in traveler is the number of passengers traveling to the destination as a percentage of total passenger departures.
  • +
+

Sorting

+

Sorting is enabled on the "top destinations" endpoints.

+
    +
  • analytics.flights.score - sort destination by flights score (decreasing)
  • +
  • analytics.travelers.score - sort destination by traveler's score (decreasing)
  • +
+

For example :

+
GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=NCE&period=2018-01&sort=analytics.travelers.score
+
+

Direction

+

For the Flight Busiest Traveling Period insight, you can specify the direction as:

+
    +
  • ARRIVING for statistics on travelers arriving in the city
  • +
  • DEPARTING for statistics on travelers leaving the city
  • +
+

By default, statistics are given on travelers ARRIVING in the city.

+
GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=PAR&period=2018&direction=ARRIVING
+
+

Find insight within a given city

+

Apart from the top destinations and busiest period insight in a city, you can also help users gain insights into a neighborhood, hotel, or vacation rental with the Location Score API.

+

For a given latitude and longitude, it provides popularity scores for the following leisure and tourism categories:

+
    +
  • Sightseeing
  • +
  • Restaurants
  • +
  • Shopping
  • +
  • Nightlife
  • +
+

For each category, the API provides an overall popularity score as well as scores for select subcategories, +such as luxury shopping, vegetarian restaurants, or historical sights. Location scores are on +a simple 0-100 scale and are powered by the AVUXI TopPlace algorithm, which analyzes millions of online reviews, comments, and points of interest.

+
+

Notes

+
    +
  • For each location, the API will return scores for a 200m., 500m., and 1500m. radius.
  • +
  • Scores indicate positive traveler sentiments and may not reflect the most visited locations.
  • +
+
+

Request:

+
curl https://test.api.amadeus.com/v1/location/analytics/category-rated-areas?latitude=41.397158&longitude=2.160873
+
+

Response:

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
{
+  "data": [
+    {
+      "type": "category-rated-area",
+      "geoCode": {
+        "latitude": 41.397158,
+        "longitude": 2.160873
+      },
+      "radius": 200,
+      "categoryScores": {
+        "sight": {
+          "overall": 87,
+          "historical": 83,
+          "beachAndPark": 0
+        },
+        "restaurant": {
+          "overall": 92,
+          "vegetarian": 61
+        },
+        "shopping": {
+          "overall": 96,
+          "luxury": 96
+        },
+        "nightLife": {
+          "overall": 86
+        }
+      }
+    },
+    {
+      "type": "category-rated-area",
+      "geoCode": {
+        "latitude": 41.397158,
+        "longitude": 2.160873
+      },
+      "radius": 500,
+      "categoryScores": {
+        "sight": {
+          "overall": 99,
+          "historical": 69,
+          "beachAndPark": 0
+        },
+        "restaurant": {
+          "overall": 94,
+          "vegetarian": 71
+        },
+        "shopping": {
+          "overall": 99,
+          "luxury": 99
+        },
+        "nightLife": {
+          "overall": 88
+        }
+      }
+    }
+  ],
+  "meta": {
+    "count": 3,
+    "links": {
+      "self": "https://test.api.amadeus.com/v1/location/analytics/category-rated-areas?latitude=41.397158&longitude=2.160873"
+    }
+  }
+}
+
+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/resources/travel-safety/index.html b/resources/travel-safety/index.html new file mode 100644 index 00000000..75ad0b39 --- /dev/null +++ b/resources/travel-safety/index.html @@ -0,0 +1,1782 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Travel safety - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Travel Safety

+

Amadeus for Developers provides travel safety data making it easy for developers to build applications that keep travelers safe at every step of the journey.

+ + + + + + + + + + + + + +
APIsDescription
Safe PlaceProvides updated safety and security ratings for over 65,000 cities and neighborhoods worldwide, helping travelers consult and compare destination safety.
+

Search by an area

+

With the Safe Place API you can find categorized risk levels with neighborhood-level granularity. You will get an overall safety score and scores for six-component categories:

+
    +
  • Women’s Safety
  • +
  • Health & Medical Safety
  • +
  • Physical Harm
  • +
  • Theft
  • +
  • Political Freedoms
  • +
  • LGBTQ+ Safety
  • +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
            "subType": "CITY",
+            "name": "Seoul",
+            "geoCode": {
+                "latitude": 37.566534999999995,
+                "longitude": 126.97796899999999
+            },
+            "safetyScores": {
+                "lgbtq": 45,
+                "medical": 45,
+                "overall": 35,
+                "physicalHarm": 33,
+                "politicalFreedom": 28,
+                "theft": 44,
+                "women": 34
+            }
+        }
+
+

Safety scores range on a scale of 1-100, with 1 being the safest and 100 being the least safe. In this example of Seoul, South Korea, a “politicalFreedom” score of 28 indicates that the potential for infringement of political rights or political unrest is less likely to happen at this location.

+

Each location found by the Safe Place API is shown with its Amadeus location Id, which can be used in subsequent search queries:

+
1
+2
"type": "safety-rated-location",
+      "id": "Q930402720"
+
+

Available blog articles

+

How to build a neighborhood safety map in Python with Amadeus Safe Place

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 00000000..f6b4c633 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Amadeus for Developers docs","text":"

Welcome to the Amadeus for Developers docs portal!

Our main focus here is on the Self-Service APIs. If you need any information on the Enterprise APIs, please reach out to our customer support team and we'll be happy to assist you further.

"},{"location":"#what-are-the-self-service-apis","title":"What are the Self-Service APIs?","text":"

Target independent developers and start-ups that wish to connect to Amadeus APIs in a quick and easy manner. You can access and start to test these new REST/JSON APIs in less than 3 minutes, and get quick access to production data with a flexible pay-as-you-go pricing model. Please note that the catalog includes some selected APIs, although we will be constantly releasing new APIs. Currently, you can find APIs around flights, hotels, destination content, and travel safety.

Self-Service users have at their disposal detailed documentation, guides, and SDKs to be able to integrate the APIs in their apps.

"},{"location":"#what-are-the-enterprise-apis","title":"What are the Enterprise APIs?","text":"

Provide access to the full Amadeus APIs catalog, tailored to companies with scale needs and leading brands in the travel industry. Customers of Enterprise APIs receive dedicated support from their account managers and enjoy a customized pricing scheme to meet their needs. Please note that access to Enterprise APIs is only granted on a request basis, and some special requirements may apply.

Warning

You can potentially use APIs from both catalogs, but please keep in mind that the requirements and conditions of each offer are very different!

"},{"location":"#discover-the-amadeus-self-service-apis","title":"Discover the Amadeus Self-Service APIs","text":"

Amadeus for Developers provides a set of Self-Service APIs, which were implemented using the API-first approach. We produce an API specification in the OpenAPI format before any implementation.

Information

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic.

  • To see all Amadeus Self-Service APIs in one place, check out our API catalogue.
  • Don\u2019t forget to stop by our GitHub workspace where you can find tons of samples and prototypes to get inspiration, as well as the latest versions of the SDKs in multiple programming languages.
  • If you are a happy Postman user, as we are, feel free to use the Amadeus for Developers Postman collection.

Important

Something not clear? Typos? We would be happy to receive your pull requests and feedback to this documentation guides. Feel free to contribute!

Happy coding!

The Amadeus for Developers Team

"},{"location":"api-rate-limits/","title":"Rate limits","text":""},{"location":"api-rate-limits/#rate-limits-per-api","title":"Rate limits per API","text":"

Amadeus Self-Service APIs have two types of rate limits in place to protect against abuse by third parties.

"},{"location":"api-rate-limits/#artificial-intelligence-and-partners-apis","title":"Artificial Intelligence and Partners' APIs","text":"

Artificial intelligence APIs and APIs from Amadeus partners' are currently following the rate limits below.

Test and Production 20 transactions per second, per user No more than 1 request every 50ms"},{"location":"api-rate-limits/#list-of-apis-with-the-above-rate-limits","title":"List of APIs with the above rate limits:","text":"
  • Safe Place
  • Points of Interest
  • Tours and Activities
  • Location Score
  • Airport On-time Performance
  • Flight Price Analysis
  • Flight Delay Prediction
  • Flight Choice Prediction
"},{"location":"api-rate-limits/#the-other-apis","title":"The other APIs","text":"

The rest of Self-Service APIs apart from Artificial intelligence and Partners' APIs are below rate limits per environment.

Test Production 10 transactions per second, per user 40 transactions per second, per user No more than 1 request every 100ms"},{"location":"api-rate-limits/#rate-limits-examples","title":"Rate limits Examples","text":"

To manage the rate limits in APIs, there are mainly two options: - Use an external library - Build a request queue from scratch

The right choice depends on your resources and requisites.

Check out the rate limits examples in Node, Python and Java using the respective Amadeus SDKs.

"},{"location":"common-errors/","title":"Common client and server errors","text":"

Amadeus for Developers Self-Service APIs use HTTP status codes to communicate whether a request has been successfully processed.

"},{"location":"common-errors/#types-of-errors","title":"Types of errors","text":"

There two main types of errors are:

  • Client: typically occur when the request has not been properly built.
  • Server: occur when there is an issue on the server side.
"},{"location":"common-errors/#client-errors","title":"Client errors","text":"

If your API request is invalid, you will receive a Client Error response with an HTTP 4xx status code. The body of the response will match the format defined in our swagger schema and provide details about the error.

"},{"location":"common-errors/#authorization-errors","title":"Authorization errors","text":"

400 Bad request - Unsupported grant type

Occurs when using a grant type other than client credentials. For more information, read our Authorization Guide.

{\n    \"error\": \"unsupported_grant_type\",\n    \"error_description\": \"Only client_credentials value is allowed for the body parameter grant_type\",\n    \"code\": 38187,\n    \"title\": \"Invalid parameters\"\n}\n

401 Unauthorized - Invalid access token

Occurs when the access token provided in the Authorization header is expired or not longer valid. You must generate a new token.

{\n  \"errors\": [\n      {\n        \"code\": 38190,\n        \"title\": \"Invalid access token\",\n        \"detail\": \"The access token provided in the Authorization header is invalid\",\n        \"status\": 401\n      }\n  ]\n}\n

401 Unauthorized - Invalid client

Occurs when the client credentials have an invalid format and are not recognized.

{\n    \"error\": \"invalid_client\",\n    \"error_description\": \"Client credentials are invalid\",\n    \"code\": 38187,\n    \"title\": \"Invalid parameters\"\n}\n

401 Unauthorized - Invalid HTTP header

The Authorization header is missing or its format invalid, e.g. the required word \"Bearer\" is wrongly spelled or not present at all in the Authorization header in an API request.

{\n    \"errors\": [\n        {\n            \"code\": \"38191\",\n            \"title\": \"Invalid HTTP header\",\n            \"detail\": \"Missing or invalid format for mandatory Authorization header\",\n            \"status\": \"401\"\n        }\n    ]\n}\n

401 Unauthorized \u2013 Access token expired

The access token sent by the client is expired. Access tokens are only valid for 30 minutes. To ease the generation of access tokens you can use our SDKs.

{\n    \"errors\": [\n        {\n            \"code\": 38192,\n            \"title\": \"Access token expired\",\n            \"detail\": \"The access token is expired\",\n            \"status\": 401\n        }\n    ]\n}\n

401 Unauthorized \u2013 Access token revoked

The access token has been revoked. Please generate a new one.

{\n    \"errors\": [\n        {\n            \"code\": 38193,\n            \"title\": \"Access token revoked\",\n            \"detail\": \"The access token is revoked\",\n            \"status\": 401\n        }\n    ]\n}\n

401 Unauthorized \u2013API revoked

The API credentials have been revoked. This could be because we found it searchable in a public repository, in this case you can generate new keys in your Self-Service workspace. Or it could be that you have unpaid bills and we revoked your access, if that is the case please contact support.

{\n    \"errors\": [\n        {\n            \"code\": 39683,\n            \"title\": \"API key revoked\",\n            \"detail\": \"The API key is revoked\",\n            \"status\": 401\n        }\n    ]\n}\n

401 Unauthorized \u2013 Invalid API key

The API key used is invalid. Please check for spaces in the end and make sure you are using the correct key and case URL.

{\n    \"errors\": [\n        {\n            \"code\": 39686,\n            \"title\": \"Invalid API key\",\n            \"detail\": \"The API key is invalid\",\n            \"status\": 401\n        }\n    ]\n}\n

"},{"location":"common-errors/#data-format-errors","title":"Data Format Errors","text":"

400 Bad request - Invalid format

Occurs when an input query parameter is incorrect. In the example below, the Airport & City Search API returns an error because the location parameter is not in the expected IATA standard.

{\n    \"errors\": [\n        {\n            \"status\": 400,\n            \"code\": 477,\n            \"title\": \"INVALID FORMAT\",\n            \"detail\": \"City/Airport - 3 characters [IATA code](https://en.wikipedia.org/wiki/International_Air_Transport_Association_airport_code) from which the traveler will depart.\",\n            \"source\": {\n                \"parameter\": \"origin\"\n            }\n        }\n    ]\n}\n

403 Forbidden

The HTTP protocol is used instead of HTTPS when making the API call. Or you are attempting to reach an endpoint which requires additional permission.

{\n    \"errors\": [\n        {\n            \"code\": 38197,\n            \"title\": \"Forbidden\",\n            \"detail\": \"Access forbidden\",\n            \"status\": 403\n        }\n    ]\n}\n

"},{"location":"common-errors/#too-many-requests-errors","title":"Too Many Requests Errors","text":"

429 Too many requests

Too many requests are sent in the given timeframe. Please check our rate limits and adjust accordingly for the targeted environment and API.

{\n    \"errors\": [\n        {\n            \"code\": 38194,\n            \"title\": \"Too many requests\",\n            \"detail\": \"The network rate limit is exceeded, please try again later\",\n            \"status\": 429\n        }\n    ]\n}\n

429 Quota limit exceeded

The number of free transactions allowed in test has been reached for this month. Please consider moving your app to production or wait next month to keep using the APIs.

{\n    \"errors\": [\n        {\n            \"code\": 38195,\n            \"title\": \"Quota limit exceeded\",\n            \"detail\": \"The quota limit is exceeded.\",\n            \"status\": 429\n        }\n    ]\n}\n

"},{"location":"common-errors/#resource-errors","title":"Resource Errors","text":"

404 Not found - Resource not found

Occurs when the endpoint or URL does not exist. Make sure you are calling a valid endpoint and that there are no spelling errors.

{\n    \"errors\": [\n        {\n            \"code\": 38196,\n            \"title\": \"Resource not found\",\n            \"detail\": \"The targeted resource doesn't exist\",\n            \"status\": 404\n        }\n    ]\n}\n
"},{"location":"common-errors/#server-errors","title":"Server errors","text":"

If an error occurs during the execution of your request, you will receive a Server error resonse with an HTTP 5xx status code. The body will match the defined error format, allowing your application to read it and display an appropriate message to the client. It may also contain debugging information which you can submit to us to further investigate the error.

500 Internal error

{\n    \"errors\": [\n        {\n            \"code\": 38189,\n            \"title\": \"Internal error\",\n            \"detail\": \"An internal error occured, please contact your administrator\",\n            \"status\": 500\n        }\n    ]\n}\n
"},{"location":"faq/","title":"Frequently Asked Questions","text":"

This page provides help with the most common questions about Amadeus Self-service APIs.

"},{"location":"faq/#account-registration","title":"Account registration","text":""},{"location":"faq/#how-do-i-change-my-password","title":"How do I change my password?","text":"

To change your password, sign in to the Developers portal and click on My Account in the top right corner of the screen. You'll find the option to change your password at the bottom of the page. Please remember that we never send your password in any correspondence.

"},{"location":"faq/#i-registered-but-never-received-a-confirmation-email-what-should-i-do","title":"I registered but never received a confirmation email? What should I do?","text":"

If you haven't received a confirmation mail, it is often because the email address was entered incorrectly. Please sign in to the Developers portal and visit the My Account section to confirm that the email address used to create the account is correct. If so, please check your spam folder for an email from noreply@amadeus.com.

"},{"location":"faq/#business-enquiries","title":"Business enquiries","text":""},{"location":"faq/#how-can-i-monetise-my-application","title":"How can I monetise my application?","text":"

You are free to create your own business models around our APIs, such as charging users to use our APIs in their apps or adopting a subscription-based model. However, we do not give any commission or other types of incentives for the Self-Service API. The latter is only possible in the Enterprise framework. If you're offering flight booking services, you can generate revenue for your apps by applying a markup on flight offers.

"},{"location":"faq/#i-would-like-to-partner-up-with-amadeus","title":"I would like to partner up with Amadeus","text":"

You can partner with Amadeus through the Amadeus Partner Network. This includes different types of partnerships, with the possibility to get access to technology or to connect to Amadeus' global network of customers and partners.

"},{"location":"faq/#self-service-vs-enterprise","title":"Self-Service vs Enterprise","text":""},{"location":"faq/#what-is-the-difference-between-self-service-and-enterprise-apis","title":"What is the difference between Self-Service and Enterprise APIs?","text":"

Amadeus for Developers provides two different offers, each of which meets distinct customer needs: Self-Service and Enterprise.

The Self-Service offer targets independent developers and start-ups that wish to connect to Amadeus APIs in a quick and easy manner. You can access and start testing these new REST/JSON APIs in less than 3 minutes, and get quick access to production data with a flexible pay-as-you-go pricing model. Please note that the catalog includes some selected APIs only, although we will be constantly releasing new APIs.

The Enterprise offer provides access to the full Amadeus APIs catalog, tailored to companies with scaling needs as well as the leading brands in the travel industry. Customers of Enterprise APIs receive dedicated support from their account managers and enjoy a customized pricing scheme to meet their needs. Please note that access to Enterprise APIs is only granted on a request basis, and some special requirements may apply. Our Enterprise commercial teams will be happy to guide you through the process.

"},{"location":"faq/#can-i-use-apis-from-both-self-service-and-enterprise","title":"Can I use APIs from both Self-Service and Enterprise?","text":"

Yes, you can use APIs from both catalogs, but please keep in mind that the requirements and conditions of each offer are very different. Please check our Get Started guide for more information.

"},{"location":"faq/#how-can-i-contact-enterprise","title":"How can I contact Enterprise?","text":"

To contact the Enterprise team, please fill in the following contact us form and someone from the Enterprise team will get back to you shortly. Please keep in mind that the access to Enterprise requires an implementation fee as well as monthly fees.

"},{"location":"faq/#how-much-do-i-need-to-pay-to-access-enterprise-apis","title":"How much do I need to pay to access Enterprise APIs?","text":"

The access to Enterprise APIs is subject to certain requirements depending on your market and the functionalities you want to access. It is usually reserved for experienced companies with the need to scale. Before we can disclose the pricing details you will need to sign an NDA.

"},{"location":"faq/#self-service-apis-general","title":"Self-Service APIs general","text":""},{"location":"faq/#is-there-a-test-environment-to-try-the-self-service-apis","title":"Is there a test environment to try the Self-Service APIs?","text":"

Yes! You can try Self-Service APIs in our test environment and enjoy a free monthly request quota to build and test your app. If you exceed this free request quota in the test environment, you'll receive a 429 error code in JSON and not be able to call the APIs.

If you need to increase the number of monthly API calls, please consider moving your application to production. It's a quick and easy process and you will keep the free request quota you enjoyed in test. Once you reach your threshold in production, you will simply pay for the additional API calls you make.

"},{"location":"faq/#how-do-i-access-the-self-service-apis-documentation","title":"How do I access the Self-Service APIs documentation?","text":"

Check our Amadeus for Developers docs portal for links to interactive reference documentation for each API and helpful guides covering topics such as authorization, pagination and common errors. On the Amadeus for Developers GitHub page, you can also find code samples and SDKs.

"},{"location":"faq/#do-you-provide-sdks","title":"Do you provide SDKs?","text":"

Yes! On the Amadeus for Developers GitHub page you can find open-source SDKs in various languages. Alternatively, you can use OpenAPI Generator to create an SDK from our OpenAPI files.

"},{"location":"faq/#where-can-i-see-code-examples-for-amadeus-self-service-apis","title":"Where can I see code examples for Amadeus Self-Service APIs?","text":"

Code examples for all Amadeus Self-Service APIs are available in our GitHub.

"},{"location":"faq/#how-do-i-make-my-first-self-service-api-call","title":"How do I make my first Self-Service API call?","text":"

On the Get Started with Self-Service APIs page you can find information on creating an account, getting your API key and making your first call.

"},{"location":"faq/#how-do-i-move-self-service-apis-from-test-to-production","title":"How do I move Self-Service APIs from test to production?","text":"

To launch your application to production, please follow the steps described in our Moving to production guide.

You will be asked to sign a contract and provide billing information before receiving your new API key. When you move to production, you will maintain the same free monthly request quota you enjoyed in test. When you reach your monthly threshold, you will be billed for the additional API calls you make at the rates shown on our Pricing page.

"},{"location":"faq/#how-do-i-delete-my-application-built-using-self-service-apis","title":"How do I delete my application built using Self-Service APIs?","text":"

To delete an application, visit the My apps section of your My Self-Service Workspace. Remember that deleted apps cannot be recovered.

"},{"location":"faq/#will-you-include-more-apis-in-the-self-service-catalog","title":"Will you include more APIs in the Self-Service catalog?","text":"

We are constantly expanding our Self-Service API catalog with new APIs from all travel segments such as flights, hotels, cars or destination content. If you have any specific requests or feedback regarding APIs that you would like to add to your catalog, please contact us. We'd love to hear from you!

"},{"location":"faq/#what-are-the-terms-of-service-for-amadeus-self-service-apis","title":"What are the terms of service for Amadeus Self-Service APIs?","text":"

To find out more about our terms and conditions for the test environment, please visit our Terms and Conditions page.

If you are already in production, you should have received an email with the legal terms regulating API usage in the production environment. If you have not received this information, please contact us.

"},{"location":"faq/#i-am-not-a-travel-agent-and-have-no-experience-in-the-travel-industry-can-i-still-use-the-self-service-apis","title":"I am not a travel agent and have no experience in the travel industry, can I still use the Self-Service APIs?","text":"

Our Self-Service offer is designed for newcomers to Amadeus, there are no prerequisites. Any developer who wishes to connect to Amadeus travel data can do so in a quick and easy way via our Self-Service offer. For more details, please check our Get Started guide.

"},{"location":"faq/#are-there-any-limitations-to-the-self-service-api-dataset","title":"Are there any limitations to the Self-Service API dataset?","text":"

We do not return data on American Airlines, Low cost carriers, and, in some markets, British Airways. For other arlines we only return published rates. We do not return negotiated rates or any other special rates. The Flight Offers Search only returns the bag allowance information for one passenger type code. Airlines blacklisted in the EU are not returned using the Flight Offers Search GET, e.g., Iraqi Airways. There is a possibility to override this with the POST method.

"},{"location":"faq/#how-can-i-do-group-booking","title":"How can I do group booking?","text":"

Our Self-Service APIs allow you to book up to 9 passengers on the same PNR number. For more passengers you will need to create a new booking.

"},{"location":"faq/#what-is-it-returning-different-prices-with-the-self-service-apis-and-other-amadeus-solutions","title":"What is it returning different prices with the Self-Service APIs and other Amadeus solutions?","text":"

The Self-Service catalog only returns published GDS rates. If you have access to special rates through another solution, they will not be available through our Self-Service APIs.

"},{"location":"faq/#do-i-need-an-iata-license","title":"Do I need an IATA license?","text":"

IATA or ARC licenses (depending on your market) are mandatory if you want to issue flight tickets, but this option is only available in our Enterprise framework. In Self-Service you will need to work with an airline consolidator to issue flight tickets, therefore no IATA or ARC license is needed.

"},{"location":"faq/#api-keys","title":"API keys","text":""},{"location":"faq/#what-is-an-api-key","title":"What is an API key?","text":"

An API key is a unique reference number which identifies your application to Amadeus. The API key is part of the authorization process and must be sent with each API request. If you have multiple applications using Amadeus APIs, each application must have its own API key. For more details, check our Authorization guide.

Your API keys are also used to track usage. To avoid unwanted charges, please do no share or post them in public repositories. For more information, see this article on best practices for secure API key storage.

"},{"location":"faq/#how-do-i-get-my-self-service-api-key","title":"How do I get my Self-Service API key?","text":"

To get a Self-Service API key, simply create an account in the Amadeus for Developers portal. Next, visit the My Self-Service Workspace area and create your first application. An API key will be generated automatically. Remember, your API key is private and should not be shared publicly.

"},{"location":"faq/#why-is-my-self-service-api-key-not-working","title":"Why is my Self-Service API key not working?","text":"

If your API key is not working, please verify that it is the same exact key that was provided in the My Self-Service Workspace.

Please keep in mind that we automatically revoke API keys that are publicly searchable. This is done to protect users against unwanted usage bills. As a general rule, you should not put your API keys in the source code you commit to GitHub or other public repositories. Instead, you should store your keys as environment variables rather than hard-coding them in your script. For more information, see this article on best practices for secure API key storage.

"},{"location":"faq/#how-long-is-my-self-service-access-token-valid-for","title":"How long is my Self-Service access token valid for?","text":"

The access token is valid for 1800 seconds (30mins). If you get an authentication fail, please request a new token.

"},{"location":"faq/#can-i-use-my-api-key-in-a-public-repository","title":"Can I use my API key in a public repository?","text":"

Storing your API keys or any other sensitive information in a public repository must be avoided at all costs to prevent malicious access to your APIs, which could result in unwanted usage bills.

In order to protect our users, we automatically revoke API keys that are publicly searchable. We recommend that you store your keys as environment variables rather than hard-coding them in your script. For more information, see this article on best practices for secure API key storage.

"},{"location":"faq/#why-has-my-api-key-been-revoked","title":"Why has my API key been revoked?","text":"

We automatically revoke publicly searchable API keys to prevent unwanted charges to your account. To prevent this from happening, you should read your API key from a system environment variable rather than putting it in the source code you commit to GitHub. If you need to get a new API key, please go to My Self-Service Workspace.

"},{"location":"faq/#billing","title":"Billing","text":""},{"location":"faq/#how-is-billing-calculated-for-self-service-apis","title":"How is billing calculated for Self-Service APIs?","text":"

It is free to test and prototype with Self-Service APIs and you will enjoy a free monthly request quota in both the test and production environments.

When you exceed your free request quota in production, you will be billed for the additional calls you make at the rates indicated on our Pricing page, with no additional fees. Please note that prices vary from one API to another.

You can check your monthly usage and select your preferred payment method (credit card or bank transfer) in your Self-Service Workspace.

"},{"location":"faq/#how-do-i-request-a-refund-of-my-self-service-usage-bill","title":"How do I request a refund of my Self-Service usage bill?","text":"

If you're a Self-Service API user, please send your refund requests via the contact us and our team will carefully analyse them. You will be notified if your refund is approved and be reimbursed within the following days (please note that refund processing times may vary depending on your bank).

"},{"location":"faq/#where-can-i-find-my-invoices","title":"Where can I find my invoices?","text":"

You will receive your invoices on a monthly basis from data.distribution@amadeus.com. Please note that once opened, you will not be able to open the same invoice again.

"},{"location":"faq/#test-collection","title":"Test collection","text":""},{"location":"faq/#is-there-a-limit-to-the-calls-i-can-make-to-self-service-apis-in-the-test-environment","title":"Is there a limit to the calls I can make to Self-Service APIs in the test environment?","text":"

Yes, each Self-Service API in test includes a limited number of free monthly calls. This free request quota varies from one API to another and it applies to the sum of all your applications. If you exceed the quota in test, you'll receive a 429 error code in JSON.

To see how many free requests remain, log into your account and check your API usage & quota in your Workspace area. Please keep in mind that it can take up to 12 minutes for data to appear.

Your free request quota should be sufficient for testing purposes. If you need to increase your number of monthly API calls, please consider moving your application to production. The process is quick and simple and you will keep the free request quotas you enjoyed in test.

"},{"location":"faq/#what-should-i-do-if-im-about-to-reach-my-self-service-free-request-quota-limit","title":"What should I do if I'm about to reach my Self-Service free request quota limit?","text":"

The test environment is designed for testing purposes. Every month, you'll receive a free request quota to build and test your app. If you need to increase your number of monthly API calls, please move your application to production. The process is quick and easy, and you will keep the free monthly request quota you enjoyed in test. Once you exceed your quota in production, you will be billed for the additional API calls you make.

"},{"location":"faq/#is-there-a-limit-to-the-calls-i-can-make-to-self-service-apis-in-the-production-environment","title":"Is there a limit to the calls I can make to Self-Service APIs in the production environment?","text":"

There is no consumption limit in production, as long as there are no outstanding usage bills and your account's payment method is up to date.

"},{"location":"faq/#why-do-i-get-a-429-error-in-json-if-i-have-some-free-calls-left","title":"Why do I get a 429 error in JSON if I have some free calls left?","text":"

After making API call, it can take up to 12 minutes for the data to appear on your usage & quota page. If you are nearing your limit free request quota limit and receive a 429 error, it's likely that you have run out of free calls.

To keep using the APIs, you can either move your app to production or wait until the free request quota is reset at the beginning of each month.

"},{"location":"faq/#why-do-i-get-an-error-code-429-when-i-call-a-self-service-api","title":"Why do I get an error code 429 when I call a Self-Service API?","text":"

This error indicates you carried out too many requests and went over your limit of free calls for this API.

If you wish to keep using the APIs, you can either move your app to production and enter your preferred payment method or alternatively wait until the following month to get more free calls.

"},{"location":"faq/#is-the-data-returned-in-the-self-service-test-environment-accurate","title":"Is the data returned in the Self-Service test environment accurate?","text":"

The information returned in test environment is from limited data collections. This is done as a security measure to protect our data and our customers. When you move to production, you will get access to complete and live data.

"},{"location":"faq/#flight-inspiration-search","title":"Flight Inspiration Search","text":""},{"location":"faq/#why-didnt-i-get-any-results-for-flight-inspiration-search","title":"Why didn't I get any results for Flight Inspiration Search?","text":"

This API works with cached data in the test environment and not all airports are cached. You can find a list of airports included in the cached data in our guides section. When combining these searches with the Airport Nearest Relevant API, it is better to search using the city code rather than the airport code.

"},{"location":"faq/#why-are-some-origin-and-destination-pairings-not-returning-results","title":"Why are some origin and destination pairings not returning results?","text":"

The Flight Inspiration Search and Flight Cheapest Date Search APIs are built on top of a pre-computed cache of selected origin-destination pairs. This is why, even in production, you cannot find all possible origin-destination pairs. If you need to access more results, you need to use the live Flight Offers Search API.

"},{"location":"faq/#airport-routes","title":"Airport routes","text":""},{"location":"faq/#the-api-returns-an-airport-that-has-been-permanently-closed","title":"The API returns an airport that has been permanently closed","text":"

This is the expected behavior. The IATA code in the response corresponds to the Destination City IATA code but not the Airport Code.

"},{"location":"faq/#airport-nearest-relevant-api","title":"Airport Nearest Relevant API","text":""},{"location":"faq/#why-isnt-the-airport-nearest-relevant-api-returning-a-specific-airport-near-me","title":"Why isn't the Airport Nearest Relevant API returning a specific airport near me?","text":"

This may be because an airport is near a national boarder. If so, please check the API parameters for location. Also, please keep in mind that our Airport Nearest Relevant API excludes private and military airports.

"},{"location":"faq/#flight-offers-search","title":"Flight Offers Search","text":""},{"location":"faq/#why-are-the-prices-returned-more-expensive-than-on-other-websites","title":"Why are the prices returned more expensive than on other websites?","text":"

The API only returns published rates, which are the standard rates given by airlines. Amadeus then redistributes them to the travel agencies around the world. However, big players in the industry can negotiate their rates directly with the airlines, which can help them be more competitive or maximise returns made form selling tickets.

"},{"location":"faq/#what-does-nonhomogeneous-mean-in-the-api-response","title":"What does nonHomogeneous mean in the API response?","text":"

PNRs are designed to be homogeneous, meaning that one PNR contains the same type of content (e.g., flights only) and number of passengers. However, nowadays, there can be a mix of different content, such as air and hotel. When nonHomogeneous is true, it means that a single PNR can contain records that would initially be split across different PNRs.

"},{"location":"faq/#why-the-datawindow-parameter-returns-less-results-with-i3d-or-i2d","title":"Why the dataWindow parameter returns less results with I3D or I2D?","text":"

This is normal behaviour. Flight Offers Search returns the cheapest option for all flights. When you request an extra delay in the search (+/- xDays), Flight Offers Search takes a matching flight (i.e., AF111), checks all possible days, and returns only the cheapest offers. Using more filters does not increase the number of results. It increases the range of data the API uses to find the cheapest offers to return. Having fewer options between 'I3D' and 'I2D' is normal. With 'I2D,' you most likely compare a working week with very regular flights, and with 'ID3,' you always include weekend flights on top, so there are more options.

"},{"location":"faq/#how-can-i-add-a-loyalty-program-to-a-booking","title":"How can I add a loyalty program to a booking?","text":"

Flight Offers Price and SeatMap Display both accept frequent flyer information, so end-users can benefit from their loyalty program. When adding frequent flyer information, please remember that each airline policy is different, and some require additional information like passenger name, email, or phone number to validate the account. If validation fails, your user won\u2019t receive their loyalty program advantages.

"},{"location":"faq/#post-and-get-do-not-return-the-same-results","title":"POST and GET do not return the same results","text":"

By default the GET method does not return airlines blacklisted in Europe. However, users can override this using the POST method.

"},{"location":"faq/#how-do-i-add-bags-to-a-check-in-bag-for-flight-reservation","title":"How do I add bags to a check in bag for flight reservation?","text":"

You can add a checked-in bag to a flight booking using the \u2018\u2019additionalServices\u2019\u2019 element in the flight offer when calling Flight Offers Price. For more details, please check our guide on adding baggage with Amadeus flight booking APIs.

"},{"location":"faq/#how-do-i-add-bags-to-a-cabin-bag-for-flight-reservation","title":"How do I add bags to a cabin bag for flight reservation?","text":"

Our APIs do not return cabin bag information in the responses, and it is not possible to add an additional cabin bag to a booking.

"},{"location":"faq/#can-i-display-the-price-of-flights-using-air-milesloyalty-points-and-book-a-flight","title":"Can I display the price of flights using air miles/loyalty points and book a flight?","text":"

Our Self-Service APIs do not let you display the prices in loyalty points or book a flight using loyalty points.

"},{"location":"faq/#why-are-some-taxes-refundable","title":"Why are some taxes refundable?","text":"

A refundable tax is a type of tax or fee that is collected when you purchase an airline ticket but can be refunded to the passenger under certain circumstances, these conditions will vary depending on the specific country and airline.

"},{"location":"faq/#how-can-i-integrate-flight-booking","title":"How can I integrate flight booking?","text":"

You can integrate flight booking using our Self-Service APIs. Production access is subject to certain requirements, including being registered in one of our approved markets, meeting your local legal requirements, and working with an airline consolidator to issue tickets.

The booking flow involves the following APIs: - Flight Offers Search: to search for the best bookable flight offers. - Flight Offers Price: confirms the latest price and availability of a specific chosen flight. - Flight Create Orders: to book flights and ancillary services proposed by the airline. - Flight Orders Management: to manage and consult your bookings. This API also includes an endpoint to cancel the reservation.

Once you generate a booking in production, your consolidator will receive it in their back office and issue the tickets from there. After the ticket has been issued, you will need to contact your consolidator for any modifications to the booking or refund requests. For more information on flight booking please check our guide on how to build a flight booking engine.

"},{"location":"faq/#do-you-provide-co2-emission","title":"Do you provide Co2 emission?","text":"

You can return Co2 emissions for a flight only after booking it. The information will be included in the response of Flight Create Orders API.

"},{"location":"faq/#what-are-fare-rules","title":"What are fare rules?","text":"

Fare rules are a set of conditions that determine the price of an air ticket for each seat class. They also define whether a ticket is refundable/nonrefundable or whether additional charges are applicable. You can return those with our Self-Service APIs using Flight Offers Price and adding ''include=detailed-fare-rules'' in your base URL:

https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules

Please keep in mind that this will return the fare rules in a raw format. If you want a structured version of these, you will need to use our Enterprise APIs.

"},{"location":"faq/#do-you-return-airline-logos","title":"Do you return airline logos?","text":"

We do not return airline logos in our Self-Service catalog.

"},{"location":"faq/#flight-offers-price","title":"Flight Offers Price","text":""},{"location":"faq/#how-can-we-get-information-on-refundable-flights","title":"How can we get information on refundable flights?","text":"

To get the refund policy for a specific flight, you will need to use the Flight Offers Price API, with the parameter include set to detailed-fare-rules at the endpoint of the URL as follows: https://api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules

"},{"location":"faq/#flight-price-analysis","title":"Flight Price Analysis","text":""},{"location":"faq/#why-do-some-origin-and-destination-pairings-not-return-any-results","title":"Why do some origin and destination pairings not return any results?","text":"

Not all possible routes are supported by the API even in production. The reason is that the machine learning model filters out all the routes with an error rate below 15% MAPE (Mean absolute percentage error). For more insights on how the model works, please refer to this blog post.

"},{"location":"faq/#flight-delay-prediction","title":"Flight Delay Prediction","text":""},{"location":"faq/#why-do-i-get-the-inference-error","title":"Why do I get the INFERENCE error?","text":"

This means the requested origin/city pairing was not included in our training data. So, we have no previous information on whether that flight is normally delayed or not.

"},{"location":"faq/#flight-cheapest-date-search","title":"Flight Cheapest Date Search","text":""},{"location":"faq/#why-are-some-origin-and-destination-pairings-not-returning-results_1","title":"Why are some origin and destination pairings not returning results?","text":"

The Flight Inspiration Search & Flight Cheapest Date Search APIs are built on top of a pre-computed cache of selected origin-destination pairs. This is why, even in production, you cannot find all possible origin-destination pairs. To access more results, you need to use the live Flight Offers Search API.

"},{"location":"faq/#why-do-i-get-the-500-error-message","title":"Why do I get the 500 error message?","text":"

The 500 error message 'SYSTEM ERROR HAS OCCURRED', 'detail': 'Primitive Timeout' is caused by the search being too generic, and the API taking too much time to fetch the data. Unfortunately, there is nothing we can do about this for now. The solution will be to filter the search down using more parameters.

"},{"location":"faq/#flight-availabilities-search","title":"Flight Availabilities Search","text":""},{"location":"faq/#why-are-some-travel-classes-not-returned-in-the-search-results","title":"Why are some travel classes not returned in the search results?","text":"

Travel class is not standardized, and some airlines may use different letters for the same travel class. For example, All Nippon Airways does not use 'Class: I'. By default, this API excludes closed booking classes, departed flights, and cancelled flights. To return closed content, you can use the parameter includeClosedContent and set it to true.

"},{"location":"faq/#branded-fares-upsell","title":"Branded Fares Upsell","text":""},{"location":"faq/#why-do-additional-services-change-between-segments-in-an-itinerary","title":"Why do additional services change between segments in an Itinerary?","text":"

Additional services can change between segments in an itinerary. For example, a passenger could end up with a checked bag which is allowed in one of the segments of an itinerary but not on the others (because of its weight or because it's not included at all). This is normal behavior for this API. The packages are created at the flight level. This means that even an itinerary made up of two flights from the same airline could have different upsell options. Additionally, not every airline will have the option to upsell.

"},{"location":"faq/#seatmap-display","title":"SeatMap Display","text":""},{"location":"faq/#is-there-any-way-to-request-a-seat-map-by-cabin-instead-of-having-to-specify-a-booking-class-code","title":"Is there any way to request a seat map by cabin instead of having to specify a booking class code?","text":"

There is no way to specify a cabin, but you will get this information in the response of Flight Offers Search. This will allow you to filter based on that.

"},{"location":"faq/#why-do-i-get-the-error-code-4926","title":"Why do I get the error code 4926?","text":"

Returning the error: 'warnings': [{'code': 4926, 'title': 'INVALID DATA RECEIVED', 'detail': 'Invalid departure/Arrival city pair'}] is caused by airlines choosing not to display the seat map of some flights, so the API returns a warning with the information we have.

"},{"location":"faq/#seatmap-not-available-as-flight-operated-by-another-carrier","title":"Seatmap not available as flight operated by another carrier","text":"

This error is generated when the specified flight in the query is a codeshare, and no agreement exists with the operating flight. Unfortunately, the only way to mitigate this in the future is to avoid calling the SeatMap Display API with this specific operating carrier.

"},{"location":"faq/#why-am-i-unable-to-retrieve-seatmap-data","title":"Why am I unable to retrieve seatmap data?","text":"

This error message means that the airline never filled in a seat map for the specific flight. It's usually not generic to all flights of the airline. Unfortunately, there is no solution for this one.

"},{"location":"faq/#what-does-available-blocked-and-occupied-mean-in-the-response","title":"What does AVAILABLE, BLOCKED, and OCCUPIED mean in the response?","text":"
  • AVAILABLE: the seat is\u202fnot occupied\u202fand\u202fis\u202favailable to book.
  • BLOCKED:\u202fthe seat is not occupied but isn\u2019t\u202favailable to book for the user. This is usually due to the passenger type (e.g., children may not sit in exit rows), or their fare class (e.g., some seats may be reserved for travelers in higher classes).
  • OCCUPIED: the seat is\u202foccupied\u202fand\u202funavailable to book.
"},{"location":"faq/#flight-create-orders-api","title":"Flight Create Orders API","text":""},{"location":"faq/#how-are-tickets-issued-for-flights-booked-with-flight-create-orders-in-self-service","title":"How are tickets issued for flights booked with Flight Create Orders in Self-Service?","text":"

For Self-Service users, ticketing must be done via airline consolidator. Airline consolidators are essentially air ticket wholesalers that have special arrangements with airlines and, among other functions, can serve as host agencies for travel agents without the necessary IATA/ARC certifications necessary to issue tickets.

To access Flight Create Orders in production, you must have a contract signed with a consolidator for ticket issuance. If you need help finding a consolidator, please contact our support team to put in touch with the best consolidator in your region.

"},{"location":"faq/#how-can-i-retrieve-booking-made-with-flight-create-orders-in-self-service","title":"How can I retrieve booking made with Flight Create Orders in Self-Service?","text":"

You can consult booking made through Flight Create Orders using the Flight Order Management API. This API works using a unique identifier(the flight offer id) that is returned by the Flight Create Orders API.

"},{"location":"faq/#does-amadeus-pay-a-commission-for-flights-booked-with-flight-create-orders-in-self-service","title":"Does Amadeus pay a commission for flights booked with Flight Create Orders in Self-Service?","text":"

Generally, Amadeus does not offer booking commissions for Self-Service users.

"},{"location":"faq/#why-do-i-get-the-invalid-data-received-error","title":"Why do I get the INVALID DATA RECEIVED error?","text":"

Getting the error message: INVALID DATA RECEIVED. Some of the data in the query is false. It could be that the fare does not match the traveling class, or that the flight number is incorrect. This is common to all our APIs. It comes from the API backend validating your query. All the fields of the price reply should be exactly the same as the one from the book query to be sure there is a problem.

"},{"location":"faq/#why-do-i-get-the-segment-sell-failure-error","title":"Why do I get the SEGMENT SELL FAILURE error?","text":"

Getting the error message: SEGMENT SELL FAILURE means that you were not able to book the seat in the airline inventory. Most of the time, it comes from the flight being full. This often happens in the test environment, as you can perform many bookings without restrictions (no real payment). But the inventory is a copy of the real one, so if you book many seats, the inventory can get empty and you won't be able to book anymore. The good practice here is to use Flight Offers Price right before booking and avoid last-minute flights that tend to quickly get full.

"},{"location":"faq/#how-does-payment-work-when-i-book-a-flight","title":"How does payment work when I book a flight?","text":"

There are two things to consider regarding payments for flight booking:

  1. The payment between you (the app owner) and your customers (for the services provided + the price of the flight ticket). You decide how to collect this payment. It is not included in the API. A third-party payment gateway, like Stripe for example, will be the easiest solution for this.

  2. The payment between you and the consolidator (to be able to pay the airline and issue the flight ticket). This will be done between you and your consolidator of choice and is to be agreed upon with the consolidator.

"},{"location":"faq/#how-can-i-cancel-a-flight","title":"How can I cancel a flight?","text":"

Cancellation is possible with the Flight Orders Management API as long as the booking has not been issued by the consolidator yet. If the booking has been issued, it will need to be canceled by the consolidator directly.

"},{"location":"faq/#how-to-make-the-airline-consolidator-wait-before-issuing-a-ticket","title":"How to make the airline consolidator wait before issuing a ticket?","text":"

You can delay ticketing using the ticketingAgreement parameter in Flight Create Orders. For this, you can use the following options:

  • DELAY_TO_QUEUE: this allows you to queue the reservation for the desired date if the traveller does not make the payment.
  • DELAY_TO_CANCEL: if the traveler does not make the payment, the reservation for the desired date will be cancelled.

The queuing and cancellation take place based on the local date and time. If no specific time is mentioned, the reservation is queued or cancelled at 00:00.

"},{"location":"faq/#can-i-markup-prices-of-flight-tickets-sold","title":"Can I markup prices of flight tickets sold?","text":"

Yes you are free to add a markup on any flight ticket. This must be done through your own payment gateway.

"},{"location":"faq/#how-can-i-modify-my-booking-once-the-ticket-is-issued","title":"How can I modify my booking once the ticket is issued?","text":"

This is not possible through our Self-Service APIs. Once a ticket has been issued you will need to contact the consolidator for any changes, and this will be subject to a fee. In case the ticket has not been issued. You will need to delete the booking and rebook with the modifications.

"},{"location":"faq/#hotel-search-book","title":"Hotel Search & Book","text":""},{"location":"faq/#what-are-guarantee-deposit-and-prepay","title":"What are guarantee, deposit and prepay?","text":"
  • Guarantee: The hotel will save credit card information during booking but will not make any charges to the account. In the case of a no-show or out-of-policy cancellation, the hotel may charge penalties to the card.
  • Deposit: At the time of booking or on a given deadline, the hotel will charge the guest a percentage of the total amount of the reservation. The remaining amount is paid by the traveler directly at the hotel.
  • Prepay: The traveler must pay the total amount of the reservation during booking.
"},{"location":"faq/#what-is-the-total-price","title":"What is the total price?","text":"

The price total refers to the total price to be paid for the full stay. The variations, on the other hand, represent the average price per night. In the example you highlighted, a guest will need to pay \u20ac548.56 for the three nights, and the average price for the room is \u20ac182.85 per night (\u20ac548.55 overall). For more details, you can refer to our data model found in the OpenAPI specification of the Hotel Search API.

"},{"location":"faq/#what-is-the-latest-possible-date-for-check-in","title":"What is the latest possible date for check-in?","text":"

The maximum date for the 'checkInDate' parameter is 359 days from today. Anything beyond this will return the error message 'MAXIMUM ADVANCE DAYS BOOKING EXCEEDED'.

"},{"location":"faq/#how-to-search-a-hotel-by-location","title":"How to search a hotel by location","text":"

Regarding the input for a specific location in a hotel search, you have the following options:

  • Since the commissioning of Hotel Search v3, we can no longer search hotels by IATA codes. In order to search by location you will need to use the third endpoint of Hotel List /reference-data/locations/hotels/by-geocode, which allows you to search using a latitude & longitude. The Hotel List API returns hotelIds based on the specific search coordinates. You will then need to use this hotelId in the third endpoint of the Hotel Search API.

  • Alternatively, you can use the Google API to retrieve the geo location of a specific location and use the Hotel Search by geo location.

"},{"location":"faq/#what-type-of-payments-are-supported","title":"What type of payments are supported?","text":"

The current version of the Hotel Booking API only supports credit card payments. The Hotel Search API returns the payment policy of each hotel under acceptedPayments in the policies section.

"},{"location":"faq/#can-i-markup-the-room-prices","title":"Can I markup the room prices?","text":"

It is not possible to markup the prices of the hotel rooms with the current version of the Hotel Booking API. The reason is that the content we offer today in our Hotel Search/Book API is post-paid, meaning the traveler will pay directly at the hotel. The Hotel Booking API is here to enable making a reservation but not to pay directly. We are working on adding more hotel offers, especially offers that will be pre-paid, meaning you will be able to charge the travelers directly and add a markup. However, you still need to add a credit card while booking in case of cancellations or no-shows.

"},{"location":"faq/#payment-providers-and-gateways","title":"Payment providers and gateways","text":"

The Hotel Booking API works by using the guest's payment information and sending it to a chosen hotel for the reservation. You can use a payment gateway in your app, but this will not change the way the API works. The hotels will never collect any money from you. Instead, the payments are always done at the time of checkout between the guest and the hotel. During the booking process, Amadeus passes the payment and guest information to the hotel but does not validate information, so it doesn\u2019t play the role of payment gateway. Be sure to validate the payment and guest information as invalid information may result in the reservation being canceled. As soon as your application stores, transmits, or processes cardholder information, you will need to comply with the PCI Data Security Standard (PCI DSS). For more information, visit the PCI Security Council website.

"},{"location":"faq/#how-can-i-cancel-a-room-booking","title":"How can I cancel a room booking?","text":"

As of now, the hotel booking API does not allow canceling rooms. If this option is possible with your hotel offer, the cancellation will have to be done manually with the hotels. We are working on an API for the cancellation; however, it is still too soon to commit to anything.

"},{"location":"faq/#why-do-i-get-500-status-code","title":"Why do I get 500 status code?","text":"

The process of booking a hotel in the test environment involves sending your request to each hotel provider, and each provider has its own environment and rules. Due to these differences, there may be connectivity issues with the providers that can result in a timeout. Additionally, if many requests are sent to a particular hotel, they may choose to block them. If you provide us with a timestamp and details of another API request that has failed, including the hotel in question, we can search our logs to find more information. However, it is likely that the issue is one of the aforementioned cases.

"},{"location":"faq/#how-can-i-see-amadeus-api-coverage-for-a-hotel-chain","title":"How can I see Amadeus API coverage for a hotel chain?","text":"

You can find the list of supported hotel chains in our data collection.

"},{"location":"faq/#what-is-considered-a-query","title":"What is considered a query?","text":"

When you make an initial call to the Hotel Search API with a cityCode parameter, it is considered one query that returns 10 hotels. If you then click on each hotel to view room details and other information, you are making additional API calls using the second endpoint of the Hotel Search. Each hotel that you click on generates another API call. For example, if you click on 5 hotels to see room details, you will be making a total of 5 additional queries.

"},{"location":"faq/#do-i-need-any-legal-documents-to-make-a-booking","title":"Do I need any legal documents to make a booking?","text":"

No, there are no legal documents required. However, you will need to comply with any local legal requirements for your market.

"},{"location":"faq/#what-are-the-room-type-codes","title":"What are the room type codes?","text":"

The room type code is a 3-character identifier that indicates the room type category, the number of beds, and the bed type. However, some hotels may not follow this pattern and instead use custom types. In such cases, the room description is the best way to understand the room type.

"},{"location":"faq/#how-do-i-cancel-a-hotel","title":"How do I cancel a hotel?","text":"

There is no way to cancel hotel bookings through the APIs. This needs to be done offline by ringing the hotels.

"},{"location":"faq/#why-is-hotel-search-returning-empty-responses-data","title":"Why is Hotel Search returning empty responses \u2018{\"data\": []}\u2019?","text":"

You are returning this because this specific hotel is closed or unavailable for this specific date. You can either try to change the check-in date or use the ''includeClosed'' parameter set to ''true''. The latter will return further information on the hotel, but you will not be able to book it.

"},{"location":"faq/#do-you-return-hotel-images","title":"Do you return hotel images?","text":"

Hotel images are not available through our Self-Service catalog.

"},{"location":"faq/#airline-consolidators","title":"Airline consolidators","text":""},{"location":"faq/#what-is-an-airline-consolidator","title":"What is an airline consolidator?","text":"

Airlines consolidators are wholesalers of air tickets. They usually partner with airlines to get negotiated rates for air tickets, and then resell the air tickets to travel agents or consumers.

Many airlines consolidators act as host agencies for retail travel agencies or online travel agency startups that do not have the license from the International Air Transport Association (IATA) to issue air tickets. To issue air tickets via airline consolidators, the travel startups have to settle commercial agreements with the airline consolidators in the markets in which they want to operate.

It is to be noted that not all the airline consolidators provide post-ticketing services such as monitoring and notifying travel agencies about schedule changes and flight cancellations. This is something that startups have to check with their potential airline consolidators.

"},{"location":"faq/#how-are-payments-handled-with-my-consolidator","title":"How are payments handled with my consolidator?","text":"

Different airline consolidators handle payments in different ways. In some cases, you will be asked to make an initial deposit to cover future ticketing charges. In other cases, you will be billed monthly for the services consumed. Please contact our support team or refer to your airline consolidator contract for more details.

"},{"location":"faq/#how-do-i-handle-cancellations-changes-and-post-booking-services-for-bookings-made-with-flight-create-orders-in-self-service","title":"How do I handle cancellations, changes and post-booking services for bookings made with Flight Create Orders in Self-Service?","text":"

For Self-Service users, all post-booking services must be handled offline with the consolidator you work with for ticket issuance. In general, these actions can be made while the Passenger Name Record (PNR) is queued for ticketing (before the ticket is issued), though their availability once a ticket has issued depends largely on the consolidator and the clauses of your agreement.

"},{"location":"faq/#how-can-i-get-a-consolidator","title":"How can I get a consolidator?","text":"

Before requesting a consolidator, please first make sure that you are in one of the approved markets for Flight Create Orders. You need it to implement flight booking in Self-Service. Once this is verified, please go to the Support section and get in touch with us using the Contact form.

"},{"location":"faq/#how-do-i-handle-refunds-for-flights-booked-with-flight-create-orders-in-self-service","title":"How do I handle refunds for flights booked with Flight Create Orders in Self-Service?","text":"

Refunds must be handled offline directly with your consolidator.

"},{"location":"faq/#can-i-use-multiple-consolidators","title":"Can I use multiple consolidators?","text":"

Yes you can use different consolidator, but you will need to tell us so we can connect both your accounts. Once we open the access, you can decide where you want your booking to go using the \u2018\u2019queuingOfficeId\u2019\u2019 parameter in the Flight Create Orders request.

"},{"location":"faq/#destination-experiences","title":"Destination Experiences","text":""},{"location":"faq/#do-you-provide-tours-and-activities-at-destination","title":"Do you provide tours and activities at destination?","text":"

You can search and book activities with our Tours and Activities API. It includes 300,000 activities around the world, such as sightseeing tours, days trips, and museum tickets. The API provides a list of top activities for a given location, including the prices, ratings, descriptions, photos, as well as a deep link to complete the booking with the provider.

"},{"location":"faq/#what-are-the-tags-returned-in-points-of-interest","title":"What are the tags returned in Points of Interest?","text":"

The Points of Interest API returns the following tags:

food, schools, beauty&spas, commercialplace, outdoorplace, tourguide, health&hospital, health&medicalcenter, trail, health&medical, professionalservices, busline, honeymoonpackages, bakery, rental, newspaper, garden, generic, gift, vineyard, cityhall, sport, beauty&hairsalon, beauty&nailsalon, pet, market, machines, icecream, secondhand, communitycenter, toy, kids, health&seniorcenter, daycare, education, rugby, smoke, cemetery, harbor, laundromat, optical, cheese, financialservices, bank, field, college, car, florists, pharmacy, games, atm, building, university, mobilephone, center, donuts, beauty&barbershop, road, chocolate, tattoo, militarybase, surfing, lighthouse, cottage, square, cricket, patio, fusion, health&alternative, printing, basketball, pier, bay, wildlifesanctuary, airlines, lottery, fairground, health&nursinghome, art, tunnel, ski, gunroom, gunrange, camping, meat, antique, discount, prison, servicestation, thriftshop, gayfriendly, skate, creperie, electronic, petrolshelf, street, culturalcenter, volleyball, merchandise, popcorn, reservoir, sleepwear, beauty&professionals, firewall, drinkingwater, publicplace, quarries, health&services, prosthetics, industrialestate, american, mexican, internet, ignore, military, natural, canadian, technology, indian, tea, salon, beer, coffee, spanish, arts, communications, irish, french, river, neighbourhoodsandvillages, celebrities, office, social, japanese, institute, peruvian, british, continental, wine, brazilian, chinese, asian, italian, beauty, hair, religious, mediterranean, generic, african, portuguese, greek, farm, deli, german, european, ocean, english, religiousorganization, basque, latin, family, russian, austrian, southern, accessories, vegetarian, middleeastern, vietnamese, chicken, caribbean, lebanese, cosmetics, cuban, telecommunication, vegan, drink, design, moroccan, texmex, turkish, hawaiian, security, dining, contemporary, cajun, australian, korean, persian, pakistani, eating, painting, pet, bed&breakfast, bar, cooking, latte, ignore, chinese, nature, noodles, game, dating, automotive, car, electrician, funeral, travel, wedding, firestation, tvandradio, environmental, farm, agriculture, company, realestate, eyedoctor, campground, hostel, hotel, inn, lodging, motel, resort, corporatehousing, hiking, golf, events, sports, theater, gym, neighborhood, locality, city, island, region, home, office, dealership, storage, butcher, courthouse, radiostation, conferenceroom, insurance, dentist, photographer, animalshelter, coach, chiropractor, gardener, music, architect, nutritionist, apartments, vacationrental, yoga, tennis, nightlife, bodega, burrito, dance, skating, activelife, basketball, beach, baseball, state, shoppingdistrict, home, pet, veterinarian, mediaproduction, wholesale, factory, plumber, legal, government, fooddelivery, health, doctor, physicaltherapist, mobilehomes, police, conventioncenter, auctionhouse, religiousplace, coworkingspace, recycling, armedforces, marketing, publicservice, stadium, skydiving, sportclub, cine, zoo, massage, cricket, country, lawyer, design, childcare, carpenter, startup, financial, building, painter, retailer, graphicdesign, optometrists, transport, postoffice, itservices, spiritualcenter, distributor, embassy, recruiter, counseling, mover, tailor, festival, huntingandfishing, horseriding, lasertag, paintball, submarinism, rafting, surfing, climbing, summercamp, skate, gamingcafe, province, castle, operahouse, seamstress, hockey, mining, manufacturers, repair, accountant, chamberofcommerce, restorer, lab, publisher, pharmaceutical, psychologist, entertainer, energy, laborunions, traditional, pilates, stargazing, martialarts, rodeo, circus, karting, cheerleading, leisure, classiccuisine, traditionalcuisine, eco, floatels, accommodation, brewery, club, musicvenue, nightclub, pub, restaurant, barbecue, breakfast, buffet, burger, cheap, coffee, fastfood, foodtruck, gastropub, grills, hotdogs, internetcoffe, noodle, pizza, ramen, sandwich, seafood, activities, aquarium, attraction, banquethalls, bike, bowlingalley, casino, snack, steakhouse, sushi, taco, tapas, tea, thai, vegetarian, shopping, baby, bags, boutique, clothing, fashion, home, jewelry, library, liquor, mall, musicstore, outlet, perfume, personalcare, shoe, watches, supermarket, bridge, forest, garden, marina, marine, picnic, restarea, river, beach, capitol, church, lake, mosque, mountain, river, statuary, synagogue, temple, sightseeing, artgallerie, landmark, museum, sights, bridge, capitol, church, historicplace, marina, mosque, palace, synagogue, temple, buddhist, transport, airport, bus, busstation, busstop, gasstation, heliport, metro, metrostation, parking, port, taxi, train, trainstation, tram, boating, boating, park, italiancuisine, juicebar, bathingarea, fountain, statue, volcano, chargingstation, bistro, brasserie, churrasco, foodstand, mediterraneancuisine, moderncuisine, regionalcuisine, snackbar, spanishcuisine, swissfood, souvenir, amusementpark, boat, historic, japanese, guesthouse, camping, archery, bingohall, birdwatching, luxurybybrand, luxuryname, luxury.

"},{"location":"faq/#cars-transfers","title":"Cars & Transfers","text":""},{"location":"faq/#who-are-the-providers-available-in-the-car-transfers-apis","title":"Who are the providers available in the Car & Transfers APIs?","text":"

The Transfers APIs will allow you to offer private transfers, hourly services, taxis, shared transfers, airport express, airport buses, private jets, and helicopter transfer. The API uses the following providers:

Name Code Drivania DRV Eco Rent A Car ECO EZ Shuttle ZA ESZ FlygTaxi FGT Get-E GET GroundScope GSE GroundSpan GSN HolidayTaxis HTX iVcardo IVC JPD Transport JPD Servantrip SVP Sixt Ride SMD SuperShuttle SPS Svea Taxi Allians TXB Talixo TXO Taxibokning TXB TaxiTender TXT World Transfer WTR"},{"location":"faq/#technical-support","title":"Technical support","text":""},{"location":"faq/#what-kind-of-support-does-amadeus-for-developers-offer","title":"What kind of support does Amadeus for Developers offer?","text":"

There are two different support paths available based on our two different offer: Self-Service and Enterprise.

  1. Self-Service users have at their disposal detailed documentation, guides and SDKs, to help them solve any doubts they may have. Check the Self-Service Docs page for more information. For any other Self-Service support queries, such as billing issues or a refund request, please go to the support section and click on contact us about Self-Service support.

Important

Contact Support You need to be registered and signed in to reach out to the Self-Service support.

  1. Enterprise users have access to dedicated support. If you are an Enterprise user, get in touch with your Account Manager or open a ticket via the Amadeus Service Hub.
"},{"location":"faq/#where-do-i-go-for-self-service-technical-support-what-does-it-cost","title":"Where do I go for Self-Service technical support? What does it cost?","text":"

If you are a Self-Service customer experiencing a technical issue, you should do the following:

  1. First, look for an answer in our Self-Service APIs Docs and this FAQs page. We update this page regularly with explanations on fixing common issues.
  2. Search for a solution in Stack Overflow, or ask the community for help. Our developer advocacy team actively monitors and answers the questions on Stack Overflow that relate to our APIs.
  3. Finally, if you are still experiencing a problem with Self-Service APIs, you can get in touch with our developer advocates via the contact form in the Support page. We will try to get back to you as quickly as possible, however please understand that in times of high demand we may not be able to guarantee a prompt answer.
"},{"location":"faq/#do-you-offer-phone-support-for-self-service-apis","title":"Do you offer phone support for Self-Service APIs?","text":"

We do not currently offer phone support for Self-Service APIs. If you need assistance you can get in touch with our Developer Advocates via the contact form in the Support page. Please keep in mind that in times of high demand we may not be able to guarantee a prompt answer.

"},{"location":"faq/#how-can-i-report-bugs-or-suggest-improvements-to-the-self-service-section","title":"How can I report bugs or suggest improvements to the Self-Service section?","text":"

We love feedback from our community and it helps us create the best possible product for all users! If you want to report a bug or suggest improvements, please go to the Support section and get in touch using the Contact form.

"},{"location":"glossary/","title":"Key concepts","text":"

This page provides help with the most common terminology used across Amadeus Self-service APIs.

"},{"location":"glossary/#air-and-trip","title":"Air and Trip","text":"Term Definition Additional Baggage Luggage beyond the standard allowance provided by an airline, subject to additional fees. Aircraft Code IATA aircraft code . Airline Code Airline code following IATA or ICAO standard - e.g. 1X; AF or ESY. Airline consolidators Wholesalers of air tickets that usually partner with airlines to get negotiated rates for air tickets, and then resell the air tickets to travel agents or consumers. Amadeus Office ID An identification number assigned to travel agencies to access Amadeus system and book reservations. Amenities Additional services or features offered to enhance the experience of the passengers, such as food, entertainment, Wi-Fi, extra legroom, baggage allowance, frequent flyer programs, and lounge access. They can vary depending on the class of service and the airline/train company. Baggage allowance The amount of luggage that a passenger is allowed to carry on a flight without additional charges. Booking The process of reserving a seat on a flight or a room in a hotel. Cabin The section of an aircraft or train where passengers sit during their trip. It is divided into different classes, such as first class, business class, and economy class, each one with different amenities and prices. Commission Fee paid to intermediaries for booking travel-related services, usually a percentage of the total cost. Carrier Code 2 to 3-character IATA carrier code (IATA table codes). Country Code Country code following ISO 3166 Alpha-2 standard. Direct flight A flight that goes from one destination to another without any stops in between. Fare The price of a ticket for a particular flight or travel itinerary. Fare Rules The terms and conditions that apply to a specific airline ticket or fare, including restrictions and information on refunds, cancellations, changes, baggage, seat assignments, upgrades, and frequent flyer programs. Flight Order Id Unique identifier returned by the Flight Create Orders API . GDS (Global Distribution System) A computerized system used by travel agents and airlines to search for and book flights, hotels, rental cars, and other travel-related services IATA International Air Transport Association IATA Code Code used by IATA to identify locations, airlines and aircraft. For example, the Airport & City Search API returns IATA codes for cities as the iataCode parameter. ICAO International Civil Aviation Organization ISO8601 date format PnYnMnDTnHnMnS format, e.g. PT2H10M. Layover A stopover in a destination en route to the final destination. Location Id Amadeus-defined identifier that you can see in the search results when querying Self-Service APIs that retrieve information on geographical locations. Multi-stop flight A flight itinerary that includes stops at multiple destinations before reaching the final destination. Non-stop flight A flight that goes from one destination to another without any stops in between. Pricing The process of determining the cost of a product or service, in the context of travel it refers to the cost of airline tickets, hotel rooms, rental cars. PNR (Passenger Name Record) A record in a computer reservation system that contains the details of a passenger's itinerary and contact information. Round-trip A trip that includes travel to a destination and then back to the original departure point. Seatmap A map or diagram of the seating layout in the cabin of an aircraft or train. It shows the location of different types of seats, such as exit row, bulkhead seat, aisle seat, window seat. It can be used to choose a seat or to see the availability of seats for a certain flight. Ticketing The process of issuing a travel document, typically a paper or electronic ticket, that confirms that a passenger has purchased a seat on a flight, train, bus, or other form of transportation. It can be refundable or non-refundable, one-way or round-trip, and open-jaw. Travel Classes Differentiation of service level and amenities offered to passengers on an aircraft or train, like first class, business class, economy class."},{"location":"glossary/#hotel","title":"Hotel","text":"Term Definition Hotel Ids Amadeus Property Codes (8 chars). Comma-separated list of Amadeus Hotel Ids (max. 3). Amadeus Hotel Ids are found in the Hotel Search response (parameter name is hotelId)."},{"location":"glossary/#destination-content","title":"Destination content","text":"Term Definition Avuxi Amadeus' data provider on locations popularity. Activity Id Tours and Activities API returns a unique activity Id along with the activity name, short description, geolocation, customer rating, image, price and deep link to the provider page to complete the booking. GeoSure Amadeus's provider od data on locations crime rate, health and economic data, official travel alerts, local reporting and a variety of other sources. GeoSure GeoSafeScores Algorithm that analyzes crime, health and economic data, official travel alerts, local reporting and a variety of other sources."},{"location":"pagination/","title":"Pagination on Self-Service APIs","text":"

Amadeus for Developers Self-Service APIs can often return a lot of results. For example, when calling the Safe Place API, you may get a response hundreds of pages long. That's where pagination comes in. Using pagination, you can split the results into different pages to make the responses easier to handle.

Not all Amadeus Self-Service APIs support pagination. The following APIs currently support pagination:

  • Safe Place
  • Points of Interest
  • Airport Nearest Relevant
  • Airport & City Search
  • Flight Most Travelled Destinations
  • Flight Most Booked Destinations
"},{"location":"pagination/#accessing-paginated-results","title":"Accessing paginated results","text":""},{"location":"pagination/#using-sdks","title":"Using SDKs","text":"

Amadeus for Developers SDKs make it simple to access paginated results. If the API endpoint supports pagination, you can get page results using the the .next, .previous, .last and .first methods.

Example in Node:

amadeus.referenceData.locations.get({\n  keyword: 'LON',\n  subType: 'AIRPORT,CITY'\n}).then(function(response){\n  console.log(response.data); // first page\n  return amadeus.next(response);\n}).then(function(nextReponse){\n  console.log(nextReponse.data); // second page\n});\n

If a page is not available, the response will resolve to null.

The same approach is valid for other languages, such as Ruby:

response = amadeus.reference_data.locations.get(\n  keyword: 'LON',\n  subType: Amadeus::Location::ANY\n)\namadeus.next(response) #=> returns a new response for the next page\n

In this case, the method will return nil if the page is not available.

"},{"location":"pagination/#manually-parsing-the-response","title":"Manually parsing the response","text":"

The response will contain the following JSON content:

{\n  \"meta\": {\n     \"count\": 28,\n     \"links\": {\n        \"self\": \"https://api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55\",\n        \"next\": \"https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55&page%5Boffset%5D=10\",\n        \"last\": \"https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55&page%5Boffset%5D=18\"\n     }\n  },\n  \"data\": [\n     {\n       /* large amount of items */\n     }\n  ]\n}\n

You can access the next page of the results using the value of meta/links/next or meta/links/last node within the JSON response.

Note that indexing elements between pages is done via the page[offset] query parameter. For example, page[offset]=18. The next and last returned in the example above encode the special characters [] as %5B and %5D. This is called percent encoding and is used to encode special characters in the url parameter values.

"},{"location":"pricing/","title":"Pricing options for Amadeus Travel APIs","text":"

Amadeus for Developers provides two environments: test and production.

The test environment is the default environment for all new applications with access to a subset of the real data. This is where you will enjoy free request quota each month to build and test your apps.

The production environment gives you access to the full real-time data. When you move to production, you maintain your monthly free request quota and pay only for the additional calls you make.

Check out the pricing page to find out more about the pricing options.

"},{"location":"quick-start/","title":"Making your first API call","text":""},{"location":"quick-start/#step-1-create-an-account","title":"Step 1: Create an account","text":"

The first step to start using Amadeus Self-Service APIs is to register and create an account:

  • Open the Amadeus Developers Portal.
  • Click on Register.
  • Complete the form using a valid email address and click on the Create account button. An automatic confirmation email will be sent to the email address you provided.
  • In the confirmation email you receive, click on Activate your account.

You can now log in to the portal with your new credentials! Welcome to Amadeus for Developers!

"},{"location":"quick-start/#step-2-get-your-api-key","title":"Step 2: Get your API key","text":"

To start using the APIs, you need to tell the system that you are allowed to do so. This process is called authorization.

Danger

Remember that the API Key and API Secret are for personal use only. Do not share them with anyone.

All you need to do, is to attach an alphanumeric string called token to your calls. This token will identify you as a valid user. Each token is generated from two parameters: API Key and API Secret. Once your account has been verified, you can get your API key and API Secret by following these steps:

  • Sign in to the Developers Portal.
  • Click on your username (located in the top right corner of the Developers portal page)
  • Go to My Self-Service Workspace.

  • Click on Create New App button.

  • Enter your application details and click on Create.

Important

Test environment At this stage, you are using the testing environment, where you will enjoy a fixed number of free API call quotas per month for all your applications. When you reach the limit, you will receive an error message. This environment will help you build and test your app for free and get ready for deploying it to the market.

"},{"location":"quick-start/#step-3-calling-the-api","title":"Step 3: Calling the API","text":"

For our first call, let's get a list of possible destinations from Paris for a maximum amount of 200 EUR using the Flight Inspiration Search API, which returns a list of destinations from a given origin along with the cheapest price for each destination.

"},{"location":"quick-start/#creating-the-request","title":"Creating the Request","text":"

Before making your first API call, you need to get your access token. For security purposes, we implemented the oauth2 process that will give you an access token based on your API Key and API Secret. To retrieve the token, you need to send a POST request to the endpoint /v1/security/oauth2/tokenwith the correct Content-Type header and body. Replace {client_id} with your API Key and {client_secret} with your API Secret in the command below and execute it:

curl \"https://test.api.amadeus.com/v1/security/oauth2/token\" \\\n     -H \"Content-Type: application/x-www-form-urlencoded\" \\\n     -d \"grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}\"\n

Warning

Please take a look at our Authorization guide to understand how the process works in depth.

According to the documentation, you need to use v1/shopping/flight-destinations as the endpoint, followed by the mandatory query parameter origin. As you want to filter the offers to those cheaper than 200 EUR, you need to add the maxPrice parameter to your query as well.

Our call is therefore:

curl 'https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=PAR&maxPrice=200' \\\n      -H 'Authorization: Bearer ABCDEFGH12345'\n

Note how we add the Authorization header to the request with the value Bearer string concatenated with the token previously requested.

"},{"location":"quick-start/#evaluating-the-response","title":"Evaluating the Response","text":"

The response returns a JSON object containing a list of destinations matching our criteria:

{\n    \"data\": [\n        {\n            \"type\": \"flight-destination\",\n            \"origin\": \"PAR\",\n            \"destination\": \"CAS\",\n            \"departureDate\": \"2022-09-06\",\n            \"returnDate\": \"2022-09-11\",\n            \"price\": {\n                \"total\": \"161.90\"\n            }\n        },\n        {\n            \"type\": \"flight-destination\",\n            \"origin\": \"PAR\",\n            \"destination\": \"AYT\",\n            \"departureDate\": \"2022-10-16\",\n            \"returnDate\": \"2022-10-31\",\n            \"price\": {\n                \"total\": \"181.50\"\n            }\n        }\n    ]\n}\n

Congratulations! You have just made your first Amadeus for Developers API call!

"},{"location":"quick-start/#video-tutorial","title":"Video Tutorial","text":"

You can check the step by step process in this video tutorial of How to make your first API call from Get Started series.

"},{"location":"quick-start/#postman-collection","title":"Postman collection","text":"

To start testing our APIs without any additional configuration, have a look at our dedicated Postman collection.

"},{"location":"quick-start/#test-and-production-environment","title":"Test and Production environment","text":"

After successfully developing your travel app with Amadeus APIs in the Test environment, you can now move to Production. Discover the differences between the Test and Production environments in Amadeus Self-Service APIs. Find out how to seamlessly switch to Production at no cost and, depending on your quota, gain access to real-time data, improved results, and quicker response times.

"},{"location":"test-data/","title":"Free test data collection of Self-Service APIs","text":"

Amadeus for Developers offers a test environment with free limited data. This allows developers to build and test their applications before deploying them to production. To access real-time data, you will need to move to the production environment.

Warning

It is important to note that the test environment protects our customers and data and it's exclusively intended for development purposes.

"},{"location":"test-data/#test-vs-production","title":"Test vs Production","text":"

The test environment has the following differences with the production:

Billing Rate Limits Data Base URL Test Free monthly quota 10 TPS Limited, cached test.api.amadeus.com Production Unlimited 40 TPS Unlimited, real-time api.amadeus.com

Check out the rate limits guide and pricing page if you want to get more information on the specific topics. In this tutorial you can learn how to build a mock server in Postman to help you consume less of your free quota.

Important

Please note that in the production environment, you will only be charged for API calls that exceed the monthly free limit. Our Flight Order Management API, for instance, may offer a free limit of up to 10,000 calls. So, by registering for production, you can enjoy the benefits of free quotas while accessing our APIs for the latest and unrestricted data without any hidden costs.

"},{"location":"test-data/#api-usage","title":"API usage","text":"

To make sure you don't pass your monthly quota, you can go to My Self-Service Workspace > API usage and quota and review how many transactions you've performed. In case you pass the limit, you will need to wait for the new month and your quota will be renewed.

Information

It may take up to 12 minutes to display your most recent API calls.

The table below details the available test data for each Self-Service API:

"},{"location":"test-data/#test-data-collection","title":"Test Data Collection","text":""},{"location":"test-data/#travel-safety","title":"Travel safety","text":"API Test data Safe Place See list of valid cities."},{"location":"test-data/#flights","title":"Flights","text":"API Test data Flight Inspiration Search Cached data including most origin and destination cities. Flight Cheapest Date Search Cached data including most origin and destination cities. Flight Availabilities Search Cached data including most origin and destination cities/airports. Airport Routes Static dataset containing all airport routes in November 2021. Airline Routes Static dataset containing all airport routes in November 2021. Flight Offers Search Cached data including most origin and destination cities/airports. Flight Offers Price Cached data including most origin and destination cities/airports. Branded Fares Upsell Cached data including most airlines. SeatMap Display Works with the response of Flight Offers Search. Flight Create Orders Works with the response of Flight Offers Price. Flight Order Management Works with the response of Flight Create Orders. Flight Price Analysis Contains the following routes in both test and production environments. Flight Delay Prediction No data restrictions in test. Airport On-time Performance No data restrictions in test. Flight Choice Prediction No data restrictions in test. On Demand Flight Status Contains a copy of live data at a given time and real-time updates are not supported. Check out the differences between test and production environment. Airline Code Lookup No data restrictions in test. Airport & City Search Cities/airports in the United States, Spain, the United Kingdom, Germany and India. Airport Nearest Relevant Cities/airports in the United States, Spain, the United Kingdom, Germany and India. Flight Check-in Links See list of valid airlines. Travel Recommendations No data restrictions in test."},{"location":"test-data/#hotels","title":"Hotels","text":"API Test data Hotel List See list of\u00a0valid hotel chains. Hotel Search See list of\u00a0valid hotel chains. Test with major cities like\u00a0LON\u00a0or\u00a0NYC. Hotel Booking Works with the response of\u00a0Hotel Search. Hotel Ratings See list of\u00a0valid hotels. Hotel Name Autocomplete Cached data including most hotels available through Amadeus"},{"location":"test-data/#destination-experiences","title":"Destination experiences","text":"API Test data Points of Interest See list of valid cities. Tours and Activities See list of valid cities. City Search No data restrictions in test."},{"location":"test-data/#itinerary-management","title":"Itinerary management","text":"API Test data Trip Parser No data restrictions in test. Trip Purpose Prediction No data restrictions in test."},{"location":"test-data/#market-insights","title":"Market insights","text":"API Test data Flight Most Traveled Destinations See list of origin and destination cities/airports. Flight Most Booked Destinations See list of origin and destination cities/airports. Flight Busiest Traveling Period See list of origin and destination cities/airports. Location Score See list of valid cities."},{"location":"test-data/#video-tutorial","title":"Video Tutorial","text":"

Check out this video to know more about the differences between Test and Production from Get Started with Amadeus Self-Service APIs Series.

"},{"location":"API-Keys/","title":"API keys","text":"

To start working with our Self-Service APIs, you need to register your application with us to obtain API keys. In this section we describe how to authorize your application and move it to production.

"},{"location":"API-Keys/authorization/","title":"Authorizing your application","text":"

Amadeus for Developers uses OAuth to authenticate access requests. OAuth generates an access token which grants the client permission to access a protected resource.

The method to acquire a token is called grant. There are different types of OAuth grants. Amadeus for Developers uses the Client Credentials Grant.

"},{"location":"API-Keys/authorization/#requesting-an-access-token","title":"Requesting an access token","text":"

Once you have created an app and received your API Key and API Secret, you can generate an access token by sending a POST request to the authorization server:

https://test.api.amadeus.com/v1/security/oauth2/token/

Information

Remember that your API Key and API Secret should be kept private. Read more about best practices for secure API key storage.

The body of the request is encoded as x-www-form-urlencoded, where the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value:

Key Value grant_type The value client_credentials client_id The API Key for the application client_secret The API Secret for the application

Specify the type of the request using the content-type HTTP header with the value application/x-www-form-urlencoded.

The following example uses cURL to request a new token:

curl \"https://test.api.amadeus.com/v1/security/oauth2/token\" \\\n     -H \"Content-Type: application/x-www-form-urlencoded\" \\\n     -d \"grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}\"\n
Note that the -X POST parameter is not needed in the cURL command. As we are sending a body, cURL sends the request as POST automatically.

"},{"location":"API-Keys/authorization/#response","title":"Response","text":"

The authorization server will respond with a JSON object:

{\n    \"type\": \"amadeusOAuth2Token\",\n    \"username\": \"foo@bar.com\",\n    \"application_name\": \"BetaTest_foobar\",\n    \"client_id\": \"3sY9VNvXIjyJYd5mmOtOzJLuL1BzJBBp\",\n    \"token_type\": \"Bearer\",\n    \"access_token\": \"CpjU0sEenniHCgPDrndzOSWFk5mN\",\n    \"expires_in\": 1799,\n    \"state\": \"approved\",\n    \"scope\": \"\"\n}\n
The response will contain the following parameters:

Parameter Description type The type of resource. The value will be amadeusOAuth2Token. username Your username (email address). application_name The name of your application. client_id The API Key for your application token_type The type of token issued by the authentication server. The value will be Bearer. access_token The token to authenticate your requests. expires_in The number of seconds until the token expires. state The status of your request. Values can be approved or expired."},{"location":"API-Keys/authorization/#using-the-token","title":"Using the token","text":"

Once the token has been retrieved, you can authenticate your requests to Amadeus Self-Service APIs.

Each API call must contain the authorization HTTP header with the value Bearer {access_token}, where acess_token is the token you have just retrieved.

The following example is a call to the Flight Check-in Links API to retrieve the check-in URL for Iberia (IB):

curl \"https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airline=IB\" \\\n     -H \"Authorization: Bearer CpjU0sEenniHCgPDrndzOSWFk5mN\"\n
"},{"location":"API-Keys/authorization/#managing-tokens-from-your-source-code","title":"Managing tokens from your source code","text":"

To retrieve a token using your favourite programming language, send a POST request and parse the JSON response as in the cURL examples above.

There are different strategies to maintain your token updated, like checking the time remaining until expiration before each API call or capturing the unauthorized error when the token expires. In both cases, you must request a new token.

To simplify managing the authentication process, you can use the Amadeus for Developers SDKs available on GitHub. The SDKs automatically fetch and store the access_token and set the headers in all API calls.

Example of initializing the client and authenticating with the Node SDK:

var Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: '[API Key]',\n  clientSecret: '[API Secret]'\n});\n

You can then call the API. The following example is a call to the Flight Check-in Links API to retrieve the check-in URL for Iberia (IB):

var Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: '[API Key]',\n  clientSecret: '[API Secret]'\n});\n\namadeus.referenceData.urls.checkinLinks.get({\n  airlineCode : 'IB'\n}).then(function(response){\n  console.log(response.data);\n}).catch(function(responseError){\n  console.log(responseError.code);\n});\n
"},{"location":"API-Keys/moving-to-production/","title":"Moving your application to production","text":"

When your application is ready to be deployed to the Real World\u2122, you can request your Production Key and access the Production Environment.

"},{"location":"API-Keys/moving-to-production/#requesting-a-production-key","title":"Requesting a production key","text":"

To request a production key, you must complete the following steps:

  1. Sign in to your account and enter My Self-Service Workspace.
  2. Select the application to move to Production and click Get Production environment :

  1. Complete the form with your personal information, billing address, and app information.
  2. Indicate whether your application uses Flight Create Orders in the checkbox at the bottom of the form. This API has special access requirements detailed below in the Moving to Production with Flight Create Orders section of this guide.
  3. Select your preferred method of payment (credit card or bank transfer) and provide the required billing information.
  4. Sign the Terms of Service agreement provided on Docusign.

Once these steps are completed, your application status will be pending:

You will receive a notification that your application is validated and the status will change to live. This usually occurs within 72 hours. Note that the validation period applies to your first production application. Subsequent applications will be validated automatically.

Production keys are valid for all Self-Service APIs except Flight Create Orders API, which has special requirements. See the Moving to Production with Flight Create Orders of this guide for more information.

Remember that once you exceed your free transactions threshold, you will be billed automatically for your transactions every month. You can manage and track your app usage in My Self-Service Workspace.

"},{"location":"API-Keys/moving-to-production/#using-the-production-key","title":"Using the production key","text":"

Once you have a production key, you can make the following changes to your source code:

  • Update the base URL for your API calls to point to https://api.amadeus.com.
  • Update your API key and API secret with the new production keys.

If you are using Amadeus for Developers SDKs, add hostname='production' to the Client together with your API key and API secret as shown below example in python SDK:

from amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='REPLACE_BY_YOUR_API_KEY',\n    client_secret='REPLACE_BY_YOUR_API_SECRET',\n    hostname='production'\n)\n\ntry:\n    response = amadeus.shopping.flight_offers_search.get(\n        originLocationCode='MAD',\n        destinationLocationCode='ATH',\n        departureDate='2022-11-01',\n        adults=1)\n    print(response.data)\nexcept ResponseError as error:\n    print(error)\n
"},{"location":"API-Keys/moving-to-production/#video-tutorial","title":"Video Tutorial","text":"

You can check the step by step process in this video tutorial of How to move to production from Get Started series.

"},{"location":"API-Keys/moving-to-production/#moving-to-production-with-the-flight-create-orders-api","title":"Moving to production with the Flight Create Orders API","text":"

Applications using Flight Create Orders must meet special requirements before moving to Production. The requirements are detailed in the following section.

"},{"location":"API-Keys/moving-to-production/#requirements","title":"Requirements","text":"
  1. You have a ticket issuance agreement with a consolidator. Only certified travel agents can issue flight tickets. Non-certified businesses must issue tickets via an airline consolidator (an entity that acts as a host agency for non-certified agents). The Amadeus for Developers team can assist you in finding a consolidator in your region.

  2. There are no restrictions in your country. Though we are working to make Self-Service flight booking available worldwide, Flight Create Orders API is currently not available to companies in the following countries:

Algeria, Bangladesh, Bhutan, Bulgaria, Croatia, Egypt, Finland, Iceland, Iran, Iraq, Jordan, Kuwait, Kosovo, Lebanon, Libya, Madagascar, Maldives, Montenegro, Morocco, Nepal, Pakistan, Palestine, Qatar, Saudi Arabia, Serbia, Sri Lanka, Sudan, Syria, Tahiti, Tunisia, United Arab Emirates and Yemen

  1. You comply with local regulations . Flight booking is subject to local regulations and many areas (notably, California and France) have special requirements.

Contact us for questions about the above requirements or assistance with local regulations and airline consolidators in your region.

If you meet the above requirements, you are ready to move your application to production.

"},{"location":"API-Keys/moving-to-production/#adding-flight-create-orders-to-a-production-app","title":"Adding Flight Create Orders to a production app","text":"

To add Flight Create Orders to an application currently in production, select the app in the My Apps section of your Self-Service Workspace and click API requests:

Then request production access to Flight Create Orders by clicking the Request button located under Actions:

"},{"location":"developer-tools/","title":"Amadeus SDKs Tutorials","text":"

We have a number of SDKs available to help you integrate Amadeus Self-Service APIs into your applications. To give more context to how each of the SDKs can be used, we also have a dedicated tutorial per programming language.

Source code Tutorials Get started examples Support by Node SDK Node SDK tutorial Node SDK example Amadeus Python SDK Python SDK tutorial Python SDK example Amadeus Java SDK Java SDK tutorial Java SDK example Amadeus PHP SDK PHP SDK tutorial N/A community

If you need an SDK in a different language, feel free to use the OpenAPI Generator to automatically create an SDK from our OpenAPI Specification files. We also have a tutorial on how to do this.

"},{"location":"developer-tools/java/","title":"Java","text":""},{"location":"developer-tools/java/#java-sdk","title":"Java SDK","text":"

Amadeus Java SDK for the Self-Service APIs is available as a Maven dependency, which the Amadeus for Developers team is continuously updating as the new APIs and features get released.

You can refer to the Amadeus Java SDK or Amadeus Maven dependency for the detailed changelog.

"},{"location":"developer-tools/java/#installation","title":"Installation","text":"

The SDK can be easily installed using your preferred build automation tool, such as Maven or Gradle:

"},{"location":"developer-tools/java/#maven","title":"Maven","text":"
<dependency>\n  <groupId>com.amadeus</groupId>\n  <artifactId>amadeus-java</artifactId>\n  <version>7.0.0</version>\n</dependency>\n
"},{"location":"developer-tools/java/#gradle","title":"Gradle","text":"
compile \"com.amadeus:amadeus-java:7.0.0\"\n

Further information:

You can check the library in the Maven repository for futher information.

"},{"location":"developer-tools/java/#step-by-step-example","title":"Step-by-step example","text":"

This tutorial will guide you through the process of creating a simple Java application which calls the Flight Inspiration Search API using the Amadeus for Developers Java SDK.

"},{"location":"developer-tools/java/#using-the-amadeus-java-sdk","title":"Using the Amadeus Java SDK","text":"

For this tutorial we will use Unix-based commands. Windows has similar commands for each task.

The requirements to follow this tutorial include:

  • Your favorite editor
  • Java installed
  • A build automation tool, such as Maven
  • Amadeus for Developers API key

Let's do something cool by calling one of our Flight Search APIs from your Java code.

To help you get started, we have created a small Maven skeleton that is ready to use.

Let's create a class FlightSearch.java in the package edu.amadeus.sdk with the following content:

package edu.amadeus.sdk;\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\n\nimport com.amadeus.exceptions.ResponseException;\n\nimport com.amadeus.shopping.FlightDestinations;\nimport com.amadeus.resources.FlightDestination;\n\npublic class FlightSearch {\n    public static void main(String[] args) throws ResponseException {\n        Amadeus amadeus = Amadeus.builder(System.getenv()).build();\n\n        Params params = Params.with(\"origin\", \"MAD\");\n\n        FlightDestination[] flightDestinations = amadeus.shopping.flightDestinations.get(params);\n\n        if (flightDestinations[0].getResponse().getStatusCode() != 200) {\n            System.out.println(\"Wrong status code for Flight Inspiration Search: \" + flightDestinations[0].getResponse().getStatusCode());\n            System.exit(-1);\n        }\n\n        System.out.println(flightDestinations[0]);\n    }\n}\n

Before testing the example, export your credentials in your terminal:

export AMADEUS_CLIENT_ID=YOUR_CLIENT_ID\nexport AMADEUS_CLIENT_SECRET=YOUR_CLIENT_SECRET\n

Let's build and run the code to make sure that everything is working properly:

./mvnw compile exec:java -Dexec.mainClass=\"edu.amadeus.sdk.FlightSearch\"\n\n[INFO] Scanning for projects...\n[INFO] \n[INFO] ------------< edu.amadeus.sdk:amadeus-java-getting-started >------------\n[INFO] Building amadeus-java-getting-started 0.1.0-SNAPSHOT\n[INFO] --------------------------------[ jar ]---------------------------------\n[INFO] \n[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ amadeus-java-getting-started ---\n[INFO] Using 'UTF-8' encoding to copy filtered resources.\n[INFO] Copying 1 resource\n[INFO] \n[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ amadeus-java-getting-started ---\n[INFO] Changes detected - recompiling the module!\n[INFO] Compiling 2 source files to /amadeus-java-getting-started/target/classes\n[INFO] \n[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ amadeus-java-getting-started ---\nFlightDestination(type=flight-destination, origin=MAD, destination=OPO, departureDate=Mon Oct 03 00:00:00 CEST 2022, returnDate=Tue Oct 18 00:00:00 CEST 2022, price=FlightDestination.Price(total=41.81))\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  4.407 s\n[INFO] Finished at: 2022-09-19T12:36:39+02:00\n[INFO] ------------------------------------------------------------------------\n

As you see in the example, the main method instantiates an Amadeus object, taking the credentials from the following environment:

Amadeus amadeus = Amadeus.builder(System.getenv()).build();\n

In order to use the method amadeus.shopping.flightDestinations.get(), you need to pass a Params object as in the below example:

Params params = Params.with(\"origin\", \"MAD\");\nFlightDestination[] flightDestinations = amadeus.shopping.flightDestinations.get(params);\n

The method amadeus.shopping.flightDestinations.get() will return an Array with the results:

System.out.println(flightDestinations[0]);\n

Now that you've tried out this example and know how to use the objects, you can review the Javadocs in this SDK and discover new ways to use it.

"},{"location":"developer-tools/java/#video-tutorial","title":"Video Tutorial","text":"

You can also check the video tutorial on how to get started with the Java SDK.

"},{"location":"developer-tools/java/#managing-api-rate-limits","title":"Managing API rate limits","text":"

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Java using the Amadeus Java SDK here.

"},{"location":"developer-tools/mock-server/","title":"Mock Server","text":""},{"location":"developer-tools/mock-server/#build-a-mock-server-with-postman","title":"Build a Mock Server with Postman","text":"

Mock servers can be used as a tool for testing APIs. They simulate the behavior of a real server allowing developers to test their applications without calling the real service.

Let's say that you want to build the frontend of your travel application without consuming your free quota to call the Amadeus for Developers APIs. In this tutorial show you how to build a mock server.

"},{"location":"developer-tools/mock-server/#prerequisites","title":"Prerequisites","text":"
  • A Postman account and it's app or web version
  • The Amadeus for Developers Postman collection forked into your workspace

Let's now check step-by-step to create a mock server.

"},{"location":"developer-tools/mock-server/#1-save-a-request-and-response-example","title":"1. Save a request and response example","text":"

For the sake of the tutorial we will show you how to create a mock server for the Travel Recommendations API. We will make one request to the Amadeus API and then we will mock the request and response. To learn how to make an API call with Postman, please check this step-by-step guide.

Open your Postman application and generate your Amadeus access token as described in the guide above. Then go to Amadeus for Developers > Trip > Artificial Intelligenge > GET Travel Recommendations and make an API call.

Click on Save Response > Save as example, and in the same directory you will see the example that you just saved within your collection.

"},{"location":"developer-tools/mock-server/#2-add-the-api-and-example-in-a-new-collection","title":"2. Add the API and example in a new collection","text":"

In Postman, you always need to create a mock server for a whole collection. That's why in this case you will create a new collection to contain only the API we are going to mock.

Let's create a new Postman collection. On the top left of your screen click New > Collection and you will see the new collection with the name New Collection. Feel free to give another name, in our case is called Mock - Travel Recommendations.

Now you are able to add the Travel Recommendations API to the collection. To do so, duplicate the GET Travel Recommendations API, which can be found at the collection Amadeus for Developers > Trip > Artificial Intelligenge > GET Travel Recommendations and drag & drop it your new collection. Your workspace will now look like:

"},{"location":"developer-tools/mock-server/#3-build-the-mock-server","title":"3. Build the mock server","text":"

In order to create a mock server go to New > Mock Server > Select an existing collection and choose the collection you just created.

In the next step you can see several options to configure your server. Give a name and click the Create a Mock Server button.

The mock server generates a URL in which your requests will be sent to. Make sure to copy the URL because you will need it for the next step.

For this tutorial you built a public mock server, which means that anyone with access to the URL will be able to perform requests. If you want to keep it private, you will have to get a Postman API key and pass it to the request headers.

"},{"location":"developer-tools/mock-server/#4-send-a-request-to-the-mock-server","title":"4. Send a request to the mock server","text":"

On the top left click on New > HTTP Request and create a GET request. For the base URL use the mock server's one, and contatenate the same path and parameters from the saved example. The full request now looks like:

GET https://3492878a-5eb2-4837-b97b-b5e2669a18e9.mock.pstmn.io/v1/reference-data/recommended-locations?cityCodes=PAR&travelerCountryCode=FR

Perform the API request and you will get as response, the one that we saved earlier.

You can also paste the full URL in your browser and get the results, since it's a public mock server.

Congratulations! You've created a mock server in Postman. You can now use this server in your code to mock several requests, successful responses and error messages according to your development needs.

"},{"location":"developer-tools/node/","title":"Node","text":""},{"location":"developer-tools/node/#node-sdk","title":"Node SDK","text":"

Amadeus Node SDK for Self-service APIs is available with npm(node package manager) and Amadeus for Developers team is continuously updating with new APIs and features.

You can refer to the amadeus-node or Amadeus npm package for more details on the changelog.

"},{"location":"developer-tools/node/#installation","title":"Installation","text":"

This module has been tested using Node LTS versions. You can install it using Yarn or NPM.

npm install amadeus --save\n
"},{"location":"developer-tools/node/#getting-started","title":"Getting Started","text":"

To make your first API call, you will need to register for an Amadeus Developers Account and set up your first application.

var Amadeus = require('amadeus');\nvar amadeus = new Amadeus({\n  clientId: 'REPLACE_BY_YOUR_API_KEY',\n  clientSecret: 'REPLACE_BY_YOUR_API_SECRET'\n});\n\namadeus.shopping.flightOffersSearch.get({\n    originLocationCode: 'SYD',\n    destinationLocationCode: 'BKK',\n    departureDate: '2022-10-21',\n    adults: '2'\n}).then(function(response){\n  console.log(response.data);\n}).catch(function(responseError){\n  console.log(responseError.code);\n});\n
"},{"location":"developer-tools/node/#initialization","title":"Initialization","text":"

The client can be initialized directly as below. Your credentials client Id and Client Secret can be found on the Amadeus dashboard.

// Initialize using parameters\nvar amadeus = new Amadeus({\n  clientId: 'REPLACE_BY_YOUR_API_KEY',\n  clientSecret: 'REPLACE_BY_YOUR_API_SECRET'\n});\n

Warning

Remember that hardcoding your credentials is not the best practice due to the potential exposure to others. Read more about best practices for secure API key storage.

Alternatively, you can initialize by setting up environment variables. In Node, we like to use dotenv package.

npm install dotenv\n

Put your API credentials in .env file:

AMADEUS_CLIENT_ID=REPLACE_BY_YOUR_API_KEY,\nAMADEUS_CLIENT_SECRET=REPLACE_BY_YOUR_API_SECRET\n

Initialize using dotenv package:

const dotenv = require('dotenv').config();\nvar amadeus = new Amadeus();\n

Important

You will also want to add .env to your .gitingore so that your API credentials aren't included in your git repository.

If you don't want to use another package, you can also simply export your key in terminal directly to initalize.

Export your credentials in terminal:

export AMADEUS_CLIENT_ID=\"REPLACE_BY_YOUR_API_KEY\"\nexport AMADEUS_CLIENT_SECRET=\"REPLACE_BY_YOUR_API_SECRET\"\n
Initialize:

var amadeus = new Amadeus();\n
"},{"location":"developer-tools/node/#moving-to-production","title":"Moving to Production","text":"

By default, the SDK environment is set to test environment. To switch to production (pay-as-you-go) environment, please change the hostname as follows:

var amadeus = new Amadeus({\n  hostname: 'production'\n});\n
"},{"location":"developer-tools/node/#promises","title":"Promises","text":"

Every API call returns a Promise that either resolves or rejects.

Every resolved API call returns a Response object containing a body attribute with the raw response. If the API call contained a JSON response, it will parse the JSON into the result attribute. If this data contains a data key, that will be made available in data attribute.

For a failed API call, it returns a ResponseErrorobject containing the (parsed or unparsed) response, the request, and an error code.

amadeus.referenceData.urls.checkinLinks.get({\n  airlineCode: 'BA'\n}).then(function(response){\n  console.log(response.body);   //=> The raw body\n  console.log(response.result); //=> The fully parsed result\n  console.log(response.data);   //=> The data attribute taken from the result\n}).catch(function(error){\n  console.log(error.response); //=> The response object with (un)parsed data\n  console.log(error.response.request); //=> The details of the request made\n  console.log(error.code); //=> A unique error code to identify the type of error\n});\n
"},{"location":"developer-tools/node/#pagination","title":"Pagination","text":"

If an API endpoint supports pagination, the other pages are available under the .next, .previous, .last and .first methods.

amadeus.referenceData.locations.get({\n  keyword: 'LON',\n  subType: 'AIRPORT,CITY'\n}).then(function(response){\n  console.log(response.data); // first page\n  return amadeus.next(response);\n}).then(function(nextResponse){\n  console.log(nextResponse.data); // second page\n});\n

If a page is not available, the response will resolve to null.

"},{"location":"developer-tools/node/#video-tutorial","title":"Video Tutorial","text":"

You can also check the video tutorial on how to get started with the Node SDK.

"},{"location":"developer-tools/node/#managing-api-rate-limits","title":"Managing API rate limits","text":"

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Node using the Amadeus Node SDK here.

"},{"location":"developer-tools/openapi-generator/","title":"Generating SDKs from Amadeus OpenAPI specification using the OpenAPI Generator","text":"

The OpenAPI Generator is an open-source project for generating REST API clients, server stubs, documentation and schemas based on the OpenAPI specification.

At Amadeus, we are following the contract-first approach to API development, which is at the core of the OpenAPI Generator's design philosophy. In this way, we only need to create or update an OpenAPI specification for a particluar API, and the OpenAPI Generator will automatically generate the SDKs in various programming languages and create the required API documentation.

"},{"location":"developer-tools/openapi-generator/#amadeus-openapi-specification","title":"Amadeus OpenAPI specification","text":"

We have a dedicated GitHub repository where you can find OpenAPI specification files for all our Self-Serving APIs. The OpenAPI Generator can easily consume these files to output a dedicated SDK for any of the languages that it supports.

"},{"location":"developer-tools/openapi-generator/#how-to-create-an-sdk-from-amadeus-openapi-specification","title":"How to create an SDK from Amadeus OpenAPI specification","text":"

If you are not familiar with the OpenAPI Generator, the following tutorial may help you get started. We will take Ruby as an example and show you the steps to create a turnkey SDK based on the specification for your required Amadeus API. We will use the City Search API in our example.

"},{"location":"developer-tools/openapi-generator/#step-1-setting-up-the-openapi-generator","title":"Step 1. Setting up the OpenAPI Generator","text":"

Information

The current stable release version of the OpenAPI Generator at the time of writing this document is 6.0.1.

There are many ways to set up the OpenAPI Generator. To eliminate the need for any system dependencies, we will run the OpenAPI Generator as a Docker container. As a prerequisite to this, we need to install the Docker Desktop on our host and start running it.

"},{"location":"developer-tools/openapi-generator/#step-2-downloading-the-openapi-specification-for-the-city-search-api","title":"Step 2. Downloading the OpenAPI specification for the City Search API","text":"

Navigate to the Amadeus OpenAPI Specification and download the JSON file for the City Search API specification.

Information

You can use both JSON and YAML files with the OpenAPI Generator.

"},{"location":"developer-tools/openapi-generator/#step-3-creating-the-ruby-sdk-for-the-city-search-api","title":"Step 3. Creating the Ruby SDK for the City Search API","text":"

Information

The docker run command uses the openapi-generator-cli image: https://hub.docker.com/r/openapitools/openapi-generator-cli/.

Navigate to the directory where you downloaded the City Search API specification and run the following command:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/CitySearch_v1_swagger_specification.json \\\n  -g ruby \\\n  -o /local/city_search_ruby\n

This command uses the CitySearch_v1_swagger_specification.json as input (-i) located in the current directory (/local/). It generates (-g) a Ruby SDK (indicated by ruby) and outputs (-o) the files to folder city_search_ruby, which is located in the current directory (/local/).

"},{"location":"developer-tools/openapi-generator/#step-4-enabling-usage-of-the-ruby-sdk-for-the-city-search-api","title":"Step 4. Enabling usage of the Ruby SDK for the City Search API","text":"

Information

Before using the API you will need to get an access token. Please read our Authorization Guide for more information on how to get your token.

Navigate to the newly created city_search_ruby folder and open the README.md. This file shows the initial instructions on configuring our Ruby SDK for the City Search API.

Follow the instructions in the README.md to build the code into a gem and install it locally by running the following command from the city_search_ruby directory:

gem build ./openapi_client.gemspec\ngem install ./openapi_client-1.0.0.gem\n

Information

You may need to run this command with administrator privileges (sudo).

Now we have a full-featured Ruby SDK that is ready for production usage.

"},{"location":"developer-tools/openapi-generator/#step-5-customising-the-ruby-sdk-for-the-city-search-api","title":"Step 5. Customising the Ruby SDK for the City Search API","text":"

There are several ways to customise an SDK created by the OpenAPI Generator:

  • Using a configuration file
  • Using command line arguments
  • Using mustache templates
"},{"location":"developer-tools/openapi-generator/#configuration-file","title":"Configuration file","text":"

There is a number of configuration options that the OpenAPI Generator supports for Ruby.

To apply them, we need to create a JSON file with the required parameters and define it when running the OpenAPI Generator. Let's create a file called config.json with the following contents:

{\n\"gemName\": \"Amadeus_City_Search\",\n\"gemSummary\": \"A ruby wrapper for the Amadeus City Search API\", \n\"moduleName\": \"CitySearch\",\n\"gemLicense\": \"MIT\",\n\"gemVersion\": \"0.3.1\",\n\"gemRequiredRubyVersion\": \"2.1\"\n}\n

To generate an SDK with these custom parameters, put the config.json file into the same directory as the source OpenAPI specification file and run:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/CitySearch_v1_swagger_specification.json \\\n  -g ruby \\\n  -o /local/city_search_ruby \\\n  -c config.json \\\n
"},{"location":"developer-tools/openapi-generator/#command-line-arguments","title":"Command line arguments","text":"

Instead of using a configuration file, we can specify the custom parameters as additional properties, separated by a comma:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/CitySearch_v1_swagger_specification.json \\\n  -g ruby \\\n  -o /local/city_search_ruby \\\n- -additional-properties gemVersion=0.3.1,gemName=Amadeus_City_Search\n

You can otherwise specify the parameters directly, for example:

--git-user-id openapi-generator-user --git-repo-id AmadeusCitySearch\n

This command will upload the SDK to a repository AmadeusCitySearch by the user called openapi-generator-user.

"},{"location":"developer-tools/openapi-generator/#mustache-template","title":"Mustache template","text":"

To customise the SDK beyond the custom parameters, we can use mustache templates. The GitHub repository of the OpenAPI Generator contains default mustache templates at tree/master/modules/openapi-generator/src/main/resources/. For our Ruby Client SDK, we will need the api_client_spec template.

Download the template and customise it as required. After that, attach the template to the OpenAPI run command as follows:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/CitySearch_v1_swagger_specification.json \\\n  -g ruby \\\n  -o /local/city_search_ruby\n  -t <path-to-template-directory>\n

Replace <path-to-template-directory> with the path to the template directory.

"},{"location":"developer-tools/openapi-generator/#step-6-integrating-the-ruby-sdk-for-the-city-search-api-with-other-libraries","title":"Step 6. Integrating the Ruby SDK for the City Search API with other libraries","text":"

Suppose we want to integrate our City Search Ruby SDK into an existing application that already contains many models defined in third-party libraries. One of these models may contain a model whose name is the same as in our City Search Ruby SDK. A solution to this is to add a prefix to all models generated by OpenAPI Generator using the --model-name-prefix setting. For example:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/CitySearch_v1_swagger_specification.json \\\n  -g ruby --model-name-prefix Amadeus \\\n  -o /local/city_search_ruby\n

In this way, all models in our SDK will be prefixed with Amadeus, e.g. AmadeusComponent.

"},{"location":"developer-tools/openapi-generator/#conclusion","title":"Conclusion","text":"

In this tutorial we have seen how easy it is to generate a basic SDK from our API specification files using the OpenAPI Generator. We took Ruby as an example, but the OpenAPI Generator supports many other languages, so you can easily find a solution that meets your requirements.

"},{"location":"developer-tools/php/","title":"PHP","text":""},{"location":"developer-tools/php/#php-sdk","title":"PHP SDK","text":"

Warning

The Amadeus PHP SDK is maintained independently by the developer community and is not supported or maintained by the Amadeus for Developers team.

"},{"location":"developer-tools/php/#prerequisites","title":"Prerequisites","text":"
  • Amadeus for Developers API key and API secret: to get one,\u00a0create a free developer account\u00a0and set up your first application in your\u00a0Workspace.
  • PHP version >= 7.4
"},{"location":"developer-tools/php/#installation","title":"Installation","text":"

The PHP SDK has been uploaded to the official PHP package repository.

composer require amadeus4dev/amadeus-php\n
"},{"location":"developer-tools/php/#making-your-first-api-call","title":"Making your first API call","text":""},{"location":"developer-tools/php/#request","title":"Request","text":"
<?php declare(strict_types=1);\n\nuse Amadeus\\Amadeus;\nuse Amadeus\\Exceptions\\ResponseException;\n\nrequire __DIR__ . '/vendor/autoload.php'; // include composer autoloader\n\ntry {\n    $amadeus = Amadeus::builder(\"REPLACE_BY_YOUR_API_KEY\", \"REPLACE_BY_YOUR_API_SECRET\")\n        ->build();\n\n    // Flight Offers Search GET\n    $flightOffers = $amadeus->getShopping()->getFlightOffers()->get(\n                        array(\n                            \"originLocationCode\" => \"PAR\",\n                            \"destinationLocationCode\" => \"MAD\",\n                            \"departureDate\" => \"2023-08-29\",\n                            \"adults\" => 1\n                        )\n                    );\n    print $flightOffers[0];\n\n    // Flight Offers Search POST\n    $body ='{\n              \"originDestinations\": [\n                {\n                  \"id\": \"1\",\n                  \"originLocationCode\": \"PAR\",\n                  \"destinationLocationCode\": \"MAD\",\n                  \"departureDateTimeRange\": {\n                    \"date\": \"2023-08-29\"\n                  }\n                }\n              ],\n              \"travelers\": [\n                {\n                  \"id\": \"1\",\n                  \"travelerType\": \"ADULT\"\n                }\n              ],\n              \"sources\": [\n                \"GDS\"\n              ]\n            }';\n    $flightOffers = $amadeus->getShopping()->getFlightOffers()->post($body);\n    print $flightOffers[0];\n} catch (ResponseException $e) {\n    print $e;\n}\n
"},{"location":"developer-tools/php/#handling-the-response","title":"Handling the response","text":"

Every API call returns a Response object which contains raw response body in string format:

$locations = $amadeus->getReferenceData()->getLocations()->get(\n                array(\n                    \"subType\" => \"CITY\",\n                    \"keyword\" => \"PAR\"\n                )\n            );\n\n// The raw response, as a string\n$locations[0]->getResponse()->getResult(); // Include response headers\n$locations[0]->getResponse()->getBody(); //Without response headers\n\n// Directly get response headers as an array\n$locations[0]->getResponse()->getHeadersAsArray();\n\n// Directly get response body as a Json Object\n$locations[0]->getResponse()->getBodyAsJsonObject();\n\n// Directly get the data part of response body\n$locations[0]->getResponse()->getData();\n
"},{"location":"developer-tools/php/#arbitrary-api-calls","title":"Arbitrary API calls","text":"

You can call any API not yet supported by the SDK by making arbitrary calls.

For the\u00a0get\u00a0endpoints:

// Make a GET request only using path\n$amadeus->getClient()->getWithOnlyPath(\"/v1/airport/direct-destinations?departureAirportCode=MAD\");\n\n// Make a GET request using path and passed parameters\n$amadeus->getClient()->getWithArrayParams(\"/v1/airport/direct-destinations\", [\"departureAirportCode\" => \"MAD\"]);\n

For the\u00a0post\u00a0endpoints:

$amadeus->getClient()->postWithStringBody(\"/v1/shopping/availability/flight-availabilities\", $body);\n
"},{"location":"developer-tools/postman/","title":"Self-Service API Postman collection","text":"

Follow this tutorial to test Amadeus Self-Service APIs using our dedicated Postman collection.

"},{"location":"developer-tools/postman/#pre-requisites","title":"Pre-requisites","text":"

Before you begin, you need to:

  • Register your application with Amadeus for Developers as described in Making your first API call.
  • Create a new Postman account or use your existing Postman account.
"},{"location":"developer-tools/postman/#fork-the-collection","title":"Fork the collection","text":"
  1. Login to Postman.
  2. Navigate to the Amadeus for Developers public workspace.

  3. Click Fork.

  4. Select Amadeus for Developers from the Environment dropdown.

  5. Give the fork a name.

  6. Select the workspace where you need to fork the collection to.
  7. Tick the Watch original collection box to get notified when the collection is updated.
  8. Click Fork Collection. You will be taken to the workspace that you selected previously.
"},{"location":"developer-tools/postman/#fork-the-environment","title":"Fork the environment","text":"
  1. Navigate to the Amadeus for Developers public workspace.

  2. On the left side bar, click Environments.

  3. Select ... beside the Amadeus for Developers envoronment and select Create a fork.

  4. Give the fork a name.

  5. Select the workspace where you need to fork the collection to.

  6. Click Fork Environment. You will be taken to the workspace that you selected previously.
"},{"location":"developer-tools/postman/#generate-the-access-token","title":"Generate the access token","text":"
  1. On the right side bar, set the environment to Amadeus for Developers.

  2. On the left side bar, click Environments.

  3. Enter you API key and secret values into the Current values of the client_id and client_secret parameters respectively.

  4. Click Save.
  5. On the left side bar, navigate to Collections.
  6. Select the Authorization > Access Granted Client Credentials.
  7. Click Send without filling out any parameters.
  8. You will receive the access_token value in the response.

Note

The token is valid for 30 minutes and you must perform the previous step every 30 minutes to generate a new access token.

"},{"location":"developer-tools/postman/#make-an-api-call","title":"Make an API call","text":"
  1. Select the required API from the collection by navigating to the required endpoint on the left side bar. For example, Air > Search & Shopping > Flight Offers Search.
  2. Do not specify the client_id and client_secret parameters, as the access_token obtained previously is already linked to this API.
  3. If required, specify the request parameters. Alternatively, you can try the API without setting any parameters, as we have already preconfigured it to display data for the upcoming month.
  4. Click Send to make the call.

"},{"location":"developer-tools/postman/#make-our-preconfigured-scenarios","title":"Make our preconfigured scenarios","text":"

To give you a smooth user experience that emulates the actual workflow of a flight and hotel booking engine, we have included Scenarios in the Air and Hotel categories. A scenario combines all required APIs to achive a certain goal (e.g., book a flight) and uses data from each of the API's responses for calling the next API.

  1. Select the required scenario from the collection by navigating to the required category on the left side bar. For example, Air > (Scenario)Basic Flight Booking flow.
  2. Refresh the access_token by calling the Authorization API.
  3. Make a call to the Flight Offers Search to get the offer as a JSON object.
  4. Make a call to the Flight Offers Price to get the the price for the offer retrieved in the previous step. This API will automatically use the JSON object of the flight offer search.
  5. Make a call to the Flight Create Orders to create an order for the offer retrieved in the previous steps.
"},{"location":"developer-tools/postman/#visualize-api-responses","title":"Visualize API responses","text":"

Some APIs in our Postman include a visualization to present the results graphically for better understanding and interpretation.

To access a visualization of an API:

  1. Select the required API from the collection by navigating to the required endpoint on the left side bar. For example, Destination Content > Location > Safe Place.
  2. Specify the API parameters.
  3. Click Send to make the call.
  4. Click Visualize at the bottom of the screen.

"},{"location":"developer-tools/python/","title":"Python","text":""},{"location":"developer-tools/python/#python-sdk","title":"Python SDK","text":""},{"location":"developer-tools/python/#installation","title":"Installation","text":"

You can call the Amadeus APIs using the Python SDK. The Python SDK has been uploaded to the official Python package repository, which makes life easier since you can install the SDK as a regular Python package.

"},{"location":"developer-tools/python/#prerequisites","title":"Prerequisites","text":"
  • Amadeus for Developers API key and API secret: to get one,\u00a0create a free developer account\u00a0and set up your first application in your\u00a0Workspace.
  • Python version >= 3.8

First step is to create the environment. Switch to your project repository and type:

python3 -m venv .venv\n

A new folder .venv will be created with everything necessary inside. Let's activate the isolated environment with the following command:

source .venv/bin/activate\n

From now on, all packages installed using pip will be located under .venv/lib and not in your global /usr/lib folder.

Finally, install the Amadeus SDK as follows:

pip install amadeus\n

You can also add it to your requirements.txt file and install using:

pip install -r requirements.txt\n

The virtual environment can be disabled by typing:

deactivate\n
"},{"location":"developer-tools/python/#your-first-api-call","title":"Your first API call","text":"

This tutorial will guide you through the process of creating a simple Python application which calls the Airport and Search API using the Amadeus for Developers Python SDK.

"},{"location":"developer-tools/python/#request","title":"Request","text":"
from amadeus import Client, Location, ResponseError\n\namadeus = Client(\n    client_id='AMADEUS_CLIENT_ID',\n    client_secret='AMADEUS_CLIENT_SECRET'\n)\n\ntry:\n    response = amadeus.reference_data.locations.get(\n        keyword='LON',\n        subType=Location.AIRPORT\n    )    \n    print(response.data)\nexcept ResponseError as error:\n    print(error)\n
  • Once you import the\u00a0amadeus\u00a0library, you initialize the client by adding your credentials in the\u00a0builder\u00a0method. The library can also be initialized without any parameters when the environment variables\u00a0AMADEUS_CLIENT_ID\u00a0and\u00a0AMADEUS_CLIENT_SECRET\u00a0are present.
  • The authentication process is handled by the SDK and the access token is renewed every 30 minutes.
  • The SDK\u00a0uses namespaced methods to create a match between the APIs and the SDK. In this case, the API\u00a0GET /v1/reference-data/locations?keyword=LON&subType=AIRPORT\u00a0is implemented as\u00a0amadeus.reference_data.locations.get(keyword='LON',subType=Location.AIRPORT).
"},{"location":"developer-tools/python/#handling-the-response","title":"Handling the response","text":"

Every API call returns a Response object. If the API call contains a JSON response, it will parse the JSON into the .result attribute. If this data also contains a data key, it will make that available as the .data attribute. The raw body of the response is always available as the .body attribute.

print(response.body) #=> The raw response, as a string\nprint(response.result) #=> The body parsed as JSON, if the result was parsable\nprint(response.data) #=> The list of locations, extracted from the JSON\n
"},{"location":"developer-tools/python/#arbitrary-api-calls","title":"Arbitrary API calls","text":"

You can call any API not yet supported by the SDK by making arbitrary calls.

For the\u00a0get\u00a0endpoints:

amadeus.get('/v2/reference-data/urls/checkin-links', airlineCode='BA')\n

For the\u00a0post\u00a0endpoints:

amadeus.post('/v1/shopping/flight-offers/pricing', body)\n
"},{"location":"developer-tools/python/#video-tutorial","title":"Video Tutorial","text":"

You can also check the video tutorial on how to get started with the Python SDK.

"},{"location":"developer-tools/python/#managing-api-rate-limits","title":"Managing API rate limits","text":"

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Python using the Amadeus Python SDK here.

"},{"location":"developer-tools/python/#python-async-api-calls","title":"Python Async API calls","text":"

In a synchronous program, each step is completed before moving on to the next one. However, an asynchronous program may not wait for each step to be completed. Asynchronous functions can pause and allow other functions to run while waiting for a result. This enables concurrent execution and gives the feeling of working on multiple tasks at the same time.

In this guide we are going to show you how to make async API calls in Python to improve the performance of your Python applications.

For all these examples we are going to call the Flight-Checkin Links API.

"},{"location":"developer-tools/python/#prerequisites_1","title":"Prerequisites","text":"

To follow along with the tutorial you will need the followings:

  • Python version >= 3.8

  • Amadeus for Developers API key and API secret: to get one,\u00a0create a free developer account\u00a0and set up your first application in your\u00a0Workspace.

  • aiohttp: you will use the aiohttp library to make asynchronous API calls. You can install it using the command pip install aiohttp.

  • requests: you will use the requests library for synchronous requests. You can install it using the command pip install requests.

  • amadeus: the Amadeus Pthon SDK. You can install it using the command pip install amadeus.

"},{"location":"developer-tools/python/#async-api-calls-with-aiohttp","title":"Async API calls with aiohttp","text":"

aiohttp is a Python library for making asynchronous HTTP requests build top of asyncio. The library provides a simple way of making HTTP requests and handling the responses in a non-blocking way.

In the example below you can call the the Amadeus Flight-Checkin link API using the\u00a0aiohttp\u00a0library and the code runs in an async way.

import aiohttp\nimport asyncio\nimport requests\n\nAUTH_ENDPOINT = \"https://test.api.amadeus.com/v1/security/oauth2/token\"\nheaders = {\"Content-Type\": \"application/x-www-form-urlencoded\"}\ndata = {\"grant_type\": \"client_credentials\",\n        \"client_id\": 'YOUR_AMADEUS_API_KEY',\n        \"client_secret\": 'YOUR_AMADEUS_API_SECRET'}\nresponse = requests.post(AUTH_ENDPOINT,\n                        headers=headers,\n                        data=data)\naccess_token = response.json()['access_token']\n\nasync def main():\n    headers = {'Authorization': 'Bearer' + ' ' + access_token}\n    flight_search_endpoint = 'https://test.api.amadeus.com/v2/reference-data/urls/checkin-links'\n    parameters = {\"airlineCode\": 'BA'}\n\n    async with aiohttp.ClientSession() as session:\n\n        for number in range(20):\n            async with session.get(flight_search_endpoint,\n                            params=parameters,\n                            headers=headers) as resp:\n                flights = await resp.json()\n                print(flights)\n\nasyncio.run(main())\n

The above code makes POST request to the Authentication API using the requests library. The returned access token is then used in the headers of following requests to make 20 asyncronous API calls.

"},{"location":"developer-tools/python/#async-api-calls-with-thread-executor","title":"Async API calls with thread executor","text":"

Since we offer the Python SDK we want to show you how you are able to make async API calls using the SDK. The SDK is built using the requests library which only supports synchronous API calls. This means that when you call an API, your application will block and wait for the response. The solution is to use a thread executor to allow run blocking calls in separate threads, as the example below:

import asyncio\nimport requests\nfrom amadeus import Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\nasync def main():\n\n        loop = asyncio.get_event_loop()\n        futures = [\n            loop.run_in_executor(\n                None, \n                requests.get,\n                amadeus.reference_data.urls.checkin_links.get(\n                airlineCode='BA')\n            )\n            for number in range(20)\n            ]\n        for response in await asyncio.gather(*futures):\n            print(response.status_code)\n\nasyncio.run(main())\n
"},{"location":"developer-tools/python/#openapi-generator","title":"OpenAPI Generator","text":"

In this tutorial, we'll guide you through the process of making your first API calls using the OpenAPI Generator in Python. To begin, you'll need to retrieve the specification files from the GitHub repository. In this example, you will use the Authorization_v1_swagger_specification.yaml and FlightOffersSearch_v2_swagger_specification.yaml files.

Before getting started make sure you check out how to [generate client libraries](../developer-tools/openapi-generator.md{:target=\"_blank\"} with the OpenAPI Generator.

"},{"location":"developer-tools/python/#call-the-authorization-endpoint","title":"Call the Authorization endpoint","text":"

You will now learn how to call the POST https://test.api.amadeus.com/v1/security/oauth2/token endpoint in order to get the Amadeus access token.

Open your terminal and generate the Python client with the following command:

docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/Authorizaton_v1_swagger_specification.yaml  \\\n  -g python \\\n  -o /local/auth\n
In your local directory you will see the folder auth which contains the generated library.

You can install the library using pip:

pip install openapi-client\n

Then create a file auth.py and add the following code to generate an Amadeus access token.

import openapi_client\nfrom openapi_client.apis.tags import o_auth2_access_token_api\nfrom openapi_client.model.amadeus_o_auth2_token import AmadeusOAuth2Token\n\nauth_configuration = openapi_client.Configuration()\nwith openapi_client.ApiClient(auth_configuration) as api_client:\n    api_instance = o_auth2_access_token_api.OAuth2AccessTokenApi(api_client)\n\n    body = dict(\n        grant_type=\"client_credentials\",\n        client_id=\"YOUR_API_KEY\",\n        client_secret=\"YOUR_API_SECRET\",\n    )\n    api_response = api_instance.oauth2_token(\n        body=body,\n    )\n\nprint(api_response.body['access_token'])\n

The code uses the library we have generated to get an OAuth2 access token. With the o_auth2_access_token_api.OAuth2AccessTokenApi() we are able to call the oauth2_token() method.

The body of the request is being created by passing the grant_type, client_id and client_secret to the oauth2_token() method. If you want to know more about how to get the access token check the authorization guide.

"},{"location":"developer-tools/python/#call-the-flight-offers-search-api","title":"Call the Flight Offers Search API","text":"

Now let's call the Flight Offers Search API. Since thr OpenAPI Generator works with OAS3 you will have to convert the flight search specification to version 3 using the swagger editor (https://editor.swagger.io/){:target=\"_blank\"}. To do the convertion, navigate to the top menu and select Edit then Convert to OAS 3.

The process is the same as above. You need to generate the library:

  docker run --rm \\\n  -v ${PWD}:/local openapitools/openapi-generator-cli generate \\\n  -i /local/FlightOffersSearch_v2_swagger_specification.yaml \\\n  -g python \\\n  -o /local/flights\n

and then install it in your environment:

pip install openapi-client\n

Then create a file flights.py and add the following code:

import openapi_client\nfrom openapi_client.apis.tags import shopping_api\n\nflight_configuration = openapi_client.Configuration()\napi_client = openapi_client.ApiClient(flight_configuration)\napi_client.default_headers['Authorization'] = 'Bearer YOUR_ACCESS_TOKEN'\n\napi_instance = shopping_api.ShoppingApi(api_client)\n\nquery_params = {\n    'originLocationCode': \"MAD\",\n    'destinationLocationCode': \"BCN\",\n    'departureDate': \"2023-05-02\",\n    'adults': 1,\n    'max': 2\n}\ntry:\n    api_response = api_instance.get_flight_offers(\n        query_params=query_params,\n    )\n    print(api_response.body)\nexcept openapi_client.ApiException as e:\n    print(\"Exception: %s\\n\" % e)\n

The above code uses the generated library to to search for flight offers. It creates an instance of the shopping_api.ShoppingApi class and setting the default headers to include the access token.

Then it is calling the get_flight_offers() method to make the API request.

"},{"location":"developer-tools/graphql/","title":"GraphQL Resources","text":"

Explore our collection of GraphQL resources, including guides on creating GraphQL wrappers for REST APIs and converting OpenAPI specifications into GraphQL schemas.

Article Description GraphQL wrapper for REST (Node) This article provides a guide on how to create a GraphQL wrapper for a REST API using Node.js. GraphQL wrapper for REST (Python) Learn how to create a GraphQL wrapper for a REST API using Python. OpenAPI to GraphQL converter Discover how to convert an OpenAPI Specification into a GraphQL schema, enabling seamless integration of GraphQL with existing REST APIs."},{"location":"developer-tools/graphql/rest-to-graphql-export/","title":"Convert an OpenAPI specification to a GraphQL schema","text":"

Follow this tutorial to learn how to convert an OpenAPI specification to a GraphQL schema.

Our Self-Service APIs are stored as OpenAPI specs in this repository. In this tutorial, we will use the City Search API spec as an example and convert it to a GraphQL schema using openapi-to-graphql. While there are many similar tools available, the underlying principle remains the same.

The goal is to create a GraphQL schema and then utilise this schema for your GraphQL wrapper, regardless of the programming language your GraphQL server is written in.

"},{"location":"developer-tools/graphql/rest-to-graphql-export/#pre-requisites","title":"Pre-requisites","text":"

Before you begin, you need to:

  • Have Node.js installed on your machine.
"},{"location":"developer-tools/graphql/rest-to-graphql-export/#install-the-openapi-to-graphql-tool","title":"Install the openapi-to-graphql tool","text":"
npm install -g openapi-to-graphql-cli\n
"},{"location":"developer-tools/graphql/rest-to-graphql-export/#download-the-required-openapi-schema","title":"Download the required OpenAPI schema","text":"

Navigate to the amadeus-open-api-specification repository and download the required specification for your API. Alternatively, you can visit the Developers portal and download the specification from the page of a specific API.

"},{"location":"developer-tools/graphql/rest-to-graphql-export/#convert","title":"Convert","text":"

For example, let's download the City Search API OpenAPI specification to the same directory where we run our project. We will then specify the name for the output file - schema.graphql and execute the following command:

openapi-to-graphql CitySearch_v1_Version_1.0_swagger_specification.json --save schema.graphql   \n
"},{"location":"developer-tools/graphql/rest-to-graphql-export/#access-the-generated-schema","title":"Access the generated schema","text":"

The schema is now created as schema.graphql. For the City Search API, the contents will appear like this:

type Query {\n  \"\"\"\n  GET Cities by keyword\n\n  Equivalent to GET /reference-data/locations/cities\n  \"\"\"\n  referenceDataLocationsCities(\n    \"\"\"ISO 3166 Alpha-2 code. e.g. \"US\" United States of America.\"\"\"\n    countryCode: String\n\n    \"\"\"Resources to be included example : Airports\"\"\"\n    include: [IncludeListItem]\n\n    \"\"\"keyword that should represent the start of a word in a city name.\"\"\"\n    keyword: String!\n\n    \"\"\"Number of results user want to see in response.\"\"\"\n    max: Int\n  ): String\n}\n\nenum IncludeListItem {\n  AIRPORTS\n}\n
"},{"location":"developer-tools/graphql/rest-to-graphql-export/#import-the-schema-to-your-code","title":"Import the schema to your code","text":"

Depending on the server that we use, we will now need to reference this schema. For example, in Node.js, you can use the Apollo Server library to create a GraphQL server:

const { ApolloServer, gql } = require('apollo-server');\nconst fs = require('fs');\n\nconst typeDefs = gql(fs.readFileSync('<path-to-generated-graphql-schema>', 'utf8'));\nconst resolvers = {}; // Implement your resolvers here\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nserver.listen().then(({ url }) => {\n  console.log(`\ud83d\ude80 Server ready at ${url}`);\n});\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/","title":"Wrap a REST API endpoint with GraphQL in Node.js","text":"

Follow this tutorial to wrap a REST API endpoint with a GraphQL wrapper to make it accessible via a dedicated GraphQL API.

In this tutorial we will use a standalone Apollo server, which is an easy-to-use option for setting up a GraphQL server without any additional configuration. For the REST API endpoint we will use the City Search API.

The goal of this tutorial is to create a GraphQL API, which will only use the keyword parameter for the query and return only the name parameter in the response.

"},{"location":"developer-tools/graphql/rest-to-graphql-node/#pre-requisites","title":"Pre-requisites","text":"

Before you begin, you need to:

  • Register your application with Amadeus for Developers as described in Making your first API call.
  • Have Node.js installed on your machine.
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#initialize-a-new-nodejs-project","title":"Initialize a new Node.js project","text":"
  1. Open your terminal and create a new directory for this project:
    mkdir graphql-wrapper\n
  2. Navigate to the directory and run the following command to initialize a new Node.js project:
    cd graphql-wrapper\nnpm init -y\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#install-required-dependencies","title":"Install required dependencies","text":"

Install apollo-server, graphql, and node-fetch packages by running:

npm install apollo-server graphql node-fetch\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#define-graphql-schema","title":"Define GraphQL schema","text":"

Create a schema.graphql file with the necessary types and queries. In this tutorial, we are only using the keyword parameter to query the City Search API and we are only interested in the name parameters that this query returns in the response data. For this reason, our schema.graphql will look as follows:

type Query {\n  getCities(keyword: String!): [City]\n}\n\ntype City {\n  name: String\n}\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#create-a-data-fetching-function","title":"Create a data fetching function","text":"

Information

The node-fetch package is an ECMAScript module (ESM), so we will use .mjs extensions and ECMAScript module syntax in these examples.

Create a fetchData.mjs file and define a function that fetches data from the REST endpoint using node-fetch:

import fetch from 'node-fetch';\n\n\nconst fetchCities = async (keyword, token) => {\n  const endpoint = `https://test.api.amadeus.com/v1/reference-data/locations/cities?keyword=${keyword}`;\n\n  const response = await fetch(endpoint, {\n    headers: {\n      'Authorization': `Bearer ${token}`\n    }\n  });\n\n  const data = await response.json();\n\n  console.log('API Response:', data);\n\n  return data.data;\n};\n\nexport { fetchCities };\n

In the above example we are outputting logs to the console for easier troubleshooting.

"},{"location":"developer-tools/graphql/rest-to-graphql-node/#implement-graphql-resolvers","title":"Implement GraphQL resolvers","text":"

Create a resolvers.mjs file and implement the resolver functions for the queries:

import { fetchCities } from './fetchData.mjs';\n\nconst resolvers = {\n  Query: {\n    getCities: async (_, { keyword }, { token }) => {\n      const cities = await fetchCities(keyword, token);\n      return cities.map(city => ({ name: city.name }));\n    },\n  },\n};\n\nexport default resolvers;\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#set-up-the-apollo-server","title":"Set up the Apollo server","text":"

Create the main file index.mjs that sets up the Apollo server with the schema and resolvers:

import { ApolloServer, gql } from 'apollo-server';\nimport { readFileSync } from 'fs';\nimport resolvers from './resolvers.mjs';\n\nconst typeDefs = gql(readFileSync('./schema.graphql', 'utf8'));\n\nconst server = new ApolloServer({\n  typeDefs,\n  resolvers,\n  context: ({ req }) => {\n    const token = req.headers.authorization || '';\n\n    return { token };\n  },\n});\n\nserver.listen().then(({ url }) => {\n  console.log(`\ud83d\ude80 Server ready at ${url}`);\n});\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#run-the-server","title":"Run the server","text":"

Open the terminal and run:

node index.mjs\n
"},{"location":"developer-tools/graphql/rest-to-graphql-node/#query-the-graphql-api","title":"Query the GraphQL API","text":"

Information

Before running the query, make sure to obtain the token as described in our Authorization guide.

Now that we have the server running, we can send requests to it. The most straightforward method to do this is by using curl. To query this API by the keyword \"Paris\":

curl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: <your_bearer_token>\" \\\n  -d '{ \"query\": \"{ getCities(keyword: \\\"PARIS\\\") { name } }\" }' \\\n  http://localhost:4000/\n

If your token is valid, the above command will return a list of city names that contain the word Paris.

"},{"location":"developer-tools/graphql/rest-to-graphql-python/","title":"Wrap a REST API endpoint with GraphQL in Python","text":"

Follow this tutorial to wrap a REST API endpoint with a GraphQL wrapper to make it accessible via a dedicated GraphQL API.

In this tutorial we will use a standalone Ariadne server, which is a Python library for implementing GraphQL servers. It aims to make it easy and enjoyable for developers to create GraphQL APIs by using a schema-first approach, where you define your GraphQL schema using the Schema Definition Language (SDL) and then map your resolvers to the schema.

For the REST API endpoint we will use the City Search API.

The goal of this tutorial is to create a GraphQL API, which will only use the keyword parameter for the query and return only the name parameter in the response.

"},{"location":"developer-tools/graphql/rest-to-graphql-python/#pre-requisites","title":"Pre-requisites","text":"

Before you begin, you need to:

  • Register your application with Amadeus for Developers as described in Making your first API call.
  • Have Python installed on your machine.
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#create-a-new-python-project","title":"Create a new Python project","text":"
  1. Open your terminal and create a new directory for this project:
    mkdir graphql-wrapper\n
  2. Navigate to the directory:
    cd graphql-wrapper\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#install-required-dependencies","title":"Install required dependencies","text":"

Install uvicorn and requests packages by running:

pip install uvicorn\npip install requests\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#define-graphql-schema","title":"Define GraphQL schema","text":"

Create a schema.graphql file with the necessary types and queries. In this tutorial, we are only using the keyword parameter to query the City Search API and we are only interested in the name parameters that this query returns in the response data. For this reason, our schema.graphql will look as follows:

type Query {\n  getCities(keyword: String!): [City]\n}\n\ntype City {\n  name: String\n}\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#create-a-data-fetching-function","title":"Create a data fetching function","text":"

Create a fetch_data.py file and define a function that fetches data from the REST endpoint:

import requests\n\ndef fetch_cities(keyword, token):\n    endpoint = f\"https://test.api.amadeus.com/v1/reference-data/locations/cities?keyword={keyword}\"\n\n    headers = {\n        \"Authorization\": f\"Bearer {token}\"\n    }\n\n    response = requests.get(endpoint, headers=headers)\n    data = response.json()\n\n    print(\"API Response:\", data)\n\n    return data[\"data\"]\n

In the above example we are outputting logs to the console for easier troubleshooting.

"},{"location":"developer-tools/graphql/rest-to-graphql-python/#implement-graphql-resolvers","title":"Implement GraphQL resolvers","text":"

Create a resolvers.py file and implement the resolver functions for the queries:

from fetch_data import fetch_cities\n\ndef resolve_get_cities(_, info, keyword):\n    token = info.context[\"request\"].headers[\"authorization\"]\n    cities = fetch_cities(keyword, token)\n    return [{\"name\": city[\"name\"]} for city in cities]\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#set-up-the-ariadne-server","title":"Set up the Ariadne server","text":"

Create the main file main.py that sets up the Ariadne server with the schema and resolvers:

from ariadne import QueryType, make_executable_schema, load_schema_from_path\nfrom ariadne.asgi import GraphQL\nfrom resolvers import resolve_get_cities\n\ntype_defs = load_schema_from_path(\"schema.graphql\")\nquery = QueryType()\nquery.set_field(\"getCities\", resolve_get_cities)\n\nschema = make_executable_schema(type_defs, query)\napp = GraphQL(schema, debug=True)\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#run-the-server","title":"Run the server","text":"

Open the terminal and run:

uvicorn main:app\n
"},{"location":"developer-tools/graphql/rest-to-graphql-python/#query-the-graphql-api","title":"Query the GraphQL API","text":"

Information

Before running the query, make sure to obtain the token as described in our Authorization guide.

Now that we have the server running, we can send requests to it. The most straightforward method to do this is by using curl. To query this API by the keyword \"Paris\":

curl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: <your_bearer_token>\" \\\n  -d '{ \"query\": \"{ getCities(keyword: \\\"PARIS\\\") { name } }\" }' \\\n  http://localhost:8000/\n

If your token is valid, the above command will return a list of city names that contain the word Paris.

"},{"location":"examples/","title":"Code examples and prototypes","text":"

To facilitate a smooth and efficient start, or to spark creativity in using our Self-Service APIs within your applications, we've assembled a compilation of code examples and prototypes. These resources aim to serve as guides for you to quickly integrate our APIs into your project.

Asset Link Code examples For each SDK and API endpoint Interactive code examples Flight Search and Hotel Search Prototypes Official prototypesCommunity prototypes"},{"location":"examples/code-example/","title":"Code Examples","text":"

To help you get up and running with the Amadeus Self-Service APIs as smoothly as possible, we have provided code examples for each SDK and API endpoint. Simply copy and paste these examples into your project to make API requests.

If you have any questions or ideas for improvement, don't hesitate to raise an issue or a pull request directly from GitHub examples repository.

"},{"location":"examples/code-example/#travel-safety","title":"Travel safety","text":""},{"location":"examples/code-example/#safe-place","title":"Safe Place","text":"

By geolocation

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns safety information for a location in Barcelona based on geolocation coordinates\n    '''\n    response = amadeus.safety.safety_rated_locations.get(latitude=41.397158, longitude=2.160873)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// How safe is Barcelona? (based a geo location and a radius)\namadeus.safety.safetyRatedLocations.get({\n  latitude: 41.397158,\n  longitude: 2.160873\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.SafePlace;\n\n\npublic class SafePlace {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.get(Params\n              .with(\"latitude\", \"41.39715\")\n              .and(\"longitude\", \"2.160873\"));\n\n       if(safetyScore[0].getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + safetyScore[0].getResponse().getStatusCode());\n               System.exit(-1);\n        }\n      System.out.println(safetyScore[0]);\n    }\n}\n

By square

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns safety information in Barcelona within a designated area\n    '''\n    response = amadeus.safety.safety_rated_locations.by_square.get(north=41.397158, west=2.160873,\n                                                                   south=41.394582, east=2.177181)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// How safe is Barcelona? (based on a square)\namadeus.safety.safetyRatedLocations.bySquare.get({\n  north: 41.397158,\n  west: 2.160873,\n  south: 41.394582,\n  east: 2.177181\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.SafePlace;\n\n\npublic class SafePlace {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.bySquare.get(Params\n        .with(\"north\", \"41.397158\")\n        .and(\"west\", \"2.160873\")\n        .and(\"south\", \"41.394582\")\n        .and(\"east\", \"2.177181\"));\n\n       if(safetyScore[0].getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + safetyScore[0].getResponse().getStatusCode());\n               System.exit(-1);\n    }\n      System.out.println(safetyScore[0]);\n    }\n}\n

By Id

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns safety information in Barcelona within a designated area\n    '''\n    response = amadeus.safety.safety_rated_location('Q930400801').get()\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What is the safety information of a location based on it's Id?\namadeus.safety.safetyRatedLocation('Q930400801').get().then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.SafePlace;\n\n\npublic class SafePlace {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      SafePlace safetyScore = amadeus.safety.safetyRatedLocation(\"Q930400801\").get();\n\n       if(safetyScore.getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + safetyScore.getResponse().getStatusCode());\n               System.exit(-1);\n    }\n      System.out.println(safetyScore);\n    }\n}\n
"},{"location":"examples/code-example/#flights","title":"Flights","text":""},{"location":"examples/code-example/#airline-routes","title":"Airline Routes","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What are the destinations served by the British Airways (BA)?\n    '''\n    response = amadeus.airline.destinations.get(airlineCode='BA')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
const Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_AMADEUS_API_KEY',\n  clientSecret: 'YOUR_AMADEUS_API_SECRET'\n});\n// Or `var amadeus = new Amadeus()` if the environment variables are set\n\n\n// What are the destinations served by the British Airways (BA)?\namadeus.airline.destinations.get({airlineCode: 'BA'})\n  .then(response => console.log(response))\n  .catch(err => console.error(err));\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Destination;\n\n// What are the destinations served by the British Airways (BA)?\npublic class AirlineRoutes {\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Set query parameters\n    Params params = Params\n        .with(\"airlineCode\", \"BA\");\n\n    // Run the query\n    Destination[] destinations = amadeus.airline.destinations.get(params);\n\n    if (destinations[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + destinations[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(destinations[0]);\n  }\n}\n
"},{"location":"examples/code-example/#airport-routes","title":"Airport Routes","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What are the destinations served by MAD airport?\n    '''\n    response = amadeus.airport.direct_destinations.get(departureAirportCode='MAD')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n    clientId: 'YOUR_API_KEY',\n    clientSecret: 'YOUR_API_SECRET'\n});\n\n// Find all destinations served by CDG Airport\namadeus.airport.directDestinations.get({\n    departureAirportCode: 'MAD',\n}).catch(function (response) {\n    console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Destination;\n\npublic class AirportRoutes {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    Destination[] directDestinations = amadeus.airport.directDestinations.get(\n      Params.with(\"departureAirportCode\", \"MAD\"));\n\n    if (directDestinations[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + directDestinations[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(directDestinations[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-offers-search","title":"Flight Offers Search","text":"

GET

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Find the cheapest flights from SYD to BKK\n    '''\n    response = amadeus.shopping.flight_offers_search.get(\n        originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-07-01', adults=1)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Find the cheapest flights from SYD to BKK\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'SYD',\n  destinationLocationCode: 'BKK',\n  departureDate: '2022-08-01',\n  adults: '2'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\n\npublic class FlightOffersSearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n                  Params.with(\"originLocationCode\", \"SYD\")\n                          .and(\"destinationLocationCode\", \"BKK\")\n                          .and(\"departureDate\", \"2022-11-01\")\n                          .and(\"returnDate\", \"2022-11-08\")\n                          .and(\"adults\", 2)\n                          .and(\"max\", 3));\n\n    if (flightOffersSearches[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightOffersSearches[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightOffersSearches[0]);\n  }\n}\n

POST

PythonNodeJava
import json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\njson_string = '{ \"currencyCode\": \"ZAR\", \"originDestinations\": [ { \"id\": \"1\", \"originLocationCode\": \"JNB\", ' \\\n              '\"destinationLocationCode\": \"CPT\", \"departureDateTimeRange\": { \"date\": \"2022-07-01\", \"time\": \"00:00:00\" ' \\\n              '} }, { \"id\": \"2\", \"originLocationCode\": \"CPT\", \"destinationLocationCode\": \"JNB\", ' \\\n              '\"departureDateTimeRange\": { \"date\": \"2022-07-29\", \"time\": \"00:00:00\" } } ], \"travelers\": [ { \"id\": ' \\\n              '\"1\", \"travelerType\": \"ADULT\" }, { \"id\": \"2\", \"travelerType\": \"ADULT\" }, { \"id\": \"3\", \"travelerType\": ' \\\n              '\"HELD_INFANT\", \"associatedAdultId\": \"1\" } ], \"sources\": [ \"GDS\" ], \"searchCriteria\": { ' \\\n              '\"excludeAllotments\": true, \"addOneWayOffers\": false, \"maxFlightOffers\": 10, ' \\\n              '\"allowAlternativeFareOptions\": true, \"oneFlightOfferPerDay\": true, \"additionalInformation\": { ' \\\n              '\"chargeableCheckedBags\": true, \"brandedFares\": true, \"fareRules\": false }, \"pricingOptions\": { ' \\\n              '\"includedCheckedBagsOnly\": false }, \"flightFilters\": { \"crossBorderAllowed\": true, ' \\\n              '\"moreOvernightsAllowed\": true, \"returnToDepartureAirport\": true, \"railSegmentAllowed\": true, ' \\\n              '\"busSegmentAllowed\": true, \"carrierRestrictions\": { \"blacklistedInEUAllowed\": true, ' \\\n              '\"includedCarrierCodes\": [ \"FA\" ] }, \"cabinRestrictions\": [ { \"cabin\": \"ECONOMY\", \"coverage\": ' \\\n              '\"MOST_SEGMENTS\", \"originDestinationIds\": [ \"2\" ] }, { \"cabin\": \"ECONOMY\", \"coverage\": \"MOST_SEGMENTS\", ' \\\n              '\"originDestinationIds\": [ \"1\" ] } ], \"connectionRestriction\": { \"airportChangeAllowed\": true, ' \\\n              '\"technicalStopsAllowed\": true } } } }'\n\nbody = json.loads(json_string)\ntry:\n    response = amadeus.shopping.flight_offers_search.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Find the cheapest flights from SYD to BKK\namadeus.shopping.flightOffersSearch.post(JSON.stringify({\n  \"currencyCode\": \"USD\",\n  \"originDestinations\": [{\n    \"id\": \"1\",\n    \"originLocationCode\": \"SYD\",\n    \"destinationLocationCode\": \"BKK\",\n    \"departureDateTimeRange\": {\n      \"date\": \"2022-08-01\",\n      \"time\": \"10:00:00\"\n    }\n  },\n  {\n    \"id\": \"2\",\n    \"originLocationCode\": \"BKK\",\n    \"destinationLocationCode\": \"SYD\",\n    \"departureDateTimeRange\": {\n      \"date\": \"2022-08-05\",\n      \"time\": \"17:00:00\"\n    }\n  }\n  ],\n  \"travelers\": [{\n    \"id\": \"1\",\n    \"travelerType\": \"ADULT\",\n    \"fareOptions\": [\n      \"STANDARD\"\n    ]\n  },\n  {\n    \"id\": \"2\",\n    \"travelerType\": \"CHILD\",\n    \"fareOptions\": [\n      \"STANDARD\"\n    ]\n  }\n  ],\n  \"sources\": [\n    \"GDS\"\n  ],\n  \"searchCriteria\": {\n    \"maxFlightOffers\": 50,\n    \"flightFilters\": {\n      \"cabinRestrictions\": [{\n        \"cabin\": \"BUSINESS\",\n        \"coverage\": \"MOST_SEGMENTS\",\n        \"originDestinationIds\": [\n          \"1\"\n        ]\n      }],\n      \"carrierRestrictions\": {\n        \"excludedCarrierCodes\": [\n          \"AA\",\n          \"TP\",\n          \"AZ\"\n        ]\n      }\n    }\n  }\n})).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\n\npublic class FlightOffersSearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    String body = \"{\\\"currencyCode\\\":\\\"USD\\\",\\\"originDestinations\\\":[{\\\"id\\\":\\\"1\\\",\\\"originLocationCode\\\":\\\"RIO\\\",\\\"destinationLocationCode\\\":\\\"MAD\\\",\\\"departureDateTimeRange\\\":{\\\"date\\\":\\\"2022-08-01\\\",\\\"time\\\":\\\"10:00:00\\\"}},{\\\"id\\\":\\\"2\\\",\\\"originLocationCode\\\":\\\"MAD\\\",\\\"destinationLocationCode\\\":\\\"RIO\\\",\\\"departureDateTimeRange\\\":{\\\"date\\\":\\\"2022-08-05\\\",\\\"time\\\":\\\"17:00:00\\\"}}],\\\"travelers\\\":[{\\\"id\\\":\\\"1\\\",\\\"travelerType\\\":\\\"ADULT\\\",\\\"fareOptions\\\":[\\\"STANDARD\\\"]},{\\\"id\\\":\\\"2\\\",\\\"travelerType\\\":\\\"CHILD\\\",\\\"fareOptions\\\":[\\\"STANDARD\\\"]}],\\\"sources\\\":[\\\"GDS\\\"],\\\"searchCriteria\\\":{\\\"maxFlightOffers\\\":2,\\\"flightFilters\\\":{\\\"cabinRestrictions\\\":[{\\\"cabin\\\":\\\"BUSINESS\\\",\\\"coverage\\\":\\\"MOST_SEGMENTS\\\",\\\"originDestinationIds\\\":[\\\"1\\\"]}],\\\"carrierRestrictions\\\":{\\\"excludedCarrierCodes\\\":[\\\"AA\\\",\\\"TP\\\",\\\"AZ\\\"]}}}}\";\n\n    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.post(body);\n\n    if (flightOffersSearches[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightOffersSearches[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightOffersSearches[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-offers-price","title":"Flight Offers Price","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Confirm availability and price from SYD to BKK in summer 2022\n    '''\n    flights = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK',\n                                                        departureDate='2022-07-01', adults=1).data\n    response_one_flight = amadeus.shopping.flight_offers.pricing.post(\n        flights[0])\n    print(response_one_flight.data)\n\n    response_two_flights = amadeus.shopping.flight_offers.pricing.post(\n        flights[0:2])\n    print(response_two_flights.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Confirm availability and price from SYD to BKK in summer 2020\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'MAD',\n  destinationLocationCode: 'ATH',\n  departureDate: '2024-07-01',\n  adults: '1'\n}).then(function (flightOffersSearchResponse) {\n  return amadeus.shopping.flightOffers.pricing.post(\n    JSON.stringify({\n      'data': {\n        'type': 'flight-offers-pricing',\n        'flightOffers': [flightOffersSearchResponse.data[0]]\n      }\n    }), {include: 'credit-card-fees,detailed-fare-rules'} \n  )\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\nimport com.amadeus.resources.FlightPrice;\n\npublic class FlightOffersPrice {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n        Params.with(\"originLocationCode\", \"SYD\")\n                .and(\"destinationLocationCode\", \"BKK\")\n                .and(\"departureDate\", \"2022-11-01\")\n                .and(\"returnDate\", \"2022-11-08\")\n                .and(\"adults\", 1)\n                .and(\"max\", 2));\n\n    // We price the 2nd flight of the list to confirm the price and the availability\n    FlightPrice flightPricing = amadeus.shopping.flightOffersSearch.pricing.post(\n            flightOffersSearches[1],\n            Params.with(\"include\", \"detailed-fare-rules\")\n              .and(\"forceClass\", \"false\")\n          );\n\n    System.out.println(flightPricing.getResponse());\n  }\n}\n
"},{"location":"examples/code-example/#flight-inspiration-search","title":"Flight Inspiration Search","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus/# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Find cheapest destinations from Madrid\n    '''\n    response = amadeus.shopping.flight_destinations.get(origin='MAD')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Find cheapest destinations from Madrid\namadeus.shopping.flightDestinations.get({\n  origin: 'MAD'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightDestination;\n\npublic class FlightInspirationSearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    FlightDestination[] flightDestinations = amadeus.shopping.flightDestinations.get(Params\n    .with(\"origin\", \"MAD\"));\n\n    if (flightDestinations[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightDestinations[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightDestinations[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-cheapest-date-search","title":"Flight Cheapest Date Search","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Find cheapest dates from Madrid to Munich\n    '''\n    response = amadeus.shopping.flight_dates.get(origin='MAD', destination='MUC')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Find cheapest dates from Madrid to Munich\namadeus.shopping.flightDates.get({\n  origin: 'MAD',\n  destination: 'MUC'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightDate;\n\npublic class FlightCheapestDate {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    FlightDate[] flightDates = amadeus.shopping.flightDates.get(Params\n      .with(\"origin\", \"MAD\")\n      .and(\"destination\", \"MUC\"));\n\n    if(flightDates[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + (flightDates[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n    System.out.println((flightDates[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-availabilities-search","title":"Flight Availabilities Search","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    body = {\n        \"originDestinations\": [\n            {\n                \"id\": \"1\",\n                \"originLocationCode\": \"MIA\",\n                \"destinationLocationCode\": \"ATL\",\n                \"departureDateTime\": {\n                    \"date\": \"2022-11-01\"\n                }\n            }\n        ],\n        \"travelers\": [\n            {\n                \"id\": \"1\",\n                \"travelerType\": \"ADULT\"\n            }\n        ],\n        \"sources\": [\n            \"GDS\"\n        ]\n    }\n\n    response = amadeus.shopping.availability.flight_availabilities.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n    clientId: 'YOUR_API_KEY',\n    clientSecret: 'YOUR_API_SECRET'\n});\n\nbody = JSON.stringify({\n    \"originDestinations\": [\n        {\n            \"id\": \"1\",\n            \"originLocationCode\": \"MIA\",\n            \"destinationLocationCode\": \"ATL\",\n            \"departureDateTime\": {\n                \"date\": \"2022-11-01\"\n            }\n        }\n    ],\n    \"travelers\": [\n        {\n            \"id\": \"1\",\n            \"travelerType\": \"ADULT\"\n        }\n    ],\n    \"sources\": [\n        \"GDS\"\n    ]\n})\n\namadeus.shopping.availability.flightAvailabilities.post(body).then(function (response) {\n    console.log(response);\n}).catch(function (response) {\n    console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Response;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightAvailability;\n\npublic class FlightAvailabilities {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    String body = \"{\\\"originDestinations\\\":[{\\\"id\\\":\\\"1\\\",\\\"originLocationCode\\\":\\\"ATH\\\",\\\"destinationLocationCode\\\":\\\"SKG\\\",\\\"departureDateTime\\\":{\\\"date\\\":\\\"2023-08-14\\\",\\\"time\\\":\\\"21:15:00\\\"}}],\\\"travelers\\\":[{\\\"id\\\":\\\"1\\\",\\\"travelerType\\\":\\\"ADULT\\\"}],\\\"sources\\\":[\\\"GDS\\\"]}\";\n\n    FlightAvailability[] flightAvailabilities = amadeus.shopping.availability.flightAvailabilities.post(body);\n\n    if (flightAvailabilities[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightAvailabilities[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightAvailabilities[0]);\n  }\n\n}\n
"},{"location":"examples/code-example/#branded-upsell","title":"Branded Upsell","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nimport json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    json_string = '{ \"data\": { \"type\": \"flight-offers-upselling\", \"flightOffers\": [ { \"type\": \"flight-offer\", ' \\\n                  '\"id\": \"1\", ' \\\n                  '\"source\": \"GDS\", \"instantTicketingRequired\": false, \"nonHomogeneous\": false, \"oneWay\": false, ' \\\n                  '\"lastTicketingDate\": \"2022-05-11\", \"numberOfBookableSeats\": 9, \"itineraries\": [ { \"duration\": ' \\\n                  '\"PT2H10M\", ' \\\n                  '\"segments\": [ { \"departure\": { \"iataCode\": \"CDG\", \"terminal\": \"3\", \"at\": \"2022-07-04T20:45:00\" }, ' \\\n                  '\"arrival\": { ' \\\n                  '\"iataCode\": \"MAD\", \"terminal\": \"4\", \"at\": \"2022-07-04T22:55:00\" }, \"carrierCode\": \"IB\", ' \\\n                  '\"number\": \"3741\", ' \\\n                  '\"aircraft\": { \"code\": \"32A\" }, \"operating\": { \"carrierCode\": \"I2\" }, \"duration\": \"PT2H10M\", ' \\\n                  '\"id\": \"4\", ' \\\n                  '\"numberOfStops\": 0, \"blacklistedInEU\": false } ] } ], \"price\": { \"currency\": \"EUR\", ' \\\n                  '\"total\": \"123.02\", ' \\\n                  '\"base\": \"92.00\", \"fees\": [ { \"amount\": \"0.00\", \"type\": \"SUPPLIER\" }, { \"amount\": \"0.00\", ' \\\n                  '\"type\": \"TICKETING\" } ' \\\n                  '], \"grandTotal\": \"123.02\", \"additionalServices\": [ { \"amount\": \"30.00\", \"type\": \"CHECKED_BAGS\" } ] ' \\\n                  '}, ' \\\n                  '\"pricingOptions\": { \"fareType\": [ \"PUBLISHED\" ], \"includedCheckedBagsOnly\": false }, ' \\\n                  '\"validatingAirlineCodes\": [ ' \\\n                  '\"IB\" ], \"travelerPricings\": [ { \"travelerId\": \"1\", \"fareOption\": \"STANDARD\", \"travelerType\": ' \\\n                  '\"ADULT\", ' \\\n                  '\"price\": { \"currency\": \"EUR\", \"total\": \"123.02\", \"base\": \"92.00\" }, \"fareDetailsBySegment\": [ { ' \\\n                  '\"segmentId\": ' \\\n                  '\"4\", \"cabin\": \"ECONOMY\", \"fareBasis\": \"SDNNEOB2\", \"brandedFare\": \"NOBAG\", \"class\": \"S\", ' \\\n                  '\"includedCheckedBags\": { ' \\\n                  '\"quantity\": 0 } } ] } ] } ], \"payments\": [ { \"brand\": \"VISA_IXARIS\", \"binNumber\": 123456, ' \\\n                  '\"flightOfferIds\": [ 1 ' \\\n                  '] } ] } } '\n\n    body = json.loads(json_string)\n    response = amadeus.shopping.flight_offers.upselling.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_AMADEUS_API_KEY',\n  clientSecret: 'YOUR_AMADEUS_API_SECRET'\n});\n\n\n// Search flights from LON to DEL\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'LON',\n  destinationLocationCode: 'DEL',\n  departureDate: '2023-06-01',\n  returnDate: '2023-06-30',\n  adults: '1'\n//then Get branded fares available from the first offer\n}).then(function (flightOffersResponse) {\n  return amadeus.shopping.flightOffers.upselling.post(\n    JSON.stringify({\n      \"data\": {\n        \"type\": \"flight-offers-upselling\",\n        \"flightOffers\": [\n          flightOffersResponse.data[0]\n        ],\n        \"payments\": [\n          {\n            \"brand\": \"VISA_IXARIS\",\n            \"binNumber\": 123456,\n            \"flightOfferIds\": [\n              1\n            ]\n          }\n        ]\n      }\n    })\n  );\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\n\npublic class BrandedFaresUpsell {\n\n  public static void main(String[] args) throws ResponseException {\n\n        Amadeus amadeus = Amadeus\n            .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n            .build();\n\n        FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n            Params.with(\"originLocationCode\", \"SYD\")\n                    .and(\"destinationLocationCode\", \"BKK\")\n                    .and(\"departureDate\", \"2023-11-01\")\n                    .and(\"returnDate\", \"2023-11-08\")\n                    .and(\"adults\", 1)\n                    .and(\"max\", 2));\n\n        FlightOfferSearch[] upsellFlightOffers = amadeus.shopping.flightOffers.upselling.post(flightOffersSearches[0]);\n\n        if (upsellFlightOffers[0].getResponse().getStatusCode() != 200) {\n            System.out.println(\"Wrong status code: \" + upsellFlightOffers[0].getResponse().getStatusCode());\n            System.exit(-1);\n        }\n\n        System.out.println(upsellFlightOffers[0]);\n    }\n}\n
"},{"location":"examples/code-example/#seatmap-display","title":"SeatMap Display","text":"

GET

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Retrieve the seat map of a flight present in an order\n    '''\n    response = amadeus.shopping.seatmaps.get(flightorderId='eJzTd9cPDPMwcooAAAtXAmE=')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Returns all the seat maps of a given order\namadeus.shopping.seatmaps.get({\n  'flight-orderId': 'eJzTd9cPDPMwcooAAAtXAmE='\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.SeatMap;\n\npublic class SeatMaps {\n    public static void main(String[] args) throws ResponseException {\n\n        Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n        SeatMap[] seatmap = amadeus.shopping.seatMaps.get(Params\n                .with(\"flight-orderId\", \"eJzTd9cPDPMwcooAAAtXAmE=\"));\n        if(seatmap.length != 0){\n          if (seatmap[0].getResponse().getStatusCode() != 200) {\n            System.out.println(\"Wrong status code: \" + seatmap[0].getResponse().getStatusCode());\n            System.exit(-1);\n          }\n          System.out.println(seatmap[0]);\n        }\n        else {\n          System.out.println(\"No booking found for this flight-orderId\");\n          System.exit(-1);\n        }\n     }\n}\n

POST

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Retrieve the seat map of a given flight offer \n    '''\n    body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',\n                                                     destinationLocationCode='NYC',\n                                                     departureDate='2022-11-01',\n                                                     adults=1,\n                                                     max=1).result\n    response = amadeus.shopping.seatmaps.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Returns all the seat maps of a given flightOffer\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'SYD',\n  destinationLocationCode: 'BKK',\n  departureDate: '2022-08-01',\n  adults: '2'\n}).then(function (flightOffersSearchResponse) {\n  return amadeus.shopping.seatmaps.post(\n    JSON.stringify({\n      'data': [flightOffersSearchResponse.data[0]]\n    })\n  );\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\nimport com.amadeus.resources.SeatMap;\nimport com.google.gson.JsonObject;\n\npublic class SeatMaps {\n    public static void main(String[] args) throws ResponseException {\n\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get(\n                    Params.with(\"originLocationCode\", \"NYC\")\n                            .and(\"destinationLocationCode\", \"MAD\")\n                            .and(\"departureDate\", \"2022-11-01\")\n                            .and(\"returnDate\", \"2022-11-09\")\n                            .and(\"max\", \"1\")\n                            .and(\"adults\", 1));\n\n      JsonObject body = flightOffers[0].getResponse().getResult();\n      SeatMap[] seatmap = amadeus.shopping.seatMaps.post(body);\n\n      if (seatmap[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + seatmap[0].getResponse().getStatusCode());\n        System.exit(-1);\n      }\n\n      System.out.println(seatmap[0]);\n    }\n}\n
"},{"location":"examples/code-example/#flight-create-orders","title":"Flight Create Orders","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntraveler = {\n    'id': '1',\n    'dateOfBirth': '1982-01-16',\n    'name': {\n        'firstName': 'JORGE',\n        'lastName': 'GONZALES'\n    },\n    'gender': 'MALE',\n    'contact': {\n        'emailAddress': 'jorge.gonzales833@telefonica.es',\n        'phones': [{\n            'deviceType': 'MOBILE',\n            'countryCallingCode': '34',\n            'number': '480080076'\n        }]\n    },\n    'documents': [{\n        'documentType': 'PASSPORT',\n        'birthPlace': 'Madrid',\n        'issuanceLocation': 'Madrid',\n        'issuanceDate': '2015-04-14',\n        'number': '00000000',\n        'expiryDate': '2025-04-14',\n        'issuanceCountry': 'ES',\n        'validityCountry': 'ES',\n        'nationality': 'ES',\n        'holder': True\n    }]\n}\n\ntry:\n    # Flight Offers Search to search for flights from MAD to ATH\n    flight_search = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',\n                                                              destinationLocationCode='ATH',\n                                                              departureDate='2022-12-01',\n                                                              adults=1).data\n\n    # Flight Offers Price to confirm the price of the chosen flight\n    price_confirm = amadeus.shopping.flight_offers.pricing.post(\n        flight_search[0]).data\n\n    # Flight Create Orders to book the flight\n    booked_flight = amadeus.booking.flight_orders.post(\n        flight_search[0], traveler).data\n\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require('amadeus');\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Book a flight from MAD to ATH on 2022-08-01\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'MAD',\n  destinationLocationCode: 'ATH',\n  departureDate: '2022-08-01',\n  adults: '1'\n}).then(function (flightOffersResponse) {\n  return amadeus.shopping.flightOffers.pricing.post(\n    JSON.stringify({\n      \"data\": {\n        \"type\": \"flight-offers-pricing\",\n        \"flightOffers\": [\n          flightOffersResponse.data[0]\n        ]\n      }\n    })\n  );\n}).then(function (pricingResponse) {\n  return amadeus.booking.flightOrders.post(\n    JSON.stringify({\n      'data': {\n        'type': 'flight-order',\n        'flightOffers': [pricingResponse.data.flightOffers[0]],\n        'travelers': [{\n          \"id\": \"1\",\n          \"dateOfBirth\": \"1982-01-16\",\n          \"name\": {\n            \"firstName\": \"JORGE\",\n            \"lastName\": \"GONZALES\"\n          },\n          \"gender\": \"MALE\",\n          \"contact\": {\n            \"emailAddress\": \"jorge.gonzales833@telefonica.es\",\n            \"phones\": [{\n              \"deviceType\": \"MOBILE\",\n              \"countryCallingCode\": \"34\",\n              \"number\": \"480080076\"\n            }]\n          },\n          \"documents\": [{\n            \"documentType\": \"PASSPORT\",\n            \"birthPlace\": \"Madrid\",\n            \"issuanceLocation\": \"Madrid\",\n            \"issuanceDate\": \"2015-04-14\",\n            \"number\": \"00000000\",\n            \"expiryDate\": \"2025-04-14\",\n            \"issuanceCountry\": \"ES\",\n            \"validityCountry\": \"ES\",\n            \"nationality\": \"ES\",\n            \"holder\": true\n          }]\n        }]\n      }\n    })\n  );\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\nimport com.amadeus.resources.FlightPrice;\nimport com.amadeus.resources.FlightOrder;\nimport com.amadeus.resources.FlightOrder.Traveler;\nimport com.amadeus.resources.FlightOrder.Document.DocumentType;\nimport com.amadeus.resources.FlightOrder.Phone.DeviceType;\nimport com.amadeus.resources.FlightOrder.Name;\nimport com.amadeus.resources.FlightOrder.Phone;\nimport com.amadeus.resources.FlightOrder.Contact;\nimport com.amadeus.resources.FlightOrder.Document;\n\npublic class FlightSearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n            .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n            .build();\n\n    Traveler traveler = new Traveler();\n\n    traveler.setId(\"1\");\n    traveler.setDateOfBirth(\"2000-04-14\");\n    traveler.setName(new Name(\"JORGE\", \"GONZALES\"));\n\n    Phone[] phone = new Phone[1];\n    phone[0] = new Phone();\n    phone[0].setCountryCallingCode(\"33\");\n    phone[0].setNumber(\"675426222\");\n    phone[0].setDeviceType(DeviceType.MOBILE);\n\n    Contact contact = new Contact();\n    contact.setPhones(phone);\n    traveler.setContact(contact);\n\n    Document[] document = new Document[1];\n    document[0] = new Document();\n    document[0].setDocumentType(DocumentType.PASSPORT);\n    document[0].setNumber(\"480080076\");\n    document[0].setExpiryDate(\"2023-10-11\");\n    document[0].setIssuanceCountry(\"ES\");\n    document[0].setNationality(\"ES\");\n    document[0].setHolder(true);\n    traveler.setDocuments(document);\n\n    Traveler[] travelerArray = new Traveler[1];\n    travelerArray[0] = traveler;\n    System.out.println(travelerArray[0]);\n\n    FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n            Params.with(\"originLocationCode\", \"MAD\")\n                    .and(\"destinationLocationCode\", \"ATH\")\n                    .and(\"departureDate\", \"2023-08-01\")\n                    .and(\"returnDate\", \"2023-08-08\")\n                    .and(\"adults\", 1)\n                    .and(\"max\", 3));\n\n    // We price the 2nd flight of the list to confirm the price and the availability\n    FlightPrice flightPricing = amadeus.shopping.flightOffersSearch.pricing.post(\n            flightOffersSearches[0]);\n\n    // We book the flight previously priced\n    FlightOrder order = amadeus.booking.flightOrders.post(flightPricing, travelerArray);\n    System.out.println(order.getResponse());\n\n    // Return CO2 Emission of the previously booked flight\n    int weight = order.getFlightOffers()[0].getItineraries(\n    )[0].getSegments()[0].getCo2Emissions()[0].getWeight();\n    String unit = order.getFlightOffers()[0].getItineraries(\n    )[0].getSegments()[0].getCo2Emissions()[0].getWeightUnit();\n\n  }\n}\n
"},{"location":"examples/code-example/#flight-order-management","title":"Flight Order Management","text":"

GET

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    # Retrieve the flight order based on it's id\n    '''\n    response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').get()\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Book a flight from MAD to ATH on 2020-08-01 and then retrieve it\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'MAD',\n  destinationLocationCode: 'ATH',\n  departureDate: '2020-08-01',\n  adults: '1'\n}).then(function (flightOffersSearchResponse) {\n  return amadeus.shopping.flightOffers.pricing.post(\n    JSON.stringify({\n      \"data\": {\n        \"type\": \"flight-offers-pricing\",\n        \"flightOffers\": [\n          flightOffersSearchResponse.data[0]\n        ]\n      }\n    })\n  );\n}).then(function (pricingResponse) {\n  return amadeus.booking.flightOrders.post(\n    JSON.stringify({\n      'data': {\n        'type': 'flight-order',\n        'flightOffers': [pricingResponse.data.flightOffers[0]],\n        'travelers': [{\n          \"id\": \"1\",\n          \"dateOfBirth\": \"1982-01-16\",\n          \"name\": {\n            \"firstName\": \"JORGE\",\n            \"lastName\": \"GONZALES\"\n          },\n          \"gender\": \"MALE\",\n          \"contact\": {\n            \"emailAddress\": \"jorge.gonzales833@telefonica.es\",\n            \"phones\": [{\n              \"deviceType\": \"MOBILE\",\n              \"countryCallingCode\": \"34\",\n              \"number\": \"480080076\"\n            }]\n          },\n          \"documents\": [{\n            \"documentType\": \"PASSPORT\",\n            \"birthPlace\": \"Madrid\",\n            \"issuanceLocation\": \"Madrid\",\n            \"issuanceDate\": \"2015-04-14\",\n            \"number\": \"00000000\",\n            \"expiryDate\": \"2025-04-14\",\n            \"issuanceCountry\": \"ES\",\n            \"validityCountry\": \"ES\",\n            \"nationality\": \"ES\",\n            \"holder\": true\n          }]\n        }]\n      }\n    })\n  );\n}).then(function (flightOrdersResponse) {\n  return amadeus.booking.flightOrder(flightOrdersResponse.data.id).get()\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.booking.FlightOrder;\nimport com.amadeus.exceptions.ResponseException;\n\npublic class FlightOrderManagement {\n    public static void main(String[] args) throws ResponseException {\n\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMAEUS_API_SECRET\")\n              .build();\n\n      com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder(\"MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy\").get();\n\n      if (order.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + order.getResponse().getStatusCode());\n        System.exit(-1);\n      }\n\n      System.out.println(order);\n     }\n}\n

DELETE

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    # Delete a given flight order based on it's id\n    '''\n    response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').delete()\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Book a flight from MAD to ATH on 2020-08-01, retrieve it and then delete it\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'MAD',\n  destinationLocationCode: 'ATH',\n  departureDate: '2020-08-01',\n  adults: '1'\n}).then(function (flightOffersSearchResponse) {\n  return amadeus.shopping.flightOffers.pricing.post(\n    JSON.stringify({\n      \"data\": {\n        \"type\": \"flight-offers-pricing\",\n        \"flightOffers\": [\n          flightOffersSearchResponse.data[0]\n        ]\n      }\n    })\n  );\n}).then(function (pricingResponse) {\n  return amadeus.booking.flightOrders.post(\n    JSON.stringify({\n      'data': {\n        'type': 'flight-order',\n        'flightOffers': [pricingResponse.data.flightOffers[0]],\n        'travelers': [{\n          \"id\": \"1\",\n          \"dateOfBirth\": \"1982-01-16\",\n          \"name\": {\n            \"firstName\": \"JORGE\",\n            \"lastName\": \"GONZALES\"\n          },\n          \"gender\": \"MALE\",\n          \"contact\": {\n            \"emailAddress\": \"jorge.gonzales833@telefonica.es\",\n            \"phones\": [{\n              \"deviceType\": \"MOBILE\",\n              \"countryCallingCode\": \"34\",\n              \"number\": \"480080076\"\n            }]\n          },\n          \"documents\": [{\n            \"documentType\": \"PASSPORT\",\n            \"birthPlace\": \"Madrid\",\n            \"issuanceLocation\": \"Madrid\",\n            \"issuanceDate\": \"2015-04-14\",\n            \"number\": \"00000000\",\n            \"expiryDate\": \"2025-04-14\",\n            \"issuanceCountry\": \"ES\",\n            \"validityCountry\": \"ES\",\n            \"nationality\": \"ES\",\n            \"holder\": true\n          }]\n        }]\n      }\n    })\n  );\n}).then(function (flightOrdersResponse) {\n  return amadeus.booking.flightOrder(flightOrdersResponse.data.id).get()\n}).then(function (flightOrderResponse) {\n  return amadeus.booking.flightOrder(flightOrderResponse.data.id).delete()\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.booking.FlightOrder;\nimport com.amadeus.exceptions.ResponseException;\n\npublic class FlightOrderManagement {\n    public static void main(String[] args) throws ResponseException {\n\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS)API_SECRET\")\n              .build();\n\n      com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder(\"MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy\").delete();\n\n      if (order.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + order.getResponse().getStatusCode());\n        System.exit(-1);\n      }\n\n      System.out.println(order);\n     }\n}\n
"},{"location":"examples/code-example/#flight-price-analysis","title":"Flight Price Analysis","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns price metrics of a given itinerary\n    '''\n    response = amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD',\n                                                             destinationIataCode='CDG',\n                                                             departureDate='2022-03-21')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n\n// Am I getting a good deal on this flight?\namadeus.analytics.itineraryPriceMetrics.get({\n  originIataCode: 'MAD',\n  destinationIataCode: 'CDG',\n  departureDate: '2022-01-13',\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.ItineraryPriceMetric;\n\npublic class FlightPriceAnalysis {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_API_ID\",\"YOUR_API_SECRET\")\n        .build();\n\n    // What's the flight price analysis from MAD to CDG\n    ItineraryPriceMetric[] metrics = amadeus.analytics.itineraryPriceMetrics.get(Params\n        .with(\"originIataCode\", \"MAD\")\n        .and(\"destinationIataCode\", \"CDG\")\n        .and(\"departureDate\", \"2022-03-21\"));\n\n    if (metrics[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + metrics[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(metrics[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-delay-prediction","title":"Flight Delay Prediction","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Will there be a delay from BRU to FRA? If so how much delay?\n    '''\n    response = amadeus.travel.predictions.flight_delay.get(originLocationCode='NCE', destinationLocationCode='IST',\n                                                           departureDate='2022-08-01', departureTime='18:20:00',\n                                                           arrivalDate='2022-08-01', arrivalTime='22:15:00',\n                                                           aircraftCode='321', carrierCode='TK',\n                                                           flightNumber='1816', duration='PT31H10M')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Will there be a delay from BRU to FRA? If so how much delay?\namadeus.travel.predictions.flightDelay.get({\n  originLocationCode: 'NCE',\n  destinationLocationCode: 'IST',\n  departureDate: '2022-08-01',\n  departureTime: '18:20:00',\n  arrivalDate: '2022-08-01',\n  arrivalTime: '22:15:00',\n  aircraftCode: '321',\n  carrierCode: 'TK',\n  flightNumber: '1816',\n  duration: 'PT31H10M'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Delay;\n\npublic class FlightDelayPrediction {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    Delay[] flightDelay = amadeus.travel.predictions.flightDelay.get(Params\n    .with(\"originLocationCode\", \"NCE\")\n    .and(\"destinationLocationCode\", \"IST\")\n    .and(\"departureDate\", \"2022-08-01\")\n    .and(\"departureTime\", \"18:20:00\")\n    .and(\"arrivalDate\", \"2022-08-01\")\n    .and(\"arrivalTime\", \"22:15:00\")\n    .and(\"aircraftCode\", \"321\")\n    .and(\"carrierCode\", \"TK\")\n    .and(\"flightNumber\", \"1816\")\n    .and(\"duration\", \"PT31H10M\"));\n\n    if (flightDelay[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightDelay[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightDelay[0]);\n  }\n}\n
"},{"location":"examples/code-example/#airport-on-time-performance","title":"Airport On Time Performance","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Will there be a delay in the JFK airport on the 1st of December?\n    '''\n    response = amadeus.airport.predictions.on_time.get(\n        airportCode='JFK', date='2021-12-01')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Will there be a delay in the JFK airport on the 1st of September?\namadeus.airport.predictions.onTime.get({\n  airportCode: 'JFK',\n  date: '2022-09-01'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.OnTime;\n\npublic class AirportOnTime {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    OnTime onTime = amadeus.airport.predictions.onTime.get(Params\n        .with(\"airportCode\", \"JFK\")\n        .and(\"date\", \"2022-09-01\"));\n\n    if(onTime.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + onTime.getResponse().getStatusCode());\n        System.exit(-1);\n    }\n    System.out.println(onTime);\n  }\n}\n
"},{"location":"examples/code-example/#flight-choice-prediction","title":"Flight Choice Prediction","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Find the probability of the flight MAD to NYC to be chosen\n    '''\n    body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',\n                                                     destinationLocationCode='NYC',\n                                                     departureDate='2022-11-01',\n                                                     returnDate='2022-11-09',\n                                                     adults=1).result\n    response = amadeus.shopping.flight_offers.prediction.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\namadeus.shopping.flightOffersSearch.get({\n  originLocationCode: 'SYD',\n  destinationLocationCode: 'BKK',\n  departureDate: '2022-08-01',\n  adults: '2'\n}).then(function (response) {\n  return amadeus.shopping.flightOffers.prediction.post(\n    JSON.stringify(response)\n  );\n}).then(function (response) {\n  console.log(response.data);\n}).catch(function (responseError) {\n  console.log(responseError);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.FlightOfferSearch;\nimport com.google.gson.JsonObject;\n\npublic class FlightChoicePrediction {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get(\n                  Params.with(\"originLocationCode\", \"MAD\")\n                          .and(\"destinationLocationCode\", \"NYC\")\n                          .and(\"departureDate\", \"2022-11-01\")\n                          .and(\"returnDate\", \"2022-11-09\")\n                          .and(\"adults\", 1));\n\n    JsonObject body = flightOffers[0].getResponse().getResult();\n    FlightOfferSearch[] flightOffersPrediction = amadeus.shopping.flightOffers.prediction.post(body);\n\n    if (flightOffersPrediction[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightOffersPrediction[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightOffersPrediction[0]);\n  }\n}\n
"},{"location":"examples/code-example/#on-demand-flight-status","title":"On Demand Flight Status","text":"PythonNodeJava
from amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns flight status of a given flight\n    '''\n    response = amadeus.schedule.flights.get(carrierCode='AZ',\n                                            flightNumber='319',\n                                            scheduledDepartureDate='2022-03-13')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What's the current status of my flight?\namadeus.schedule.flights.get({\n  carrierCode: 'AZ',\n  flightNumber: '319',\n  scheduledDepartureDate: '2022-03-13'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.Response;\nimport com.amadeus.resources.DatedFlight;\n\npublic class OnDemandFlightStatus {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Returns the status of a given flight\n    DatedFlight[] flightStatus = amadeus.schedule.flights.get(Params\n        .with(\"flightNumber\", \"319\")\n        .and(\"carrierCode\", \"AZ\")\n        .and(\"scheduledDepartureDate\", \"2022-03-13\"));\n\n   if (flightStatus[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + flightStatus[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(flightStatus[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-most-traveled-destinations","title":"Flight Most Traveled Destinations","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Where were people flying to from Madrid in the January 2017?\n    '''\n    response = amadeus.travel.analytics.air_traffic.traveled.get(originCityCode='MAD', period='2017-01')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Where were people flying to from Madrid in the January 2017?\namadeus.travel.analytics.airTraffic.traveled.get({\n  originCityCode: 'MAD',\n  period: '2017-01'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.AirTraffic;\n\npublic class FlightMostTraveledDestinations {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Flight Most Traveled Destinations\n    AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.traveled.get(Params\n      .with(\"originCityCode\", \"MAD\")\n      .and(\"period\", \"2017-01\"));\n\n    if (airTraffics[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + airTraffics[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(airTraffics[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-busiest-traveling-period","title":"Flight Busiest Traveling Period","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What were the busiest months for Madrid in 2022?\n    '''\n    response = amadeus.travel.analytics.air_traffic.busiest_period.get(\n        cityCode='MAD', period='2017', direction='ARRIVING')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What were the busiest months for Madrid in 2017?\namadeus.travel.analytics.airTraffic.busiestPeriod.get({\n  cityCode: 'MAD',\n  period: '2017',\n  direction: Amadeus.direction.arriving\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Period;\n\npublic class FlightBusiestPeriod {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Flight Busiest Traveling Period\n    Period[] busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get(Params\n      .with(\"cityCode\", \"MAD\")\n      .and(\"period\", \"2017\")\n      .and(\"direction\", BusiestPeriod.ARRIVING));\n\n    if(busiestPeriods[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + (busiestPeriods[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n    System.out.println((busiestPeriods[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-most-booked-destinations","title":"Flight Most Booked Destinations","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Where were people flying to from Madrid in the August 2017?\n    '''\n    response = amadeus.travel.analytics.air_traffic.booked.get(originCityCode='MAD', period='2017-08')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Where were people flying to from Madrid in the August 2017?\namadeus.travel.analytics.airTraffic.booked.get({\n  originCityCode: 'MAD',\n  period: '2017-08'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.AirTraffic;\n\npublic class FlightMostBookedDestinations {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Flight Most Booked Destinations\n    AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.booked.get(Params\n      .with(\"originCityCode\", \"MAD\")\n      .and(\"period\", \"2017-08\"));\n\n    if (airTraffics[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + airTraffics[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(airTraffics[0]);\n  }\n}\n
"},{"location":"examples/code-example/#flight-checkin-links","title":"Flight CheckIn Links","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What is the URL to my online check-in?\n    '''\n    response = amadeus.reference_data.urls.checkin_links.get(airlineCode='BA')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What is the URL to my online check-in?\namadeus.referenceData.urls.checkinLinks.get({\n    airlineCode: 'BA'\n  })\n  .then(function (response) {\n    console.log(response);\n  }).catch(function (response) {\n    console.error(response);\n  });\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.CheckinLink;\n\npublic class FlightCheckinLinks {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    CheckinLink[] checkinLinks = amadeus.referenceData.urls.checkinLinks.get(Params\n      .with(\"airlineCode\", \"BA\"));\n\n    if(checkinLinks[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + (checkinLinks[0].getResponse().getStatusCode()));\n        System.exit(-1);\n    }\n\n    System.out.println((checkinLinks[0]));\n  }\n}\n
"},{"location":"examples/code-example/#airport-nearest-relevant","title":"Airport Nearest Relevant","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What relevant airports are there around a specific location?\n    '''\n    response = amadeus.reference_data.locations.airports.get(longitude=49.000, latitude=2.55)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What relevant airports are there around a specific location?\namadeus.referenceData.locations.airports.get({\n  longitude: 2.55,\n  latitude: 49.0000\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Location;\n\npublic class AirportNearest {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_API_ID\",\"YOUR_API_SECRET\")\n        .build();\n\n    // Airport Nearest Relevant (for London)\n    Location[] locations = amadeus.referenceData.locations.airports.get(Params\n      .with(\"latitude\", 49.0000)\n      .and(\"longitude\", 2.55));\n\n    if(locations[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + locations[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n    System.out.println(locations[0]);\n  }\n}\n
"},{"location":"examples/code-example/#airport-city-search","title":"Airport & City Search","text":"

By keyword

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\nfrom amadeus import Location\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Which cities or airports start with 'r'?\n    '''\n    response = amadeus.reference_data.locations.get(keyword='r',\n                                                    subType=Location.ANY)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_KEY'\n});\n\n// Retrieve information about the LHR airport?\namadeus.referenceData.location('ALHR').get()\n  .then(function (response) {\n    console.log(response);\n  }).catch(function (response) {\n    console.error(response);\n  });\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Location;\n\npublic class AirportCitySearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Get a specific city or airport based on its id\n    Location location = amadeus.referenceData\n      .location(\"ALHR\").get();\n\n    if(location.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + location.getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(location);\n  }\n}\n

By Id

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\nfrom amadeus import Location\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Which cities or airports start with 'r'?\n    '''\n    response = amadeus.reference_data.locations.get(keyword='r',\n                                                    subType=Location.ANY)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Which cities or airports start with \u2019r'?\namadeus.referenceData.locations.get({\n  keyword: 'r',\n  subType: Amadeus.location.any\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.referenceData.Locations;\nimport com.amadeus.resources.Location;\n\npublic class AirportCitySearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Airport & City Search (autocomplete)\n    // Find all the cities and airports starting by the keyword 'LON'\n    Location[] locations = amadeus.referenceData.locations.get(Params\n      .with(\"keyword\", \"LON\")\n      .and(\"subType\", Locations.ANY));\n\n    if(locations[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + locations[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n    System.out.println(locations[0]);\n  }\n}\n
"},{"location":"examples/code-example/#airline-code-lookup","title":"Airline Code Lookup","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What's the airline name for the IATA code BA?\n    '''\n    response = amadeus.reference_data.airlines.get(airlineCodes='BA')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What's the airline name for the IATA code BA?\namadeus.referenceData.airlines.get({\n  airlineCodes: 'BA'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Airline;\n\npublic class AirlineCodeLookup {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    Airline[] airlines = amadeus.referenceData.airlines.get(Params\n      .with(\"airlineCodes\", \"BA\"));\n\n    if (airlines[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + airlines[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(airlines);\n  }\n}\n
"},{"location":"examples/code-example/#hotel","title":"Hotel","text":""},{"location":"examples/code-example/#hotel-list","title":"Hotel List","text":"

By geolocation

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Get list of hotels by a geocode\n    '''\n    response = amadeus.reference_data.locations.hotels.by_geocode.get(longitude=2.160873,latitude=41.397158)\n\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// List of hotels in Paris \namadeus.referenceData.locations.hotels.byGeocode.get({\n  latitude: 48.83152,\n  longitude: 2.24691\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Hotel;\n\npublic class HotelList {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    Hotel[] hotels = amadeus.referenceData.locations.hotels.byGeocode.get(\n      Params.with(\"latitude\", 48.83152)\n        .and(\"longitude\", 2.24691));\n\n    if (hotels[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + hotels[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(hotels[0]);\n  }\n}\n

By city

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Get list of hotels by city code\n    '''\n    response = amadeus.reference_data.locations.hotels.by_city.get(cityCode='PAR')\n\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// List of hotels in Paris \namadeus.referenceData.locations.hotels.byCity.get({\n  cityCode: 'PAR'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Hotel;\n\npublic class HotelList {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    Hotel[] hotels = amadeus.referenceData.locations.hotels.byCity.get(\n      Params.with(\"cityCode\", \"PAR\"));\n\n    if (hotels[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + hotels[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(hotels[0]);\n  }\n}\n

By hotel

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Get list of hotels by hotel id\n    '''\n    response = amadeus.reference_data.locations.hotels.by_hotels.get(hotelIds='ADPAR001')\n\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Get Marriot Hotel information in Paris\namadeus.referenceData.locations.hotels.byHotels.get({\n  hotelIds: 'ARPARARA'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Hotel;\n\npublic class HotelList {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    Hotel[] hotels = amadeus.referenceData.locations.hotels.byHotels.get(\n      Params.with(\"hotelIds\", \"ARPARARA\"));\n\n    if (hotels[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + hotels[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(hotels[0]);\n  }\n}\n
"},{"location":"examples/code-example/#hotel-search","title":"Hotel Search","text":"

By hotel

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    # Get list of available offers in specific hotels by hotel ids\n    hotels_by_city = amadeus.shopping.hotel_offers_search.get(\n        hotelIds='RTPAR001', adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04')\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n    clientId: 'YOUR_API_KEY',\n    clientSecret: 'YOUR_API_SECRET'\n});\n\n// Get list of available offers in specific hotels by hotel ids\namadeus.shopping.hotelOffersSearch.get({\n    hotelIds: 'RTPAR001',\n    adults: '2',\n    'checkInDate': '2023-10-10',\n    'checkOutDate': '2023-10-12'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.HotelOfferSearch;\n\npublic class HotelSearch {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    HotelOfferSearch[] offers = amadeus.shopping.hotelOffersSearch.get(\n      Params.with(\"hotelIds\", \"RTPAR001\")\n        .and(\"adults\", 2)\n    );\n\n    if (offers[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + offers[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(offers[0]);\n  }\n}\n

By offer

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    # Get list of Hotels by city code\n    hotels_by_city = amadeus.shopping.hotel_offer_search('63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3').get()\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n    clientId: 'YOUR_API_KEY',\n    clientSecret: 'YOUR_API_SECRET'\n});\n\n// Check offer conditions of a specific offer id\namadeus.shopping.hotelOfferSearch('63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3').get()\n.then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.HotelOfferSearch;\n\npublic class HotelSearch {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    HotelOfferSearch offer = amadeus.shopping.hotelOfferSearch(\n        \"0W7UU1NT9B\")\n      .get();\n\n    if (offer.getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + offer.getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(offer);\n  }\n}\n
"},{"location":"examples/code-example/#hotel-booking","title":"Hotel Booking","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    # Hotel List API to get list of Hotels by city code\n    hotels_by_city = amadeus.reference_data.locations.hotels.by_city.get(cityCode='DEL')\n    hotelIds = [hotel.get('hotelId') for hotel in hotels_by_city.data[:5]]\n\n    # Hotel Search API to get list of offers for a specific hotel\n    hotel_offers = amadeus.shopping.hotel_offers_search.get(\n        hotelIds=hotelIds, adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04')\n    offerId = hotel_offers.data[0]['offers'][0]['id']\n\n    guests = [{'id': 1, 'name': {'title': 'MR', 'firstName': 'BOB', 'lastName': 'SMITH'},\n               'contact': {'phone': '+33679278416', 'email': 'bob.smith@email.com'}}]\n    payments = {'id': 1, 'method': 'creditCard', 'card': {\n        'vendorCode': 'VI', 'cardNumber': '4151289722471370', 'expiryDate': '2027-08'}}\n\n    # Hotel booking API to book the offer \n    hotel_booking = amadeus.booking.hotel_bookings.post(\n        offerId, guests, payments)\n    print(hotel_booking.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Book a hotel in DEL for 2023-10-10 to 2023-10-12 \n// 1. Hotel List API to get the list of hotels \namadeus.referenceData.locations.hotels.byCity.get({\n  cityCode: 'LON'\n}).then(function (hotelsList) {\n// 2. Hotel Search API to get the price and offer id\n  return amadeus.shopping.hotelOffersSearch.get({\n    'hotelIds': hotelsList.data[0].hotelId,\n    'adults' : 1,\n    'checkInDate': '2023-10-10',\n    'checkOutDate': '2023-10-12'\n  });\n}).then(function (pricingResponse) {\n// Finally, Hotel Booking API to book the offer\n  return amadeus.booking.hotelBookings.post(\n    JSON.stringify({\n      'data': {\n        'offerId': pricingResponse.data[0].offers[0].id,\n        'guests': [{\n          'id': 1,\n          'name': {\n            'title': 'MR',\n            'firstName': 'BOB',\n            'lastName': 'SMITH'\n          },\n          'contact': {\n            'phone': '+33679278416',\n            'email': 'bob.smith@email.com'\n          }\n        }],\n        'payments': [{\n          'id': 1,\n          'method': 'creditCard',\n          'card': {\n            'vendorCode': 'VI',\n            'cardNumber': '4151289722471370',\n            'expiryDate': '2022-08'\n          }\n        }]\n      }\n    }));\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.HotelBooking;\n\npublic class HotelBookings {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMAEUS_API_SECRET\")\n        .build();\n\n    String body = \"{\\\"data\\\"\"\n        + \":{\\\"offerId\\\":\\\"2F5B1C3B215FA11FD5A44BE210315B18FF91BDA2FEDDD879907A3798F41D1C28\\\"\"\n        + \",\\\"guests\\\":[{\\\"id\\\":1,\\\"name\\\":{\\\"title\\\":\\\"MR\\\",\\\"firstName\\\":\\\"BOB\\\",\"\n        + \"\\\"lastName\\\" :\\\"SMITH\\\"},\\\"contact\\\":{\\\"phone\\\":\\\"+33679278416\\\",\\\"\"\n        + \"email\\\":\\\"bob.smith@email.com\\\"}}],\\\"\"\n        + \"payments\\\":[{\\\"id\\\":1,\\\"method\\\":\\\"creditCard\\\",\\\"\"\n        + \"card\\\":{\\\"vendorCode\\\":\\\"VI\\\",\\\"cardNumber\\\"\"\n        + \":\\\"4151289722471370\\\",\\\"expiryDate\\\":\\\"2022-08\\\"}}]}}\";\n\n    HotelBooking[] hotel = amadeus.booking.hotelBookings.post(body);\n\n    if (hotel[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + hotel[0].getResponse().getStatusCode());\n\n        System.exit(-1);\n    }\n\n    System.out.println(hotel[0]);\n  }\n}\n
"},{"location":"examples/code-example/#hotel-ratings","title":"Hotel Ratings","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What travelers think about this hotel?\n    '''\n    response = amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What travelers think about this hotel?\namadeus.eReputation.hotelSentiments.get({\n  hotelIds: 'ADNYCCTB'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.HotelSentiment;\n\npublic class HotelRatings {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMAEUS_API_SECRET\")\n        .build();\n\n    // Hotel Ratings / Sentiments\n    HotelSentiment[] hotelSentiments = amadeus.ereputation.hotelSentiments.get(Params.with(\"hotelIds\", \"ADNYCCTB\"));\n\n    if (hotelSentiments[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + hotelSentiments[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(hotelSentiments[0]);\n  }\n}\n
"},{"location":"examples/code-example/#hotel-name-autocomplete","title":"Hotel Name Autocomplete","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom ast import keyword\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search\n    '''\n    response = amadeus.reference_data.locations.hotel.get(keyword='PARI', subType=[Hotel.HOTEL_GDS])\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
const Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n// Or `var amadeus = new Amadeus()` if the environment variables are set\n\n\n// Hotel name autocomplete for keyword 'PARI' using  HOTEL_GDS category of search\namadeus.referenceData.locations.hotel.get({\n  keyword: 'PARI',\n  subType: 'HOTEL_GDS'\n}).then(response => console.log(response))\n  .catch(err => console.error(err));\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.TripDetail;\n\n// Hotel name autocomplete for keyword 'PARI' using  HOTEL_GDS category of search\npublic class HotelNameAutocomplete {\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Set query parameters\n    Params params = Params\n        .with(\"keyword\", \"PARI\")\n        .and(\"subType\", \"HOTEL_GDS\");\n\n    // Run the query\n    Hotel[] hotels = amadeus.referenceData.locations.hotel.get(params);\n\n    if (hotels.getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + hotels.getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    Arrays.stream(hotels)\n        .map(Hotel::getName)\n        .forEach(System.out::println);\n  }\n}\n
"},{"location":"examples/code-example/#destination-content","title":"Destination Content","text":""},{"location":"examples/code-example/#points-of-interest","title":"Points of Interest","text":"

By geolocation

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What are the popular places in Barcelona (based on a geo location and a radius)\n    '''\n    response = amadeus.reference_data.locations.points_of_interest.get(latitude=41.397158, longitude=2.160873)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What are the popular places in Barcelona (based on a geo location and a radius)\namadeus.referenceData.locations.pointsOfInterest.get({\n  latitude: 41.397158,\n  longitude: 2.160873\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.PointOfInterest;\n\npublic class PointsOfInterest {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_API_ID\",\"YOUR_API_SECRET\")\n        .build();\n\n    // What are the popular places in Barcelona (based on a geolocation)\n    PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get(Params\n       .with(\"latitude\", \"41.39715\")\n       .and(\"longitude\", \"2.160873\"));\n\n    if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + pointsOfInterest[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(pointsOfInterest[0]);\n  }\n}\n

By square

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What are the popular places in Barcelona? (based on a square)\n    '''\n    response = amadeus.reference_data.locations.points_of_interest.by_square.get(north=41.397158,\n                                                                                 west=2.160873,\n                                                                                 south=41.394582,\n                                                                                 east=2.177181)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What are the popular places in Barcelona? (based on a square)\namadeus.referenceData.locations.pointsOfInterest.bySquare.get({\n  north: 41.397158,\n  west: 2.160873,\n  south: 41.394582,\n  east: 2.177181\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.PointOfInterest;\n\npublic class PointsOfInterest {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // What are the popular places in Barcelona? (based on a square)\n    PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.bySquare.get(Params\n        .with(\"north\", \"41.397158\")\n        .and(\"west\", \"2.160873\")\n        .and(\"south\", \"41.394582\")\n        .and(\"east\", \"2.177181\"));\n\n    if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + pointsOfInterest[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(pointsOfInterest[0]);\n\n  }\n}\n

By Id

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Give me information about a place based on it's ID\n    '''\n    response = amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get()\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Extract the information about point of interest with ID '9CB40CB5D0'\namadeus.referenceData.locations.pointOfInterest('9CB40CB5D0').get()\n  .then(function (response) {\n    console.log(response);\n  }).catch(function (response) {\n    console.error(response);\n  });\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.PointOfInterest;\n\npublic class PointsOfInterest {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Returns a single Point of Interest from a given id\n    PointOfInterest pointOfInterest = amadeus.referenceData.locations.pointOfInterest(\"9CB40CB5D0\").get();\n\n   if (pointsOfInterest[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + pointsOfInterest[0].getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(pointsOfInterest[0]);\n  }\n}\n
"},{"location":"examples/code-example/#tours-and-activities","title":"Tours and Activities","text":"

By geolocation

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns activities for a location in Barcelona based on geolocation coordinates\n    '''\n    response = amadeus.shopping.activities.get(latitude=40.41436995, longitude=-3.69170868)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Returns activities for a location in Barcelona based on geolocation coordinates\namadeus.shopping.activities.get({\n  latitude: 41.397158,\n  longitude: 2.160873\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Activity;\n\n\npublic class ToursActivities {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      Activity[] activities = amadeus.shopping.activities.get(Params\n        .with(\"latitude\", \"41.39715\")\n        .and(\"longitude\", \"2.160873\"));\n\n       if(activities[0].getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + activities[0].getResponse().getStatusCode());\n               System.exit(-1);\n    }\n      System.out.println(activities[0]);\n    }\n}\n

By square

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns activities in Barcelona within a designated area\n    '''\n    response = amadeus.shopping.activities.by_square.get(north=41.397158,\n                                                         west=2.160873,\n                                                         south=41.394582,\n                                                         east=2.177181)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// What are the best tours and activities in Barcelona? (based on a Square)\namadeus.shopping.activities.bySquare.get({\n  north: 41.397158,\n  west: 2.160873,\n  south: 41.394582,\n  east: 2.177181\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Activity;\n\n\npublic class ToursActivities {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      Activity[] activities = amadeus.shopping.activities.get(Params\n        .with(\"north\", \"41.397158\")\n        .and(\"west\", \"2.160873\")\n        .and(\"south\", \"41.394582\")\n        .and(\"east\", \"2.177181\"));\n\n       if(activities[0].getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + activities[0].getResponse().getStatusCode());\n               System.exit(-1);\n    }\n      System.out.println(activities[0]);\n    }\n}\n

By Id

PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import ResponseError, Client\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Returns information of an activity from a given Id\n    '''\n    response = amadeus.shopping.activity('3216547684').get()\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Extract the information about an activity with ID '56777'\namadeus.shopping.activity('56777').get({\n  north: 41.397158,\n  west: 2.160873,\n  south: 41.394582,\n  east: 2.177181\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Activity;\n\n\npublic class ToursActivities {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      Activity tour = amadeus.shopping.activity(\"3216547684\").get();\n\n       if(tour.getResponse().getStatusCode() != 200) {\n               System.out.println(\"Wrong status code: \" + tour.getResponse().getStatusCode());\n               System.exit(-1);\n       }\n       System.out.println(tour);\n    }\n}\n
"},{"location":"examples/code-example/#location-score","title":"Location Score","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom ast import keyword\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n)\n\ntry:\n    '''\n    What are the location scores for the given coordinates?\n    '''\n    response = amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require('amadeus');\nvar amadeus = new Amadeus();\n\n//What are the location scores for the given coordinates?\namadeus.location.analytics.categoryRatedAreas.get({\n  latitude: 41.397158,\n  longitude: 2.160873\n}).then(data => {\n  console.log(data.body)\n}).catch(error => {\n  console.error(error)\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.ScoredLocation;\nimport java.util.Arrays;\n\n//Get the score for a given location using its coordinates\npublic class LocationScore {\n    public static void main(String[] args) throws ResponseException {\n\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      //Set query parameters\n      Params params = Params.with(\"latitude\", 41.397158).and(\"longitude\", 2.160873); \n\n      //What are the location scores for the given coordinates?\n      ScoredLocation[] scoredLocations = amadeus.location.analytics.categoryRatedAreas.get(params);\n\n      if (scoredLocations[0] && scoredLocations[0].getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + scoredLocations[0].getResponse().getStatusCode());\n        System.exit(-1);\n      }\n\n      Arrays.stream(scoredLocations)\n          .map(ScoredLocation::getCategoryScores)\n          .forEach(System.out::println);\n    }\n}\n
"},{"location":"examples/code-example/#trip","title":"Trip","text":""},{"location":"examples/code-example/#city-search","title":"City Search","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    What are the cities matched with keyword 'Paris' ?\n    '''\n    response = amadeus.reference_data.locations.cities.get(keyword='Paris')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n    clientId: 'YOUR_API_KEY',\n    clientSecret: 'YOUR_API_SECRET'\n});\n\n// finds cities that match a specific word or string of letters. \n// Return a list of cities matching a keyword 'Paris'\namadeus.referenceData.locations.cities.get({\n    keyword: 'Paris'\n}).catch(function (response) {\n    console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.City;\n\npublic class CitySearch {\n\n  public static void main(String[] args) throws ResponseException {\n    Amadeus amadeus = Amadeus\n      .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n      .build();\n\n    City[] cities = amadeus.referenceData.locations.cities.get(\n      Params.with(\"keyword\",\"PARIS\")\n    );\n\n    if (cities[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + cities[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(cities[0]);\n  }\n}\n
"},{"location":"examples/code-example/#trip-parser","title":"Trip Parser","text":"PythonNodeJava
import json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n  with open('../request_body.json') as file:\n    body = json.load(file)\n    response = amadeus.travel.trip_parser.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n//Read trip data from file\nconst body = require('../request_body.json');\namadeus.travel.tripParser.post(JSON.stringify(body))\n  .then(response => console.log(response))\n  .catch(err => console.error(err));\n\n/**\n * If you don't have your base64 encoded payload, you can use\n * the SDK helper method to create your request body\n * '''js\n * const base64Payload = amadeus.tripParser.fromFile(fileInUTF8Format)\n * '''\n */\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.TripDetail;\nimport com.google.gson.Gson;\nimport com.google.gson.JsonObject;\n\nimport java.io.IOException;\nimport java.io.Reader;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class TripParser {\n    public static void main(String[] args) throws ResponseException {\n\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n      //Read trip data from file\n      Gson gson = new Gson();\n      Reader reader = Files.newBufferedReader(Paths.get(\"../request_body.json\"));\n      JsonObject body = gson.fromJson(reader, JsonObject.class);  \n\n      TripDetail trip = amadeus.travel.tripParser.post(body);\n\n      if (trip.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code: \" + trip.getResponse().getStatusCode());\n        System.exit(-1);\n      }\n\n      System.out.println(trip);\n    }\n}\n
"},{"location":"examples/code-example/#trip-purpose-prediction","title":"Trip Purpose Prediction","text":"PythonNodeJava
# Install the Python library from https://pypi.org/project/amadeus\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    The passenger is traveling for leisure or business?\n    '''\n    response = amadeus.travel.predictions.trip_purpose.get(originLocationCode='NYC', destinationLocationCode='MAD',\n                                                           departureDate='2022-08-01', returnDate='2022-08-12',\n                                                           searchDate='2022-06-11')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// The passenger is traveling for leisure or business?\namadeus.travel.predictions.tripPurpose.get({\n  originLocationCode: 'NYC',\n  destinationLocationCode: 'MAD',\n  departureDate: '2022-08-01',\n  returnDate: '2022-08-12'\n}).then(function (response) {\n  console.log(response);\n}).catch(function (response) {\n  console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Prediction;\n\npublic class TripPurposePrediction {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    // Predict the purpose of the trip: business or leisure\n    Prediction tripPurpose = amadeus.travel.predictions.tripPurpose.get(Params\n        .with(\"originLocationCode\", \"NYC\")\n        .and(\"destinationLocationCode\", \"MAD\")\n        .and(\"departureDate\", \"2022-08-01\")\n        .and(\"returnDate\", \"2022-08-12\"));\n\n    if(tripPurpose.getResponse().getStatusCode() != 200) {\n        System.out.println(\"Wrong status code\" + tripPurpose.getResponse().getStatusCode());\n        System.exit(-1);\n    }\n\n    System.out.println(tripPurpose);\n  }\n}\n
"},{"location":"examples/code-example/#travel-recommendations","title":"Travel Recommendations","text":"PythonNodeJava
from amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\ntry:\n    '''\n    Recommends travel destinations similar to Paris for travelers in France\n    '''\n    response = amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR')\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require(\"amadeus\");\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_API_KEY',\n  clientSecret: 'YOUR_API_SECRET'\n});\n\n// Recommended locations similar to PAR\namadeus.referenceData.recommendedLocations.get({\n    cityCodes: 'PAR',\n    travelerCountryCode: 'FR'\n}).then(function(response) {\n    console.log(response.data);\n}).catch((error) => {\n    console.log(\"Error\");\n    done();\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\n\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.Location;\n\npublic class TravelRecommendations {\n    public static void main(String[] args) throws ResponseException {\n      Amadeus amadeus = Amadeus\n              .builder(\"YOUR_AMADEUS_API_KEY\",\"YOUR_AMADEUS_API_SECRET\")\n              .build();\n\n        Location[] destinations = amadeus.referenceData.recommendedLocations.get(Params\n                .with(\"cityCodes\", \"PAR\")\n                .and(\"travelerCountryCode\", \"FR\"));\n\n        if (destinations.length != 0) {\n          if (destinations[0].getResponse().getStatusCode() != 200) {\n            System.out.println(\"Wrong status code: \" + destinations[0].getResponse().getStatusCode());\n            System.exit(-1);\n          }\n          System.out.println(destinations[0]);\n        }\n        else {\n          System.out.println(\"No recommendations found\");\n          System.exit(-1);\n        }\n     }\n}\n
"},{"location":"examples/code-example/#cars-and-transfers","title":"Cars and Transfers","text":""},{"location":"examples/code-example/#transfer-search","title":"Transfer Search","text":"PythonNodeJava
import json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\njson_string = '{ \"startLocationCode\": \"CDG\", \"endAddressLine\": \"Avenue Anatole France, 5\", \"endCityName\": \"Paris\", \"endZipCode\": \"75007\", \"endCountryCode\": \"FR\", \\\n\"endName\": \"Souvenirs De La Tour\", \"endGeoCode\": \"48.859466,2.2976965\", \"transferType\": \"PRIVATE\", \"startDateTime\": \"2023-11-10T10:30:00\", \"providerCodes\": \"TXO\", \\\n\"passengers\": 2, \"stopOvers\": [ { \"duration\": \"PT2H30M\", \"sequenceNumber\": 1, \"addressLine\": \"Avenue de la Bourdonnais, 19\", \"countryCode\": \"FR\", \"cityName\": \"Paris\", \\\n\"zipCode\": \"75007\", \"name\": \"De La Tours\", \"geoCode\": \"48.859477,2.2976985\", \"stateCode\": \"FR\" } ], \"startConnectedSegment\": \\\n{ \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \"departure\": { \"localDateTime\": \"2023-11-10T09:00:00\", \"iataCode\": \"NCE\" }, \\\n\"arrival\": { \"localDateTime\": \"2023-11-10T10:00:00\", \"iataCode\": \"CDG\" } }, \"passengerCharacteristics\": [ { \"passengerTypeCode\": \"ADT\", \"age\": 20 }, \\\n{ \"passengerTypeCode\": \"CHD\", \"age\": 10 } ] }'\n\nbody = json.loads(json_string)\ntry:\n    response = amadeus.shopping.transfer_offers.post(body)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_AMADEUS_API_KEY',\n  clientSecret: 'YOUR_AMADEUS_API_SECRET'\n});\n\nbody =JSON.stringify({\n  \"startLocationCode\": \"CDG\",\n  \"endAddressLine\": \"Avenue Anatole France, 5\",\n  \"endCityName\": \"Paris\",\n  \"endZipCode\": \"75007\",\n  \"endCountryCode\": \"FR\",\n  \"endName\": \"Souvenirs De La Tour\",\n  \"endGeoCode\": \"48.859466,2.2976965\",\n  \"transferType\": \"PRIVATE\",\n  \"startDateTime\": \"2023-11-10T10:30:00\",\n  \"providerCodes\": \"TXO\",\n  \"passengers\": 2,\n  \"stopOvers\": [\n    {\n      \"duration\": \"PT2H30M\",\n      \"sequenceNumber\": 1,\n      \"addressLine\": \"Avenue de la Bourdonnais, 19\",\n      \"countryCode\": \"FR\",\n      \"cityName\": \"Paris\",\n      \"zipCode\": \"75007\",\n      \"name\": \"De La Tours\",\n      \"geoCode\": \"48.859477,2.2976985\",\n      \"stateCode\": \"FR\"\n    }\n  ],\n  \"startConnectedSegment\": {\n    \"transportationType\": \"FLIGHT\",\n    \"transportationNumber\": \"AF380\",\n    \"departure\": {\n      \"localDateTime\": \"2023-11-10T09:00:00\",\n      \"iataCode\": \"NCE\"\n    },\n    \"arrival\": {\n      \"localDateTime\": \"2023-11-10T10:00:00\",\n      \"iataCode\": \"CDG\"\n    }\n  },\n  \"passengerCharacteristics\": [\n    {\n      \"passengerTypeCode\": \"ADT\",\n      \"age\": 20\n    },\n    {\n      \"passengerTypeCode\": \"CHD\",\n      \"age\": 10\n    }\n  ]\n})\n\namadeus.shopping.transferOffers.post(body).then(function (response) {\n    console.log(response);\n}).catch(function (response) {\n    console.error(response);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.TransferOffersPost;\n\npublic class TransferSearch {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n        .build();\n\n    String body = \"{\\\"startLocationCode\\\":\\\"CDG\\\",\\\"endAddressLine\\\":\\\"AvenueAnatoleFrance,5\\\",\\\"endCityName\\\":\\\"Paris\\\",\\\"endZipCode\\\":\\\"75007\\\",\\\"endCountryCode\\\":\\\"FR\\\",\\\"endName\\\":\\\"SouvenirsDeLaTour\\\",\\\"endGeoCode\\\":\\\"48.859466,2.2976965\\\",\\\"transferType\\\":\\\"PRIVATE\\\",\\\"startDateTime\\\":\\\"2023-11-10T10:30:00\\\",\\\"providerCodes\\\":\\\"TXO\\\",\\\"passengers\\\":2,\\\"stopOvers\\\":[{\\\"duration\\\":\\\"PT2H30M\\\",\\\"sequenceNumber\\\":1,\\\"addressLine\\\":\\\"AvenuedelaBourdonnais,19\\\",\\\"countryCode\\\":\\\"FR\\\",\\\"cityName\\\":\\\"Paris\\\",\\\"zipCode\\\":\\\"75007\\\",\\\"name\\\":\\\"DeLaTours\\\",\\\"geoCode\\\":\\\"48.859477,2.2976985\\\",\\\"stateCode\\\":\\\"FR\\\"}],\\\"startConnectedSegment\\\":{\\\"transportationType\\\":\\\"FLIGHT\\\",\\\"transportationNumber\\\":\\\"AF380\\\",\\\"departure\\\":{\\\"localDateTime\\\":\\\"2023-11-10T09:00:00\\\",\\\"iataCode\\\":\\\"NCE\\\"},\\\"arrival\\\":{\\\"localDateTime\\\":\\\"2023-11-10T10:00:00\\\",\\\"iataCode\\\":\\\"CDG\\\"}},\\\"passengerCharacteristics\\\":[{\\\"passengerTypeCode\\\":\\\"ADT\\\",\\\"age\\\":20},{\\\"passengerTypeCode\\\":\\\"CHD\\\",\\\"age\\\":10}]}\";\n\n    TransferOffersPost[] transfers = amadeus.shopping.transferOffers.post(body);\n\n    if (transfers[0].getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + transfers[0].getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(transfers[0]);\n  }\n}\n
"},{"location":"examples/code-example/#transfer-booking","title":"Transfer Booking","text":"PythonNodeJava
import json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\n\nsearchBody = '{ \"startLocationCode\": \"CDG\", \"endAddressLine\": \"Avenue Anatole France, 5\", \"endCityName\": \"Paris\", \\\n    \"endZipCode\": \"75007\", \"endCountryCode\": \"FR\", \"endName\": \"Souvenirs De La Tour\", \"endGeoCode\": \"48.859466,2.2976965\", \\\n    \"transferType\": \"PRIVATE\", \"startDateTime\": \"2023-11-10T10:30:00\", \"providerCodes\": \"TXO\", \"passengers\": 2, \\\n    \"stopOvers\": [ { \"duration\": \"PT2H30M\", \"sequenceNumber\": 1, \"addressLine\": \"Avenue de la Bourdonnais, 19\", \\\n    \"countryCode\": \"FR\", \"cityName\": \"Paris\", \"zipCode\": \"75007\", \"name\": \"De La Tours\", \"geoCode\": \"48.859477,2.2976985\", \\\n    \"stateCode\": \"FR\" } ], \"startConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"localDateTime\": \"2023-11-10T09:00:00\", \"iataCode\": \"NCE\" }, \\\n    \"arrival\": { \"localDateTime\": \"2023-11-10T10:00:00\", \"iataCode\": \"CDG\" } }, \\\n    \"passengerCharacteristics\": [ { \"passengerTypeCode\": \"ADT\", \"age\": 20 }, { \"passengerTypeCode\": \"CHD\", \"age\": 10 } ] }'\n\n# Search list of transfers from Transfer Search API\nsearchResponse = amadeus.shopping.transfer_offers.post(json.loads(searchBody))\nofferId = searchResponse.data[0]['id']\n\n\nofferBody = '{ \"data\": { \"note\": \"Note to driver\", \"passengers\": [ { \"firstName\": \"John\", \"lastName\": \"Doe\", \"title\": \"MR\", \\\n    \"contacts\": { \"phoneNumber\": \"+33123456789\", \"email\": \"user@email.com\" }, \\\n    \"billingAddress\": { \"line\": \"Avenue de la Bourdonnais, 19\", \"zip\": \"75007\", \"countryCode\": \"FR\", \"cityName\": \"Paris\" } } ], \\\n    \"agency\": { \"contacts\": [ { \"email\": { \"address\": \"abc@test.com\" } } ] }, \\\n    \"payment\": { \"methodOfPayment\": \"CREDIT_CARD\", \"creditCard\": \\\n    { \"number\": \"4111111111111111\", \"holderName\": \"JOHN DOE\", \"vendorCode\": \"VI\", \"expiryDate\": \"0928\", \"cvv\": \"111\" } }, \\\n    \"extraServices\": [ { \"code\": \"EWT\", \"itemId\": \"EWT0291\" } ], \"equipment\": [ { \"code\": \"BBS\" } ], \\\n    \"corporation\": { \"address\": { \"line\": \"5 Avenue Anatole France\", \"zip\": \"75007\", \"countryCode\": \"FR\", \"cityName\": \"Paris\" }, \"info\": { \"AU\": \"FHOWMD024\", \"CE\": \"280421GH\" } }, \\\n    \"startConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" }, \\\n    \"arrival\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" } }, \\\n    \"endConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" }, \\\n    \"arrival\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" } } } }'\n\n# Book the first transfer from Transfer Search API via Transfer Booking API\ntry:\n    response = amadeus.ordering.transfer_orders.post(json.loads(offerBody), offerId=offerId)\n    print(response.data)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_AMADEUS_API_KEY',\n  clientSecret: 'YOUR_AMADEUS_API_SECRET'\n});\n\nvar searchBody =JSON.stringify({\n  \"startLocationCode\": \"CDG\",\n  \"endAddressLine\": \"Avenue Anatole France, 5\",\n  \"endCityName\": \"Paris\",\n  \"endZipCode\": \"75007\",\n  \"endCountryCode\": \"FR\",\n  \"endName\": \"Souvenirs De La Tour\",\n  \"endGeoCode\": \"48.859466,2.2976965\",\n  \"transferType\": \"PRIVATE\",\n  \"startDateTime\": \"2023-11-10T10:30:00\",\n  \"providerCodes\": \"TXO\",\n  \"passengers\": 2,\n  \"stopOvers\": [\n    {\n      \"duration\": \"PT2H30M\",\n      \"sequenceNumber\": 1,\n      \"addressLine\": \"Avenue de la Bourdonnais, 19\",\n      \"countryCode\": \"FR\",\n      \"cityName\": \"Paris\",\n      \"zipCode\": \"75007\",\n      \"name\": \"De La Tours\",\n      \"geoCode\": \"48.859477,2.2976985\",\n      \"stateCode\": \"FR\"\n    }\n  ],\n  \"startConnectedSegment\": {\n    \"transportationType\": \"FLIGHT\",\n    \"transportationNumber\": \"AF380\",\n    \"departure\": {\n      \"localDateTime\": \"2023-11-10T09:00:00\",\n      \"iataCode\": \"NCE\"\n    },\n    \"arrival\": {\n      \"localDateTime\": \"2023-11-10T10:00:00\",\n      \"iataCode\": \"CDG\"\n    }\n  },\n  \"passengerCharacteristics\": [\n    {\n      \"passengerTypeCode\": \"ADT\",\n      \"age\": 20\n    },\n    {\n      \"passengerTypeCode\": \"CHD\",\n      \"age\": 10\n    }\n  ]\n})\n\n// Search list of transfers from Transfer Search API\namadeus.shopping.transferOffers.post(searchBody).then(function (searchResponse) {\n  var offerId = searchResponse.data[0].id; // Retrieve offer ID from the response of the first endpoint (Transfer Search API)\n\n\nvar offerBody = JSON.stringify({\n  \"data\": {\n    \"note\": \"Note to driver\",\n    \"passengers\": [\n      {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\",\n        \"title\": \"MR\",\n        \"contacts\": {\n          \"phoneNumber\": \"+33123456789\",\n          \"email\": \"user@email.com\"\n        },\n        \"billingAddress\": {\n          \"line\": \"Avenue de la Bourdonnais, 19\",\n          \"zip\": \"75007\",\n          \"countryCode\": \"FR\",\n          \"cityName\": \"Paris\"\n        }\n      }\n    ],\n    \"agency\": {\n      \"contacts\": [\n        {\n          \"email\": {\n            \"address\": \"abc@test.com\"\n          }\n        }\n      ]\n    },\n    \"payment\": {\n      \"methodOfPayment\": \"CREDIT_CARD\",\n      \"creditCard\": {\n        \"number\": \"4111111111111111\",\n        \"holderName\": \"JOHN DOE\",\n        \"vendorCode\": \"VI\",\n        \"expiryDate\": \"0928\",\n        \"cvv\": \"111\"\n      }\n    },\n    \"extraServices\": [\n      {\n        \"code\": \"EWT\",\n        \"itemId\": \"EWT0291\"\n      }\n    ],\n    \"equipment\": [\n      {\n        \"code\": \"BBS\"\n      }\n    ],\n    \"corporation\": {\n      \"address\": {\n        \"line\": \"5 Avenue Anatole France\",\n        \"zip\": \"75007\",\n        \"countryCode\": \"FR\",\n        \"cityName\": \"Paris\"\n      },\n      \"info\": {\n        \"AU\": \"FHOWMD024\",\n        \"CE\": \"280421GH\"\n      }\n    },\n    \"startConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    },\n    \"endConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    }\n  }\n})\n\n// Book the first transfer from Transfer Search API via Transfer Booking API\n  amadeus.ordering.transferOrders.post(offerBody, offerId).then(function (orderResponse) {\n    console.log(orderResponse);\n  }).catch(function (error2) {\n    console.error(error2);\n  });\n}).catch(function (error1) {\n  console.error(error1);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.TransferOrder;\n\npublic class TransferOrders {\n\n    public static void main(String[] args) throws ResponseException {\n\n        Amadeus amadeus = Amadeus\n                .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n                .build();\n        Params params = Params.with(\"offerId\", \"5976726751\");\n\n        String body = \"{\\n  \\\"data\\\": {\\n    \\\"note\\\": \\\"Note to driver\\\",\\n    \\\"passengers\\\": [\\n      {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\",\\n        \\\"title\\\": \\\"MR\\\",\\n        \\\"contacts\\\": {\\n          \\\"phoneNumber\\\": \\\"+33123456789\\\",\\n          \\\"email\\\": \\\"user@email.com\\\"\\n        },\\n        \\\"billingAddress\\\": {\\n          \\\"line\\\": \\\"Avenue de la Bourdonnais, 19\\\",\\n          \\\"zip\\\": \\\"75007\\\",\\n          \\\"countryCode\\\": \\\"FR\\\",\\n          \\\"cityName\\\": \\\"Paris\\\"\\n        }\\n      }\\n    ],\\n    \\\"agency\\\": {\\n      \\\"contacts\\\": [\\n        {\\n          \\\"email\\\": {\\n            \\\"address\\\": \\\"abc@test.com\\\"\\n          }\\n        }\\n      ]\\n    },\\n    \\\"payment\\\": {\\n      \\\"methodOfPayment\\\": \\\"CREDIT_CARD\\\",\\n      \\\"creditCard\\\": {\\n        \\\"number\\\": \\\"4111111111111111\\\",\\n        \\\"holderName\\\": \\\"JOHN DOE\\\",\\n        \\\"vendorCode\\\": \\\"VI\\\",\\n        \\\"expiryDate\\\": \\\"0928\\\",\\n        \\\"cvv\\\": \\\"111\\\"\\n      }\\n    },\\n    \\\"extraServices\\\": [\\n      {\\n        \\\"code\\\": \\\"EWT\\\",\\n        \\\"itemId\\\": \\\"EWT0291\\\"\\n      }\\n    ],\\n    \\\"equipment\\\": [\\n      {\\n        \\\"code\\\": \\\"BBS\\\"\\n      }\\n    ],\\n    \\\"corporation\\\": {\\n      \\\"address\\\": {\\n        \\\"line\\\": \\\"5 Avenue Anatole France\\\",\\n        \\\"zip\\\": \\\"75007\\\",\\n        \\\"countryCode\\\": \\\"FR\\\",\\n        \\\"cityName\\\": \\\"Paris\\\"\\n      },\\n      \\\"info\\\": {\\n        \\\"AU\\\": \\\"FHOWMD024\\\",\\n        \\\"CE\\\": \\\"280421GH\\\"\\n      }\\n    },\\n    \\\"startConnectedSegment\\\": {\\n      \\\"transportationType\\\": \\\"FLIGHT\\\",\\n      \\\"transportationNumber\\\": \\\"AF380\\\",\\n      \\\"departure\\\": {\\n        \\\"uicCode\\\": \\\"7400001\\\",\\n        \\\"iataCode\\\": \\\"CDG\\\",\\n        \\\"localDateTime\\\": \\\"2023-03-27T20:03:00\\\"\\n      },\\n      \\\"arrival\\\": {\\n        \\\"uicCode\\\": \\\"7400001\\\",\\n        \\\"iataCode\\\": \\\"CDG\\\",\\n        \\\"localDateTime\\\": \\\"2023-03-27T20:03:00\\\"\\n      }\\n    },\\n    \\\"endConnectedSegment\\\": {\\n      \\\"transportationType\\\": \\\"FLIGHT\\\",\\n      \\\"transportationNumber\\\": \\\"AF380\\\",\\n      \\\"departure\\\": {\\n        \\\"uicCode\\\": \\\"7400001\\\",\\n        \\\"iataCode\\\": \\\"CDG\\\",\\n        \\\"localDateTime\\\": \\\"2023-03-27T20:03:00\\\"\\n      },\\n      \\\"arrival\\\": {\\n        \\\"uicCode\\\": \\\"7400001\\\",\\n        \\\"iataCode\\\": \\\"CDG\\\",\\n        \\\"localDateTime\\\": \\\"2023-03-27T20:03:00\\\"\\n      }\\n    }\\n  }\\n}\";\n\n        TransferOrder transfers = amadeus.ordering.transferOrders.post(body, params);\n        if (transfers.getResponse().getStatusCode() != 200) {\n            System.out.println(\"Wrong status code: \" + transfers.getResponse().getStatusCode());\n            System.exit(-1);\n        }\n\n        System.out.println(transfers);\n    }\n}\n
"},{"location":"examples/code-example/#transfer-management","title":"Transfer Management","text":"PythonNodeJava
import json\nfrom amadeus import Client, ResponseError\n\namadeus = Client(\n    client_id='YOUR_AMADEUS_API_KEY',\n    client_secret='YOUR_AMADEUS_API_SECRET'\n)\nsearchBody = '{ \"startLocationCode\": \"CDG\", \"endAddressLine\": \"Avenue Anatole France, 5\", \"endCityName\": \"Paris\", \\\n    \"endZipCode\": \"75007\", \"endCountryCode\": \"FR\", \"endName\": \"Souvenirs De La Tour\", \"endGeoCode\": \"48.859466,2.2976965\", \\\n    \"transferType\": \"PRIVATE\", \"startDateTime\": \"2023-11-10T10:30:00\", \"providerCodes\": \"TXO\", \"passengers\": 2, \\\n    \"stopOvers\": [ { \"duration\": \"PT2H30M\", \"sequenceNumber\": 1, \"addressLine\": \"Avenue de la Bourdonnais, 19\", \\\n    \"countryCode\": \"FR\", \"cityName\": \"Paris\", \"zipCode\": \"75007\", \"name\": \"De La Tours\", \"geoCode\": \"48.859477,2.2976985\", \\\n    \"stateCode\": \"FR\" } ], \"startConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"localDateTime\": \"2023-11-10T09:00:00\", \"iataCode\": \"NCE\" }, \\\n    \"arrival\": { \"localDateTime\": \"2023-11-10T10:00:00\", \"iataCode\": \"CDG\" } }, \\\n    \"passengerCharacteristics\": [ { \"passengerTypeCode\": \"ADT\", \"age\": 20 }, { \"passengerTypeCode\": \"CHD\", \"age\": 10 } ] }'\n\n# Search list of transfers from Transfer Search API\nsearchResponse = amadeus.shopping.transfer_offers.post(json.loads(searchBody))\nofferId = searchResponse.data[0]['id']\n\n\nofferBody = '{ \"data\": { \"note\": \"Note to driver\", \"passengers\": [ { \"firstName\": \"John\", \"lastName\": \"Doe\", \"title\": \"MR\", \\\n    \"contacts\": { \"phoneNumber\": \"+33123456789\", \"email\": \"user@email.com\" }, \\\n    \"billingAddress\": { \"line\": \"Avenue de la Bourdonnais, 19\", \"zip\": \"75007\", \"countryCode\": \"FR\", \"cityName\": \"Paris\" } } ], \\\n    \"agency\": { \"contacts\": [ { \"email\": { \"address\": \"abc@test.com\" } } ] }, \\\n    \"payment\": { \"methodOfPayment\": \"CREDIT_CARD\", \"creditCard\": \\\n    { \"number\": \"4111111111111111\", \"holderName\": \"JOHN DOE\", \"vendorCode\": \"VI\", \"expiryDate\": \"0928\", \"cvv\": \"111\" } }, \\\n    \"extraServices\": [ { \"code\": \"EWT\", \"itemId\": \"EWT0291\" } ], \"equipment\": [ { \"code\": \"BBS\" } ], \\\n    \"corporation\": { \"address\": { \"line\": \"5 Avenue Anatole France\", \"zip\": \"75007\", \"countryCode\": \"FR\", \"cityName\": \"Paris\" }, \"info\": { \"AU\": \"FHOWMD024\", \"CE\": \"280421GH\" } }, \\\n    \"startConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" }, \\\n    \"arrival\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" } }, \\\n    \"endConnectedSegment\": { \"transportationType\": \"FLIGHT\", \"transportationNumber\": \"AF380\", \\\n    \"departure\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" }, \\\n    \"arrival\": { \"uicCode\": \"7400001\", \"iataCode\": \"CDG\", \"localDateTime\": \"2023-03-27T20:03:00\" } } } }'\n\n# Book the first transfer from Transfer Search API via Transfer Booking API\norderResponse =  amadeus.ordering.transfer_orders.post(json.loads(offerBody), offerId=offerId)\norderId = orderResponse.data['id']\nconfirmNbr = orderResponse.data['transfers'][0]['confirmNbr'] \n\n# Book the first transfer from Transfer Search API via Transfer Booking API\ntry:\n    amadeus.ordering.transfer_order(orderId).transfers.cancellation.post('', confirmNbr=confirmNbr)\nexcept ResponseError as error:\n    raise error\n
var Amadeus = require('amadeus');\n\nvar amadeus = new Amadeus({\n  clientId: 'YOUR_AMADEUS_API_KEY',\n  clientSecret: 'YOUR_AMADEUS_API_SECRET'\n});\n\nvar searchBody =JSON.stringify({\n  \"startLocationCode\": \"CDG\",\n  \"endAddressLine\": \"Avenue Anatole France, 5\",\n  \"endCityName\": \"Paris\",\n  \"endZipCode\": \"75007\",\n  \"endCountryCode\": \"FR\",\n  \"endName\": \"Souvenirs De La Tour\",\n  \"endGeoCode\": \"48.859466,2.2976965\",\n  \"transferType\": \"PRIVATE\",\n  \"startDateTime\": \"2023-11-10T10:30:00\",\n  \"providerCodes\": \"TXO\",\n  \"passengers\": 2,\n  \"stopOvers\": [\n    {\n      \"duration\": \"PT2H30M\",\n      \"sequenceNumber\": 1,\n      \"addressLine\": \"Avenue de la Bourdonnais, 19\",\n      \"countryCode\": \"FR\",\n      \"cityName\": \"Paris\",\n      \"zipCode\": \"75007\",\n      \"name\": \"De La Tours\",\n      \"geoCode\": \"48.859477,2.2976985\",\n      \"stateCode\": \"FR\"\n    }\n  ],\n  \"startConnectedSegment\": {\n    \"transportationType\": \"FLIGHT\",\n    \"transportationNumber\": \"AF380\",\n    \"departure\": {\n      \"localDateTime\": \"2023-11-10T09:00:00\",\n      \"iataCode\": \"NCE\"\n    },\n    \"arrival\": {\n      \"localDateTime\": \"2023-11-10T10:00:00\",\n      \"iataCode\": \"CDG\"\n    }\n  },\n  \"passengerCharacteristics\": [\n    {\n      \"passengerTypeCode\": \"ADT\",\n      \"age\": 20\n    },\n    {\n      \"passengerTypeCode\": \"CHD\",\n      \"age\": 10\n    }\n  ]\n})\n\namadeus.shopping.transferOffers.post(searchBody).then(function (searchResponse) {\n  var offerId = searchResponse.data[0].id; // Retrieve offer ID from the response of the first endpoint (Transfer search API)\n\n\nvar offerBody = JSON.stringify({\n  \"data\": {\n    \"note\": \"Note to driver\",\n    \"passengers\": [\n      {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\",\n        \"title\": \"MR\",\n        \"contacts\": {\n          \"phoneNumber\": \"+33123456789\",\n          \"email\": \"user@email.com\"\n        },\n        \"billingAddress\": {\n          \"line\": \"Avenue de la Bourdonnais, 19\",\n          \"zip\": \"75007\",\n          \"countryCode\": \"FR\",\n          \"cityName\": \"Paris\"\n        }\n      }\n    ],\n    \"agency\": {\n      \"contacts\": [\n        {\n          \"email\": {\n            \"address\": \"abc@test.com\"\n          }\n        }\n      ]\n    },\n    \"payment\": {\n      \"methodOfPayment\": \"CREDIT_CARD\",\n      \"creditCard\": {\n        \"number\": \"4111111111111111\",\n        \"holderName\": \"JOHN DOE\",\n        \"vendorCode\": \"VI\",\n        \"expiryDate\": \"0928\",\n        \"cvv\": \"111\"\n      }\n    },\n    \"extraServices\": [\n      {\n        \"code\": \"EWT\",\n        \"itemId\": \"EWT0291\"\n      }\n    ],\n    \"equipment\": [\n      {\n        \"code\": \"BBS\"\n      }\n    ],\n    \"corporation\": {\n      \"address\": {\n        \"line\": \"5 Avenue Anatole France\",\n        \"zip\": \"75007\",\n        \"countryCode\": \"FR\",\n        \"cityName\": \"Paris\"\n      },\n      \"info\": {\n        \"AU\": \"FHOWMD024\",\n        \"CE\": \"280421GH\"\n      }\n    },\n    \"startConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    },\n    \"endConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2023-03-27T20:03:00\"\n      }\n    }\n  }\n})\n\n  amadeus.ordering.transferOrders.post(offerBody, offerId).then(function (orderResponse) {\n    var orderId = orderResponse.data.id; // Retrieve order ID from the response of the second endpoint (Transfer Order API)\n    var confirmNbr = orderResponse.data.transfers[0].confirmNbr; // Retrieve confirmation number from the response of the second endpoint (Transfer Order API)\n\n    // Transfer Management API to cancel the transfer order.\n    amadeus.ordering.transferOrder(orderId).transfers.cancellation.post(JSON.stringify({}), confirmNbr).then(function (response) {\n      console.log(response);\n    }).catch(function (error3) {\n      console.error(error3);\n    });\n  }).catch(function (error2) {\n    console.error(error2);\n  });\n}).catch(function (error1) {\n  console.error(error1);\n});\n
// How to install the library at https://github.com/amadeus4dev/amadeus-java\nimport com.amadeus.Amadeus;\nimport com.amadeus.Params;\nimport com.amadeus.exceptions.ResponseException;\nimport com.amadeus.resources.TransferCancellation;\n\npublic class TransferManagement {\n\n  public static void main(String[] args) throws ResponseException {\n\n    Amadeus amadeus = Amadeus\n        .builder(\"YOUR_AMADEUS_API_KEY\", \"YOUR_AMADEUS_API_SECRET\")\n        .build();\n    Params params = Params.with(\"confirmNbr\", \"12029761\");\n\n    TransferCancellation transfers = amadeus.ordering\n        .transferOrder(\"VEg0Wk43fERPRXwyMDIzLTA2LTE1VDE1OjUwOjE4\").transfers.cancellation.post(params);\n    if (transfers.getResponse().getStatusCode() != 200) {\n      System.out.println(\"Wrong status code: \" + transfers.getResponse().getStatusCode());\n      System.exit(-1);\n    }\n\n    System.out.println(transfers);\n  }\n}\n
"},{"location":"examples/live-examples/","title":"Interactive examples","text":""},{"location":"examples/live-examples/#interactive-code-examples","title":"Interactive code examples","text":"

Explore our collection of interactive code examples, which can be easily integrated into your website. These examples allow you to view and modify the code to see how it affects the appearance and functionality of each component.

"},{"location":"examples/live-examples/#flight-search-form","title":"Flight Search form","text":"

The flight search form not only provides a simple and minimal user interface, but also includes validation rules for each field. It checks the mandatory fields takes into consideration all the search restrictions related to the passengers, such as it doesn't allow the number of infants to be higher than the number of adult passengers.

Additionally, this form has a responsive design and is easy to customize by changing colors or adding new fields. Find the full code at the Amadeus for Developers GitHub.

See the Pen Flight Search form by Amadeus for Developers (@amadeus4dev) on CodePen."},{"location":"examples/live-examples/#hotel-search-form","title":"Hotel Search form","text":"

The hotel search form apart from the user interface, it also includes validation rules to the fields. Furthermore, it has responsive design and can be easily customized to suit your website's aesthetics, whether by changing colors, adding new fields, or adjusting the layout.

You can find the full code for the hotel search form at the Amadeus for Developers GitHub.

See the Pen Hotel Search Form by Amadeus for Developers (@amadeus4dev) on CodePen."},{"location":"examples/prototypes/","title":"Prototypes","text":"

Would you like to explore the applications that you could build with Amadeus Self-Service APIs? We have prototypes available in Amadeus for Developers GitHub.

There are two types of prototypes (demo apps) available.

  • Official prototypes are managed by Amadeus for Developers team and updated frequently to the latest version of APIs and SDKs.
  • Community prototypes are examples or demo apps that have been built and managed by developer community and it is not supported or maintained by Amadeus for Developers team.
"},{"location":"examples/prototypes/#official-prototypes","title":"Official Prototypes","text":"Use Cases Amadeus APIs used Technology Details Flight booking engine Flight Offers Search, Flight Offers Price, Flight Create Order, Airport & City Search Python, Django See details Hotel Booking engine Hotel List, Hotel Search, Hotel Booking Python, Django See details Flight Search with Price Analysis & Trip purpose Flight Offers Search, Flight Price Analysis, Trip Purpose Prediction Python, Django See details Map with Hotels, Point of interests and Safety scores Hotel List, Points of Interest, Safe Place, Tours and Activities Python, Django, HERE Maps See details"},{"location":"examples/prototypes/#amadeus-flight-booking-django","title":"Amadeus Flight Booking in Django","text":"
  • Demo app: You can access the demo of the prototype here.
  • Source code: You can access the source code on GitHub.

The prototype is built with Django and the Amadeus Python SDK and demonstrates the end-to-end flight booking process, which works in conjunction with three APIs:

  • Flight Offer Search API to search for flight offers.
  • Flight Offer Price API to confirm the availability and price of given offers.
  • Flight Create Orders API to book the given flights.

It also calls the Airport & City Search API to autocomplete the origin and destination with IATA code.

"},{"location":"examples/prototypes/#amadeus-hotel-booking-django","title":"Amadeus Hotel Booking in Django","text":"
  • Demo app: You can access the demo of the prototype here.
  • Source code: You can access the source code on GitHub.

The prototype is built with Python/Django and the Amadeus Python SDK. It demonstrates the end-to-end Hotel booking process (Hotel booking engine), which works in conjunction with three APIs:

  • Hotel List API to list the hotels in a specific location.
  • Hotel Search API to search for the offers of given hotels.
  • Hotel Booking API to book the given hotel rooms.

"},{"location":"examples/prototypes/#amadeus-flight-price-analysis-django","title":"Amadeus Flight Price Analysis in Django","text":"
  • Demo app: You can access the demo of the prototype here.
  • Source code: You can access the source code on GitHub.

The prototype is built with Python/Django and the Amadeus Python SDK. It retrieves flight offers using the Flight Offers Search API for a given itinerary. Then it displays if the cheapest available flight is a good deal based on the Flight Price Analysis API. We finally predict if the trip is for business or leisure using the Trip Purpose Prediction API.

"},{"location":"examples/prototypes/#amadeus-hotel-area-safety-pois-django","title":"Amadeus Hotel Search with area safety and POIs","text":"
  • Demo app: You can access the demo of the prototype here.
  • Source code: You can access the source code on GitHub.

The prototype is built by Python/Django and the Amadeus Python SDK, It demonstrates the safety information, POIs and tours for a chosen hotel on a map, using the following APIs:

  • Hotel List: shows hotels on the map
  • Points of Interest: shows POIs around the hotel
  • Safe Place: shows safety information for the area each hotel is located
  • Tours and Activities: shows bookable tours and activities around the hotel
  • HERE Maps: displays a map with markers and text bubbles

"},{"location":"examples/prototypes/#prototypes-from-community","title":"Prototypes from community","text":"

We have many other prototypes or demo apps that developers in our community built and shared! Explore them below or in Amadeus for Developers -Examples GitHub.

Warning

Projects from communities are examples that have been built and managed by developer community(Discord) and it is not supported or maintained by Amadeus for Developers team. The projects may not be up-to-date.

Use case Amadeus APIs used Technology Details Trip purpose prediction Trip Purpose Prediction Python, django amadeus-trip-purpose-django Hotel Search Hotel Search Swift amadeus-hotel-search-swift Hotel booking engine Hotel Search, Hotel Booking Kotlin amadeus-hotel-booking-android Flight Search with Artificial intelligence Flight Offers Search, Flight Choice Prediction, Trip Purpose Prediction and Airport & City Search Python, django amadeus-smart-flight-search-django Flight Search Flight Offers Search PHP, wordpress amadeus-flight-search-wordpress-plugin Flight Booking engine Flight Offers Search, Flight Offers price, Flight Create Orders, Airport & City Search Java, React amadeus_java_flight_api Airport & City autocomplete Airport & City Search Node, Express, React amadeus-airport-city-search-mern Flight Seatmap display SeatMap Display React amadeus-seatmap Hotel booking engine Hotel Search, Hotel Booking React Native AmadeusNodeServer, AmadeusHotelBookingPart1 Hotel booking engine Airport & City Search, Hotel Search, Hotel Booking Node, React Building-a-Hotel-Booking-App-in-NodeJS-and-React Neighborhood safety map Safe Place Python amadeus-safeplace Map nearby Points of Interests Swift MyPlaces Flight Booking engine Flight Offers Search, Flight Offers price, Flight Create Orders, Airport & City Search Node, Angular Flight-booking-frontend and backend Flight Search backend Flight Offers Search, Airport & City Search Bootstrap, Vanila JS Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API Map nearby Points of Interests Android Amadeus_POI_Android Hotel booking engine Hotel Search, Hotel Booking Ruby on Rails amadeus-hotel-booking-rubyonrails Flight status notification service On-Demand Flight Status Python amadeus-async-flight-status Flight Calendar search Airport & City Search, Flight Offers Search Node, Svelte FlightSearchCalendar Airport & City autocomplete Airport & City Search Node and Express Live-Airport-City-Search Flight Booking Flight Offers Search, Flight Offers Price, Flight Create Orders Node, Vue amadeus-flight-booking-node"},{"location":"examples/prototypes/#amadeus-trip-purpose-django","title":"amadeus-trip-purpose-django","text":"

This project (Link to GitHub) demonstrates how to integrate Amadeus APIs using the Python SDK in a Django application. The end user submits round-trip information via a form and the Trip Purpose Prediction is called. This API predicts if the given journey is for leisure or business purposes.

"},{"location":"examples/prototypes/#amadeus-hotel-search-swift","title":"amadeus-hotel-search-swift","text":"

This prototype (Link to GitHub) demonstrates a simple iOS hotel search app from scratch using Amadeus Hotel Search API (version 2.1 - decommissioned) and iOS SDK.

"},{"location":"examples/prototypes/#amadeus-hotel-booking-android","title":"amadeus-hotel-booking-android","text":"

This prototype (Link to GitHub) shows how to use the Android SDK to build a Hotel Booking Engine in Android Studio.

"},{"location":"examples/prototypes/#amadeus-smart-flight-search-django","title":"amadeus-smart-flight-search-django","text":"

This prototype (Link to GitHub) shows how the Air APIs can be integrated with the Django framework and Python SDK, by calling the Flight Choice Prediction and Trip Purpose Prediction. We also call the Flight Offers Search as a more traditional method of flight search and we compare its results with the Flight Choice Prediction ones to show the power of AI.

"},{"location":"examples/prototypes/#amadeus-flight-search-wordpress-plugin","title":"amadeus-flight-search-wordpress-plugin","text":"

This prototype (Link to GitHub) demonstrated how to create a WordPress plugin to build a basic flight search feature using Flight Offers Search API.

"},{"location":"examples/prototypes/#amadeus_java_flight_api","title":"amadeus_java_flight_api","text":"

This app (Link to GitHub) is an example of how to use the Amadeus Flight APIs to search and book a flight. The application uses a Spring backend and a React frontend.

"},{"location":"examples/prototypes/#amadeus-airport-city-search-mern","title":"amadeus-airport-city-search-mern","text":"

This application (Link to GitHub) implements airport and city name autocomplete box powered by the Airport & City Search API. It consists of a simple Node and Express backend that connects to the Amadeus API with Node SDK, and a small React app that talks to a Node/Express backend and use it to obtain the airport name data from Amadeus.

"},{"location":"examples/prototypes/#amadeus-seatmap","title":"amadeus-seatmap","text":"

This prototype (Link to GitHub) demonstrates how to display a flight seatmap using SeatMap Display API with React.

  • How to build an aircraft seat map in React

"},{"location":"examples/prototypes/#amadeusnodeserver-amadeushotelbookingpart1","title":"AmadeusNodeServer, AmadeusHotelBookingPart1","text":"

This prototype consists of 2 Github repositories (GitHub to Node Server and GitHub to React Native). It demonstrates a Hotel booking application in iOS using React Native. There is a series of blogs to elaborate further to build an app with this prototype.

  • Building an iOS hotel booking app with React Native - Part 1
  • Building an iOS hotel booking app with React Native - Part 2

"},{"location":"examples/prototypes/#amadeus-safeplace","title":"amadeus-safeplace","text":"

This prototype (Link to GitHub) demonstrates a neighbourhood safety map in Python to let users compare the relative safety levels of different neighbourhoods. You will use the Safe Place API for the safety scores and HERE Maps to visualize them on a map.

  • How to build a neighbourhood safety map in Python with Amadeus Safe Place

"},{"location":"examples/prototypes/#myplaces","title":"MyPlaces","text":"

This prototype (Link to GitHub) demonstrates an iOS application that finds nearby places and displays them on a map. You will use the Points of Interest API to retrieve the places and MKMapView for the map.

  • How to get nearby places using Amadeus APIs in iOS

"},{"location":"examples/prototypes/#building-a-hotel-booking-app-in-nodejs-and-react","title":"Building-a-Hotel-Booking-App-in-NodeJS-and-React","text":"

This prototype consists of 2 code sets (Github to Backend and Github to Frontend). It demonstrates a complete hotel booking app using Node on the backend and React for the frontend.

  • Building a hotel booking app with Node.js and React - Part 1

  • Building a hotel booking app with Node.js and React - Part 2

"},{"location":"examples/prototypes/#flight-booking-frontend-and-backend","title":"Flight-booking-frontend and backend","text":"

This prototype consists of 2 code sets (Github to Backend and Github to Frontend). It demonstrates a complete flight booking application using Node in the backend and Angular for the front end.

  • Build a flight booking app with Angular and Node.js - Part 1
  • Build a flight booking app with Angular and Node.js - Part 2

"},{"location":"examples/prototypes/#building-a-flight-search-form-with-bootstrap-and-the-amadeus-api","title":"Building-a-Flight-Search-Form-with-Bootstrap-and-the-Amadeus-API","text":"

This prototype consists of 2 code sets (Github to Frontend and Github to Backend). It demonstrates a flight booking engine with Flight Offer Search API using Bootstrap and Vanilla JS for frontend and Express for the backend.

  • How to build a flight search form using Bootstrap 5 - Part 1
  • How to build a flight search form using Bootstrap 5 - Part 2

"},{"location":"examples/prototypes/#amadeus_poi_android","title":"Amadeus_POI_Android","text":"

This app (Link to GitHub) demonstrates the usage of Amadeus Points of Interest API to fetch the list of best attractions near the user's current location and displays them on a list as well as a map.

"},{"location":"examples/prototypes/#amadeus-hotel-booking-rubyonrails","title":"amadeus-hotel-booking-rubyonrails","text":"

This prototype (Link to GitHub) demonstrates an end-to-end Hotel booking process, which works in conjunction with 2 APIs, Hotel Search API and Hotel Booking API.

"},{"location":"examples/prototypes/#amadeus-async-flight-status","title":"amadeus-async-flight-status","text":"

This prototype (Link to GitHub) demonstrates an application with event-driven microservices that asynchronously consume events coming from the API and notifies end users of these events via SMS using Twilio SMS API.

  • Event-driven microservices for flight status alerts: part 1

  • Event-driven microservices for flight status alerts: part 2

"},{"location":"examples/prototypes/#flightsearchcalendar","title":"FlightSearchCalendar","text":"

This application (Link to GitHub) demonstrates a calendar application to display the flights within a date interval to find the cheapest possible prices using Amadeus APIs.

"},{"location":"examples/prototypes/#live-airport-city-search","title":"Live-Airport-City-Search","text":"

This application (Link to GitHub) lets you perform a live search for Airports and Cities through the Airport & City Search API. The implementation is done through jQuery Autocomplete with Node and Express as the backend for which connects to the Amadeus API with Node SDK.

"},{"location":"examples/prototypes/#amadeus-flight-booking-node","title":"amadeus-flight-booking-node","text":"

The Amadeus Flight Booking app is built with Node and Vue using the Node SDK. You can find the source code on GitHub

"},{"location":"migration-guides/","title":"Migration guides","text":"

To ensure you have a seamless transition to the latest API version, we've compiled migration guides for your reference. As we continuously enhance our APIs and launch new releases, these guides will assist you in the upgrading process.

API Migration guide Hotel Search API From v2.1 to v3"},{"location":"migration-guides/hotel-search/","title":"Hotel search","text":"

Are you still using the old version of the Hotel Search API? This guide will help you migrate to the new version of the Hotel Search API and leverage its advantages right from the start.

"},{"location":"migration-guides/hotel-search/#how-is-the-hotel-search-api-v3-different-to-v21","title":"How is the Hotel Search API v3 different to v2.1?","text":"

The main difference between the two API versions is that the v2.1 endpoint /shopping/hotel-offers/by-hotel has been integrated into the v3 /shopping/hotel-offers/ endpoint. All hotel offers in the Hotel Search v3 are now queried by hotel\u2019s unique Amadeus Id, which renders the v2.1 endpoint /shopping/hotel-offers/by-hotel obsolete.

We also have a new API to help you ensure a seamless migration \u2013 the Hotel List API. This API returns a list of hotels by a unique Amadeus hotel Id, IATA city code or geographic coordinates.

The diagram below shows a high-level overview of the differences between the Hotel Search API v2.1 and v3.

Now let\u2019s have a closer look at the differences on the parameters level.

"},{"location":"migration-guides/hotel-search/#get-shoppinghotel-offers","title":"GET /shopping/hotel-offers","text":""},{"location":"migration-guides/hotel-search/#new-required-query-parameters","title":"New required query parameters","text":"Parameter Description hotelIds Amadeus property codes on 8 chars. This parameter was an optional query parameter in v2.1. adults Number of adult guests (1-9) per room. This parameter was an optional query parameter in v2.1."},{"location":"migration-guides/hotel-search/#removed-query-parameters","title":"Removed query parameters","text":"Parameter Description cityCode Destination IATA city code. This parameter is still returned in the successful response for each hotel. To search a hotel by the IATA city code, use the Hotel List API. latitude Latitude of a geographical point used for the search. This parameter is returned in the successful response for each hotel as the latitude of the given hotel. To search a hotel by geographic coordinates, use the Hotel List API. longitude Longitude of a geographical point used for the search. This parameter is returned in the successful response for each hotel as the longitude of the given hotel. To search a hotel by geographic coordinates, use the Hotel List API. radius Maximum distance (in radiusUnit) from Destination (city centre or geocodes). This parameter is not present in the response. radiusUnit Distance unit (of the radius value). This parameter is not present in the response. hotelName Hotel name used for the search. This parameter is returned in the successful response for each hotel. chains Chain (EM...) or Brand (SB...) or Merchant (AD...) (comma separated list of Amadeus 2 chars codes). This parameter is now shown as chainCode and returned in the successful response for each hotel. amenities Amenities list per hotel. To use this parameter for hotel search, refer to the Hotel List API. ratings Hotel stars. To use this parameter for hotel search, refer to the Hotel List API. cacheControl Parameter to force bypass the Amadeus cache (slower response) or get only hotels that are in the cache."},{"location":"migration-guides/hotel-search/#added-optional-query-parameters","title":"Added optional query parameters","text":"Parameter Description countryOfResidence Code of the traveller\u2019s country of residence in the ISO 3166-1 format."},{"location":"migration-guides/hotel-search/#data-model-changes","title":"Data model changes","text":""},{"location":"migration-guides/hotel-search/#hotel-offers","title":"Hotel Offers","text":""},{"location":"migration-guides/hotel-search/#removed-parameters","title":"Removed parameters","text":"

\u2022 The hotel object does not contain the hotelDistance object as the search by radius has been omitted. \u2022 The address, contact, amenities and media objects are excluded from the response. \u2022 Metadata for the pagination is not in the response as the Hotel Search v3 does not use pagination.

"},{"location":"migration-guides/hotel-search/#added-parameters","title":"Added parameters","text":"

\u2022 The offers object now contains the checkInDate and checkOutDate. \u2022 New object commission has been added to the response. \u2022 New object taxes has been added to the response.

Parameter Description checkInDate Check-in date. checkOutDate Check-out date. commission This object defines the commission to be paid by the traveller to the hotel. It has three properties:
  • percentage \u2013 a string showing the percentage of the commission paid to the travel seller, the value is between 0 and 100.
  • amount \u2013 a string showing the amount of the commission paid to the travel seller, the amount is always linked to the currency code of the offer.
  • description \u2013 a string for the free text field for any notes on the commission.
taxes This object shows the tax data as per the IATA tax definition: \u201cAn impost for raising revenue for the general treasury and which will be used for general public purposes\u201d. It contains the following properties:
  • amount - a string, which defines the tax amount with a decimal separator.
  • currency- a string, which defines a monetary unit of the tax. It is a three-alpha code (IATA code). Example: EUR for Euros, USD for US dollar, etc.
  • code - a string for the International Standards Organization (ISO) Tax code. It is a two-letter country code.
  • percentage - a string, which will indicate, in the case of a tax on TST value, the percentage of the tax.
  • included - a boolean, which indicates if tax is included or not.
  • description - a string for the tax description.
  • pricingFrequency - a string, which specifies if the tax applies per stay or per night.
  • pricingMode - a string, which specifies if the tax applies per occupant or per room.
"},{"location":"migration-guides/hotel-search/#get-shoppinghotel-offersofferid","title":"GET / shopping/hotel-offers/{offerId}","text":""},{"location":"migration-guides/hotel-search/#data-model-changes_1","title":"Data Model changes","text":""},{"location":"migration-guides/hotel-search/#offers","title":"Offers","text":""},{"location":"migration-guides/hotel-search/#added-parameters_1","title":"Added parameters","text":"

\u2022 The checkInDate, checkOutDate, category, commission, boardType properties have been added. \u2022 The price object has additional properties sellingTotal, base, taxes, markups, variations. \u2022 New object policies has been added.

Parameter Description checkInDate Check-in date. checkOutDate Check-out date. category Offer category. commission This object defines the commission to be paid by the traveller to the hotel. It has three properties:
  • percentage \u2013 a string showing the percentage of the commission paid to the travel seller, the value is between 0 and 100.
  • amount \u2013 a string showing the amount of the commission paid to the travel seller, the amount is always linked to the currency code of the offer.
  • description \u2013 a string for the free text field for any notes on the commission.
sellingTotal A string defining the price Total + margins + markup + totalFees \u2013 discounts. base A string for the base price of the offer. taxes This object shows the tax data as per the IATA Tax definition: \u201cAn impost for raising revenue for the general treasury and which will be used for general public purposes\u201d. It contains the following properties:
  • amount - a string, which defines the tax amount with a decimal separator.
  • currency- a string, which defines a monetary unit of the tax. It is a three-alpha code (IATA code). Example: EUR for Euros, USD for US dollar, etc.
  • code - a string for the International Standards Organization (ISO) Tax code. It is a two-letter country code.
  • percentage - a string, which will indicate, in the case of a tax on TST value, the percentage of the tax.
  • included - a boolean, which indicates if tax is included or not.
  • description - a string for the tax description.
  • pricingFrequency - a string, which specifies if the tax applies per stay or per night.
pricingMode a string, which specifies if the tax applies per occupant or per room. markups An object defining the markup. Markups are applied to provide a service or a product to the client. The markup can be introduced by any stakeholder. Typical use case is to convey markup information set by the travel agent or in case of merchant mode. The object contains a string amount, which defines the monetary value with a decimal position. variations An object defining the hotel daily price variations. It has the following properties:
  • average \u2013 an object that encompasses the price object.
  • changes \u2013 an object defining the collection of price periods if the daily price changes during the stay.
policies An object defining the hotel booking rules."},{"location":"migration-guides/hotel-search/#hotel","title":"Hotel","text":""},{"location":"migration-guides/hotel-search/#removed-parameters_1","title":"Removed parameters","text":"

The rating, latitude, longitude, amenities, media parameters have been removed.

"},{"location":"migration-guides/hotel-search/#values-returned-by-the-response","title":"Values returned by the response","text":"

The address, contact, amenities, media values have been removed.

"},{"location":"migration-guides/hotel-search/#use-case-inspirations","title":"Use case inspirations","text":"

You can easily integrate the new Hotel Search API in your hotel booking engine or combine it with other APIs in our Hotel category, such as the Hotel Ratings API or Hotel Name Autocomplete API. Whatever your use case might be, the Amadeus Self-Service APIs will help your business achieve the competitive advantage in the travel industry.

"},{"location":"migration-guides/hotel-search/#faq","title":"FAQ","text":"
  • How can I get the hotel image/address/contact details/rating/amenities?

    • Due to legal constraints we, unfortunately, can no longer distribute hotel images and specific details through our Self-Service APIs.
    • As a workaround we recommend using Leonardo, our trusted data provider.
    • Also, we have built some Python tutorials about how to get the hotel address using geocoding APIs and Google Place APIs and how to get the hotel images with Google Places API. You should be able to adapt them in your own programming language easily.
  • How can I use the data without the cache data control?

    • The Hotel Search API v3 is using live data directly while avoiding the need to build cache and add any extra validation mechanisms to the data.
  • How do I get the hotel rating?

    • We offer data on hotel rating via our Hotel Rating API. Please bear in mind that this rating information is based on the sentiment analysis and not the star rating system. You can, however, retrieve a list of hotels by their star rating using the Hotel List API with the required star rating as an additional query parameter.
"},{"location":"resources/","title":"Self-Service API tutorials","text":"

In this section, you'll discover a comprehensive collection of tutorials for each Self-Service API, organized by their respective categories. These tutorials delve into the typical use cases for each API and offer illustrative examples of parameters, along with clear explanations of their function.

Tutorial Coverage Travel Safety
  • Safe Place
Destination Experiences
  • Points of Interest
  • Tours and Activities
Flights
  • Flight Offers Search
  • Flight Offers Price
  • Flight Create Orders
  • Flight Order Management
  • Seatmap Display
  • Branded Fares Upsell
  • Flight Price Analysis
  • Flight Choice Prediction
  • Flight Inspiration Search
  • Flight Cheapest Date Search
  • Flight Availabilities Search
  • Travel Recommendations
  • On Demand Flight Status
  • Flight Delay Prediction
  • Airport & City Search
  • Airport Nearest Relevant
  • Airport Routes API
  • Airport On-Time Performance
  • Flight Check-in Links
  • Airline Code Lookup
  • Airline Routes
Hotels
  • Hotel List
  • Hotel Ratangs
  • Hotel Search
  • Hotel Booking
  • Hotel Name Autocomplete API
Itinerary Management
  • Trip Parser
  • Trip Purpose Prediction
  • City Search
Market insights
  • Flight Most Traveled Destinations
  • Flight Most Booked Destinations
  • Flight Busiest Traveling Period
  • Location Score
"},{"location":"resources/cars-transfers/","title":"Cars and Transfers","text":"

The Amadeus Cars and Transfers APIs provide an extensive suite of capabilities designed to simplify the process of booking and managing transfers during a traveler's trip, delivering a seamless and efficient experience.

Have a look at our dedicated Postman collection to easily test the Cars and Transfers API with pre-set requests.

APIs Description Transfer Search This API enables users to search for a transfer using a range of pre-arranged transportation options. These options include Private Transfers, Hourly Services, Taxis, Shared Transfers, Airport Express trains and buses, Private Jets, and Helicopter Transfers. Transfer Booking Once a transfer is chosen, the Transfer Booking API completes the reservation. It provides a unique booking ID and reservation details, which can be used to manage the reservation later. Transfer Management This API provides tools for managing transfer reservations. Using the booking ID provided by the Transfer Booking API, users can cancel reservations."},{"location":"resources/cars-transfers/#search-for-a-transfer","title":"Search for a transfer","text":"

The search is carried out through a POST API call to /shopping\u200b/transfer-offers. The API request includes parameters like the start and end locations, type of transfer, number of passengers, provider codes, and other optional parameters.

In the following example request, we have multiple parameters each with its own specific meaning and structure:

  • startLocationCode: \"CDG\" - This is an International Air Transport Association (IATA) airport code which represents Charles de Gaulle Airport in Paris, France. The starting location of the journey.

  • endAddressLine: \"Avenue Anatole France, 5\" - This is the exact address where the journey will end, presumably a location in Paris.

  • endCityName: \"Paris\" - The city where the journey ends.

  • endZipCode: \"75007\" - This represents the postal code of the end location.

  • endCountryCode: \"FR\" - It's a two-letter country code representing France.

  • endName: \"Souvenirs De La Tour\" - The name of the destination, perhaps a business or venue at the end location.

  • endGooglePlaceId: \"ChIJL-DOWeBv5kcRfTbh97PimNc\" - A unique identifier that Google assigns to a location. You can use it to get more details about this location using Google's Places API.

  • endGeoCode: \"48.859466,2.2976965\" - The geographical coordinates of the end location. The first number is latitude and the second is longitude.

  • transferType: \"PRIVATE\" - This indicates that the transfer type is private, meaning the transfer will not be shared with others. This value is the Amadeus transfer service type, which can take one of the following:

  • PRIVATE: Private transfer from point to point

  • SHARED: Shared transfer from point to point
  • TAXI: Taxi reservation from point to point, price is estimated
  • HOURLY: Chauffeured driven transfer per hour
  • AIRPORT_EXPRESS: Express Train from/to Airport
  • AIRPORT_BUS: Express Bus from/to Airport
  • HELICOPTER: Private helicopter flight from/to airport
  • PRIVATE_JET: Private flight from airport to airport

  • startDateTime: \"2021-11-10T10:30:00\" - The ISO 8601 timestamp when the journey begins.

  • providerCodes: \"TXO\" - The code representing the provider of the transfer service.

  • passengers: 2 - The total number of passengers who will take the journey.

  • stopOvers: This is an array of objects representing different stopovers on the journey. Each object includes details about the duration of the stopover, the sequence number (which stopover it is), and information about the stopover's address, country code, city name, zip code, Google place ID, name, and geographical coordinates. For example, a stopOver object might look like this:

{\n  \"duration\": \"PT2H30M\",\n  \"sequenceNumber\": 1,\n  \"addressLine\": \"Avenue de la Bourdonnais, 19\",\n  \"countryCode\": \"FR\",\n  \"cityName\": \"Paris\",\n  \"zipCode\": \"75007\",\n  \"googlePlaceId\": \"DOWeBv5kcRfTbh97PimN\",\n  \"name\": \"De La Tours\",\n  \"geoCode\": \"48.859477,2.2976985\",\n  \"stateCode\": \"FR\"\n}\n
  • startConnectedSegment: This object contains information about a connected transportation segment, like a flight, that leads to the start of this transfer. It includes details about the transportation type, transportation number, and the departure and arrival of this segment.

  • passengerCharacteristics: This array of objects includes details about the passengers' type codes and their ages. For example, \"ADT\" stands for an adult passenger and \"CHD\" stands for a child passenger.

{\n  \"startLocationCode\": \"CDG\",\n  ...\n  \"endGeoCode\": \"48.859466,2.2976965\",\n  \"transferType\": \"PRIVATE\",\n  ...\n  \"passengers\": 2,\n  \"stopOvers\": [\n    {\n      \"duration\": \"PT2H30M\",\n      \"sequenceNumber\": 1,\n      ...\n      \"stateCode\": \"FR\"\n    }\n  ],\n  ...\n  \"passengerCharacteristics\": [\n    {\n      \"passengerTypeCode\": \"ADT\",\n      \"age\": 20\n    },\n    ...\n  ]\n}\n

This request initiates a search for a private transfer for two passengers from location CDG with specific passenger characteristics and other details.

Let's have a look at the response:

{\n  \"data\": [\n    {\n      \"type\": \"transfer-offer\",\n      \"id\": \"0cb11574-4a02-11e8-842f-0ed5f89f718b\",\n      \"transferType\": \"PRIVATE\",\n      \"start\": {\n        \"dateTime\": \"2021-11-10T10:30:00\",\n        \"locationCode\": \"CDG\"\n      },\n      \"end\": {\n        \"address\": {\n          \"line\": \"Avenue Anatole France, 5\",\n          \"zip\": \"75007\",\n          \"countryCode\": \"FR\",\n          \"cityName\": \"Paris\",\n          \"latitude\": 48.859466,\n          \"longitude\": 2.2976965\n        },\n        \"googlePlaceId\": \"ChIJL-DOWeBv5kcRfTbh97PimNc\",\n        \"name\": \"Souvenirs De La Tour\"\n      },\n      \"stopOvers\": [\n        {\n          \"duration\": \"PT2H30M\",\n          \"sequenceNumber\": 1,\n          \"location\": {\n            \"locationCode\": \"CDG\",\n            \"address\": {\n              \"line\": \"Avenue de la Bourdonnais, 19\",\n              \"zip\": \"75007\",\n              \"countryCode\": \"FR\",\n              \"cityName\": \"Paris\",\n              \"latitude\": 48.859477,\n              \"longitude\": 2.2976975\n            },\n            \"googlePlaceId\": \"DOWeBv5kcRfTbh97PimN\",\n            \"name\": \"De La Tours\"\n          }\n        }\n      ],\n      \"vehicle\": {\n        \"code\": \"VAN\",\n        \"category\": \"BU\",\n        \"description\": \"Mercedes-Benz V-Class, Chevrolet Suburban, Cadillac Escalade or similar\",\n        \"seats\": [\n          {\n            \"count\": 3\n          }\n        ],\n        \"baggages\": [\n          {\n            \"count\": 3,\n            \"size\": \"M\"\n          }\n        ],\n        \"imageURL\": \"https://provider.com/images/BU_VAN.png\"\n      },\n      \"serviceProvider\": {\n        \"code\": \"ABC\",\n        \"name\": \"Provider name\",\n        \"logoUrl\": \"https://provider.com/images/logo.png\",\n        \"termsUrl\": \"https://provider.com/terms_and_conditions.html\",\n        \"contacts\": {\n          \"phoneNumber\": \"+33123456789\",\n          \"email\": \"support@provider.com\"\n        },\n        \"settings\": [\n          \"BILLING_ADDRESS_REQUIRED\",\n          \"FLIGHT_NUMBER_REQUIRED\",\n          \"CVV_NUMBER_REQUIRED\"\n        ]\n      },\n      \"quotation\": {\n        \"monetaryAmount\": \"63.70\",\n        \"currencyCode\": \"USD\",\n        \"isEstimated\": false,\n        \"base\": {\n          \"monetaryAmount\": \"103.70\"\n        },\n        \"discount\": {\n          \"monetaryAmount\": \"50.00\"\n        },\n        \"fees\": [\n          {\n            \"indicator\": \"AIRPORT\",\n            \"monetaryAmount\": \"10.00\"\n          }\n        ],\n        \"totalTaxes\": {\n          \"monetaryAmount\": \"12.74\"\n        },\n        \"totalFees\": {\n          \"monetaryAmount\": \"10.00\"\n        }\n      },\n      \"converted\": {\n        \"monetaryAmount\": \"63.70\",\n        \"currencyCode\": \"EUR\",\n        \"isEstimated\": false,\n        \"base\": {\n          \"monetaryAmount\": \"103.70\"\n        },\n        \"discount\": {\n          \"monetaryAmount\": \"50.00\"\n        },\n        \"fees\": [\n          {\n            \"indicator\": \"AIRPORT\",\n            \"monetaryAmount\": \"10.00\"\n          }\n        ],\n        \"totalTaxes\": {\n          \"monetaryAmount\": \"12.74\"\n        },\n        \"totalFees\": {\n          \"monetaryAmount\": \"10.00\"\n        }\n      },\n      \"extraServices\": [\n        {\n          \"code\": \"EWT\",\n          \"itemId\": \"EWT0291\",\n          \"description\": \"Extra 15 min. wait\",\n          \"quotation\": {\n            \"monetaryAmount\": \"39.20\",\n            \"currencyCode\": \"USD\",\n            \"base\": {\n              \"monetaryAmount\": \"36.00\"\n            },\n            \"totalTaxes\": {\n              \"monetaryAmount\": \"3.20\"\n            }\n          },\n          \"converted\": {\n            \"monetaryAmount\": \"32.70\",\n            \"currencyCode\": \"EUR\",\n            \"base\": {\n              \"monetaryAmount\": \"30.00\"\n            },\n            \"totalTaxes\": {\n              \"monetaryAmount\": \"2.7\"\n            }\n          },\n          \"isBookable\": true,\n          \"taxIncluded\": true,\n          \"includedInTotal\": false\n        }\n      ],\n      \"equipment\": [\n        {\n          \"code\": \"BBS\",\n          \"description\": \"Baby stroller or Push chair\",\n          \"quotation\": {\n            \"monetaryAmount\": \"39.20\",\n            \"currencyCode\": \"USD\",\n            \"base\": {\n              \"monetaryAmount\": \"36.00\"\n            },\n            \"totalTaxes\": {\n              \"monetaryAmount\": \"3.20\"\n            }\n          },\n          \"converted\": {\n            \"monetaryAmount\": \"32.70\",\n            \"currencyCode\": \"EUR\",\n            \"base\": {\n              \"monetaryAmount\": \"30.00\"\n            },\n            \"totalTaxes\": {\n              \"monetaryAmount\": \"2.7\"\n            }\n          },\n          \"isBookable\": true,\n          \"taxIncluded\": true,\n          \"includedInTotal\": false\n        }\n      ],\n      \"cancellationRules\": [\n        {\n          \"feeType\": \"PERCENTAGE\",\n          \"feeValue\": \"100\",\n          \"metricType\": \"DAYS\",\n          \"metricMin\": \"0\",\n          \"metricMax\": \"1\"\n        },\n        {\n          \"feeType\": \"PERCENTAGE\",\n          \"feeValue\": \"0\",\n          \"metricType\": \"DAYS\",\n          \"metricMin\": \"1\",\n          \"metricMax\": \"100\"\n        }\n      ],\n      \"methodsOfPaymentAccepted\": [\n        \"CREDIT_CARD\",\n        \"INVOICE\"\n      ],\n      \"discountCodes\": [\n        {\n          \"type\": \"CD\",\n          \"value\": \"FJKS0289LDIW234\"\n        }\n      ],\n      \"distance\": {\n        \"value\": 152,\n        \"unit\": \"KM\"\n      },\n      \"startConnectedSegment\": {\n        \"transportationType\": \"FLIGHT\",\n        \"transportationNumber\": \"AF380\",\n        \"departure\": {\n          \"localDateTime\": \"2021-11-10T09:00:00\",\n          \"iataCode\": \"NCE\"\n        },\n        \"arrival\": {\n          \"localDateTime\": \"2021-11-10T10:00:00\",\n          \"iataCode\": \"CDG\"\n        }\n      },\n      \"passengerCharacteristics\": [\n        {\n          \"passengerTypeCode\": \"ADT\",\n          \"age\": 20\n        },\n        {\n          \"passengerTypeCode\": \"CHD\",\n          \"age\": 10\n        }\n      ]\n    }\n  ],\n  \"warnings\": [\n    {\n      \"code\": 101,\n      \"title\": \"PICK-UP DATE TIME CHANGED\",\n      \"detail\": \"Transfer pick-up date and time have been changed by provider\",\n      \"source\": {\n        \"pointer\": \"/data/1/start/dateTime\",\n        \"parameter\": \"dateTime\"\n      }\n    }\n  ]\n}\n

The data represents a private transfer offer with the id 0cb11574-4a02-11e8-842f-0ed5f89f718b. The transfer begins from the location CDG at the time 2021-11-10T10:30:00 and ends at the location Souvenirs De La Tour located at Avenue Anatole France, 5 in Paris, France.

During the journey, there's a stopover at De La Tours situated at Avenue de la Bourdonnais, 19 in Paris, France for 2 hours and 30 minutes. The vehicle to be used for this transfer is a VAN in the category BU. The model of the vehicle can be a Mercedes-Benz V-Class, Chevrolet Suburban, Cadillac Escalade or similar. The vehicle can accommodate 3 passengers and 3 medium-sized baggages.

The transfer service provider is Provider name with the code ABC. The quotation for the transfer is 63.70 USD after a discount of 50.00 USD from the base price of 103.70 USD. The total taxes and fees for the transfer are 12.74 USD and 10.00 USD respectively.

There are also options to avail extra services like \"Extra 15 min. wait\" for 39.20 USD and to rent equipment like Baby stroller or Push chair for 39.20 USD. The cancellation rules state a 100% fee for cancellations made between 0 to 1 day before the transfer and no fee for cancellations made between 1 to 100 days before the transfer.

The payment for the transfer can be made through Credit Card or Invoice. A discount code FJKS0289LDIW234 is also available for use.

This transfer offer is linked to a flight with the transportation number AF380 departing from NCE at 2021-11-10T09:00:00 and arriving at CDG at 2021-11-10T10:00:00. The transfer caters to a passenger aged 20 and a child aged 10.

A warning code 101 titled PICK-UP DATE TIME CHANGED is issued stating that the transfer pick-up date and time have been changed by the provider.

"},{"location":"resources/cars-transfers/#booking-a-transfer","title":"Booking a transfer","text":"

Let's now look into the Transfer Booking API.

The main endpoint URL is https://test.api.amadeus.com/v1/ordering/transfer-orders?offerId=<OFFER_ID>. The parameter <OFFER_ID> needs to be replaced with the actual ID of the offer you wish to order, such as 0cb11574-4a02-11e8-842f-0ed5f89f718b, which we obtained in our previous example.

{\n  \"data\": {\n    \"note\": \"Note to driver\",\n    \"passengers\": [\n      {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\",\n        \"title\": \"MR\",\n        \"contacts\": {\n          \"phoneNumber\": \"+33123456789\",\n          \"email\": \"user@email.com\"\n        },\n        \"billingAddress\": {\n          \"line\": \"Avenue de la Bourdonnais, 19\",\n          \"zip\": \"75007\",\n          \"countryCode\": \"FR\",\n          \"cityName\": \"Paris\"\n        }\n      }\n    ],\n    \"agency\": {\n      \"contacts\": [\n        {\n          \"email\": {\n            \"address\": \"abc@test.com\"\n          }\n        }\n      ]\n    },\n    \"payment\": {\n      \"methodOfPayment\": \"CREDIT_CARD\",\n      \"creditCard\": {\n        \"number\": \"4111111111111111\",\n        \"holderName\": \"JOHN DOE\",\n        \"vendorCode\": \"VI\",\n        \"expiryDate\": \"1018\",\n        \"cvv\": \"111\"\n      }\n    },\n    \"extraServices\": [\n      {\n        \"code\": \"EWT\",\n        \"itemId\": \"EWT0291\"\n      }\n    ],\n    \"equipment\": [\n      {\n        \"code\": \"BBS\"\n      }\n    ],\n    \"corporation\": {\n      \"address\": {\n        \"line\": \"5 Avenue Anatole France\",\n        \"zip\": \"75007\",\n        \"countryCode\": \"FR\",\n        \"cityName\": \"Paris\"\n      },\n      \"info\": {\n        \"AU\": \"FHOWMD024\",\n        \"CE\": \"280421GH\"\n      }\n    },\n    \"startConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2021-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2021-03-27T20:03:00\"\n      }\n    },\n    \"endConnectedSegment\": {\n      \"transportationType\": \"FLIGHT\",\n      \"transportationNumber\": \"AF380\",\n      \"departure\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2021-03-27T20:03:00\"\n      },\n      \"arrival\": {\n        \"uicCode\": \"7400001\",\n        \"iataCode\": \"CDG\",\n        \"localDateTime\": \"2021-03-27T20:03:00\"\n      }\n    }\n  }\n}\n
- data: Root level object encapsulating all the necessary data for the transfer order. - note: A string containing a note intended for the driver. (Example: \"Note to driver\") - passengers: An array of objects, each representing a passenger with the following properties: - firstName: A string containing the passenger's first name. (Example: \"John\") - lastName: A string containing the passenger's last name. (Example: \"Doe\") - title: A string containing the passenger's title (\"MR\", \"MS\", etc.). (Example: \"MR\") - contacts: An object containing contact details: - phoneNumber: A string containing the passenger's phone number. (Example: \"+33123456789\") - email: A string containing the passenger's email address. (Example: \"user@email.com\") - billingAddress: An object containing the billing address details: - line: Street name and number. (Example: \"Avenue de la Bourdonnais, 19\") - zip: Zip or postal code. (Example: \"75007\") - countryCode: Country code. (Example: \"FR\") - cityName: City name. (Example: \"Paris\") - agency: An object representing the agency details with the following properties: - contacts: An array containing objects, each representing a contact's details: - email: An object containing the email details: - address: A string containing the contact's email address. (Example: \"abc@test.com\") - payment: An object containing payment details: - methodOfPayment: A string indicating the method of payment. (Example: \"CREDIT_CARD\") - creditCard: An object containing credit card details: - number: A string containing the credit card number. (Example: \"4111111111111111\") - holderName: A string containing the card holder's name. (Example: \"JOHN DOE\") - vendorCode: A string containing the vendor's code. (Example: \"VI\") - expiryDate: A string containing the expiry date of the card. (Example: \"1018\") - cvv: A string containing the card's CVV. (Example: \"111\") - extraServices: An array containing objects, each representing an extra service: - code: A string indicating the service's code. (Example: \"EWT\") - itemId: A string indicating the service's item ID. (Example: \"EWT0291\") - equipment: An array containing objects, each representing an equipment detail: - code: A string indicating the equipment's code. (Example: \"BBS\") - corporation: An object containing corporation details: - address: An object containing the corporation address: - line: Street name and number. (Example: \"5 Avenue Anatole France\") - zip: Zip or postal code. (Example: \"75007\") - countryCode: Country code. (Example: \"FR\") - cityName: City name. (Example: \"Paris\") - info: An object containing additional corporation info: - AU: Additional information (Example: \"FHOWMD024\") - CE: Additional information (Example: \"280421GH\") - startConnectedSegment: An object representing the start of a connected transport segment: - transportationType: A string indicating the type of transportation. (Example: \"FLIGHT\") - transportationNumber: A string indicating the transportation number. (Example: \"AF380\") - departure: An object containing departure details: - uicCode: A string indicating the UIC code. (Example: \"7400001\") - iataCode: A string indicating the IATA code. (Example: \"CDG\") - localDateTime: A string indicating the local date and time of departure. (Example: \"2021-03-27T20:03:00\") - arrival: An object containing arrival details: - uicCode: A string indicating the UIC code. (Example: \"7400001\") - iataCode: A string indicating the IATA code. (Example: \"CDG\") - localDateTime: A string indicating the local date and time of arrival. (Example: \"2021-03-27T20:03:00\") - endConnectedSegment: An object representing the end of a connected transport segment (same structure as startConnectedSegment).

"},{"location":"resources/cars-transfers/#cancelling-a-transfer","title":"Cancelling a transfer","text":"

The Transfer Management API effectively allows us to cancel a transfer linked with an existing order.

For example:

POST https://test.api.amadeus.com/v1/ordering/transfer-orders/{orderId}/transfers/cancellation

The {orderId} in the URL should be replaced with the unique identifier of the order that was previously generated when the order was created. For instance, the orderId could be something like 0cb11574-4a02-11e8-842f-0ed5f89f718b.

The confirmNbr is a unique confirmation number associated with the transfer that is to be cancelled.

The response for this request will confirm the cancellation of the transfer. Here's an example response:

{\n  \"data\": {\n    \"confirmNbr\": \"2904892\",\n    \"reservationStatus\": \"CANCELLED\"\n  }\n}\n

In this example response, we see the confirmNbr 2904892 and the reservationStatus CANCELLED, confirming that the cancellation has been successful.

"},{"location":"resources/destination-experiences/","title":"Destination Experiences","text":"

With Amadeus Self-Service APIs, you can find data on over two million places and 150,000 activities and show travelers the best things to see and do. In the Destination Experiences category, we have two APIs available for that.

Information

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

APIs Description Points of Interest Find the best sights, shops, and restaurants in any city or neighborhood. Tours and Activities Find the best tours, activities, and tickets in any city or neighborhood. Includes a deep link to book with the provider.

These two APIs have the same behavior. You can search by radius or by a square, and retrieve results by ID. Let's go through them one by one.

"},{"location":"resources/destination-experiences/#show-travelers-the-best-sights-shops-and-restaurants","title":"Show Travelers the best sights, shops, and restaurants","text":"

The Points of Interest API relies on AVUXI\u2019s GeoPopularity algorithm, which analyses and ranks geolocated data from more than 60 sources, including comments, photos, and reviews from millions of users.

"},{"location":"resources/destination-experiences/#search-by-radius","title":"Search by radius","text":"

The first endpoint supports only GET method and returns a list of points of interest for a given location - latitude and longitude - and a radius (1 km by default).

The following sample returns a list of Points of Interest for someone geolocated in Barcelona downtown:

curl https://test.api.amadeus.com/v1/reference-data/locations/pois?latitude=41.397158&longitude=2.160873\n

In case we want to expand the area of search, we could use the radius parameter. In the following example, we increase the radius to 3 kilometers:

curl https://test.api.amadeus.com/v1/reference-data/locations/pois?latitude=41.397158&longitude=2.160873&radius=3\n
"},{"location":"resources/destination-experiences/#search-by-a-square","title":"Search by a square","text":"

The second endpoint works in a similar way to the radius-based endpoint. It also supports GET operations but it defines the area of search by a square: North, West, South, and East.

The following example returns a list of points of interest for an area around Barcelona:

curl https://test.api.amadeus.com/v1/reference-data/locations/pois/by-square?north=41.397158&west=2.160873&south=41.394582&east=2.177181   \n
"},{"location":"resources/destination-experiences/#response","title":"Response","text":"

For both endpoints you can expect the same response format - a list of locations with the following JSON structure:

{\n            \"type\": \"location\",\n            \"subType\": \"POINT_OF_INTEREST\",\n            \"id\": \"AF57D529B2\",\n            \"self\": {\n                \"href\": \"https://test.api.amadeus.com/v1/reference-data/locations/pois/AF57D529B2\",\n                \"methods\": [\n                    \"GET\"\n                ]\n            },\n            \"geoCode\": {\n                \"latitude\": 41.40359,\n                \"longitude\": 2.17436\n            },\n            \"name\": \"La Sagrada Familia\",\n            \"category\": \"SIGHTS\",\n            \"rank\": 5,\n            \"tags\": [\n                \"church\",\n                \"sightseeing\",\n                \"temple\",\n                \"sights\",\n                \"attraction\",\n                \"historicplace\",\n                \"tourguide\",\n                \"landmark\",\n                \"professionalservices\",\n                \"latte\",\n                \"activities\",\n                \"commercialplace\"\n            ]\n        }\n
  • Type and subType are literals with fixed values.
  • id is a unique value for this point of interest, which you can use in the next endpoint.
  • geoCode is a structure that contains geolocation information: latitude and longitude of the location.
  • name contains the string identifying the location.
  • category corresponds to the category of the location and could be one of the following values: SIGHTS, BEACH_PARK, HISTORICAL, NIGHTLIFE, RESTAURANT, or SHOPPING.
  • rank is the position compared to other locations based on how famous a place is, with 1 being the highest.
  • tags field is a list of words related to that location, which comes directly from the different sources of data analyzed.
"},{"location":"resources/destination-experiences/#retrieve-by-id","title":"Retrieve by Id","text":"

You can also keep the unique Id of each point of interest and retrieve it with the last endpoint as below.

curl https://test.api.amadeus.com/v1/reference-data/locations/pois/AF57D529B2  \n
"},{"location":"resources/destination-experiences/#offer-tours-activities-and-attraction-tickets","title":"Offer tours, activities, and attraction tickets","text":"

The Tours and Activities API is built in partnership with MyLittleAdventure. Tours and Activities API enables you to offer users the best activities in any destination, complete with a photo, description, price, and link to book the activity directly with the provider.

For the API, we partnered with MyLittleAdventure which aggregates offers from over 45 of the world\u2019s top activity platforms, such as Viator, GetYourGuide, Klook and Musement and applies an algorithm to identify duplicate activities across providers, compare them and return the best one.

You can now help your users find the best things to do in over 8,000 destinations worldwide and book more than 300,000 unique activities including sightseeing tours, day trips, skip-the-line museum tickets, food tours, hop-on-hop-off bus tickets and much more.

This API has the same design as other endpoints, such as the Points of Interest API.

"},{"location":"resources/destination-experiences/#search-by-radius_1","title":"Search by radius","text":"

You can search activities for a specific location by providing a latitude and longitude. The API returns activities within a 1km radius, but you can also define a custom radius.

curl https://test.api.amadeus.com/v1/shopping/activities/longitude=-3.69170868&latitude=40.41436995&radius=1   \n
"},{"location":"resources/destination-experiences/#search-by-a-square_1","title":"Search by a square","text":"

You can search activities within a given area by providing the coordinates: North, West, South, and East.

curl https://test.api.amadeus.com/v1/shopping/activities/by-square?north=41.397158&west=2.160873&south=41.394582&east=2.177181 \n
"},{"location":"resources/destination-experiences/#response_1","title":"Response","text":"

Let\u2019s look at a sample response from the Tours and Activities API:

{ \n  \"data\": [ \n    { \n      \"id\": \"23642\", \n      \"type\": \"activity\", \n      \"self\": { \n        \"href\": \"https://test.api.amadeus.com/v1/shopping/activities/23642\", \n        \"methods\": [ \n          \"GET\" \n        ] \n      }, \n      \"name\": \"Skip-the-line tickets to the Prado Museum\", \n      \"shortDescription\": \"Book your tickets for the Prado Museum in Madrid, discover masterpieces by Vel\u00e1zquez, Goya, Mantegna, Raphael, Tintoretto and access all temporary exhibitions.\", \n      \"geoCode\": { \n        \"latitude\": \"40.414000\", \n        \"longitude\": \"-3.691000\" \n      }, \n      \"rating\": \"4.500000\", \n      \"pictures\": [ \n        \"https://images.musement.com/cover/0001/07/prado-museum-tickets_header-6456.jpeg?w=500\" \n      ], \n      \"bookingLink\": \"https://b2c.mla.cloud/c/QCejqyor?c=2WxbgL36\", \n      \"price\": { \n        \"currencyCode\": \"EUR\", \n        \"amount\": \"16.00\" \n      } \n    } \n  ] \n} \n

As you can see, the API returns a unique activity Id along with the activity name, short description, geolocation, customer rating, image, price and deep link to the provider page to complete the booking.

  • Type is a literal with a fixed value.
  • id is a unique value for this activity, that you can use in the next endpoint.
  • name and shortDescription contains the information about the activity.
  • geoCode is a structure that contains geolocation information: latitude and longitude of the location.
  • rating is a rating of the activity.
  • pictures and booking link are external links to check the relevant pictures and to go to the booking URL from the activity provider.
  • price is the price of the fare, which can be alpha-numeric. Ex- 500.20 or 514.13A, A signifies additional collection.
"},{"location":"resources/destination-experiences/#retrieve-by-id_1","title":"Retrieve by Id","text":"

Same as Points of Interest API, you can keep the unique Id of each activity and retrieve it with the last endpoint as below.

curl https://test.api.amadeus.com/v1/shopping/activities/23642\n
"},{"location":"resources/flights/","title":"Flights","text":"

The Flights category contains a wide array of APIs that can help you manage flights, from searching for flight options to actually booking a flight.

Information

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

APIs Description Flight booking Flight Offers Search Lets you can search flights between two cities, perform multi-city searches for longer itineraries and access one-way combinable fares to offer the cheapest options possible. Flight Offers Price Confirms the availability and final price (including taxes and fees) of flights returned by the Flight Offers Search API. Flight Create Orders Provides a unique booking ID and reservation details once the reservation is completed. Flight Order Management Checks the latest status of a reservation, shows post-booking modifications like ticket information or form of payment and lets you cancel reservations. Seatmap Display Shows airplane cabin plan from a Flight Offer in order for the traveler to be able to choose their seat during the flight booking flow. Branded Fares Upsell Provides the branded fares available for a given flight, along with pricing and a fare description. Flight Price Analysis Uses an Artificial Intelligence algorithm trained on Amadeus historical flight booking data to show how current flight prices compare to historical fares and whether the price of a flight is below or above average. Flight Choice Prediction Uses Artificial Intelligence and Amadeus historical flight booking data to identify which flights in search results are most likely to be booked. Flight inspiration Flight Inspiration Search Provides a list of destinations from a given city that is ordered by price and can be filtered by departure date or maximum price. Flight Cheapest Date Search Provides a list of flight options with dates and prices, and allows you to order by price, departure date or duration. Flight Availabilities Search Provides a list of flights with seats for sale on a given itinerary and the quantity of seats available in different fare classes. Travel Recommendations Uses Artificial Intelligence trained on Amadeus historical flight search data to determine which destinations are also popular among travelers with similar profiles, and provides a list of recommended destinations with name, IATA code, coordinates and similarity score. Flight schedule On Demand Flight Status Provides real-time flight schedule data including up-to-date departure and arrival times, terminal and gate information, flight duration and real-time delay status. Help travelers track the live status of their flight and enjoy a stress-free trip. Flight Delay Prediction Provides delay probabilities for four possible delay lengths Airport Airport & City Search Finds airports and cities that match a specific word or a string of letters. Airport Nearest Relevant Provides a list of commercial airports within a 500km (311mi) radius of a given point that are ordered by relevance, which considers their distance from the starting point and their yearly flight traffic. Airport Routes API Finds all destinations served by a given airport. Airport On-Time Performance Predicts an airport's overall performance based on the delay of all flights during a day. Airlines Flight Check-in Links Simplifies the check-in process by providing direct links to the airline check-in page. Airline Code Lookup Finds the name of an airline by its IATA or ICAO airline codes. Airline Routes Finds all destinations served by a given airline."},{"location":"resources/flights/#search-flights","title":"Search flights","text":""},{"location":"resources/flights/#search-to-get-flight-inspirations","title":"Search to get flight inspirations","text":"

The Flight Inspiration Search API provides a list of destinations from a given airport that is searched by the IATA code of the origin, ordered by price and filtered by departure date, one-way/round-trip, trip duration, connecting flights or maximum price.

Information

The Flight Inspiration Search API uses dynamic cache data. This cache data is created daily based on the most trending options that are derived from past searches and bookings. In this way, only the most trending options are included in the response.

The only mandatory query parameter is the IATA code of the origin as in the following example request that retrieves a list of destinations from Boston:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS\n

The departure date is an optional parameter, which needs to be provided in the YYYY-MM-DD format:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&departureDate=2022-12-12\n

If the oneWay parameter set to true, only one way flight options will be provided in the response. Alternatively, if the oneWay parameter set to false, the search results will show round-trip flights. Otherwise, both flight options will be included in the results. For example, the following request shows one-way flights out of Boston:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&oneWay=true\n

One-way journeys can be optionally refined by the journey duration provided in days with the duration parameter:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&oneWay=true&duration=2\n

The nonStop parameter filters the search query to direct flights only:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&nonStop=true\n

If you need to cap the maximum ticket price, just specify the maximum price in decimals using the maxPrice parameter:

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=BOS&maxPrice=100\n

Information

This API returns cached prices. Once a destination is chosen, use the Flight Offers Search API to get real-time pricing and availability.

The API provides a link to the Flight Offers Search API to search for flights once a destination is chosen and a link to the Flight Cheapest Date Search API to check the cheapest dates to fly:

\"data\": [\n        {\n            \"type\": \"flight-destination\",\n            \"origin\": \"BOS\",\n            \"destination\": \"CHI\",\n            \"departureDate\": \"2022-07-22\",\n            \"returnDate\": \"2022-07-28\",\n            \"price\": {\n                \"total\": \"52.18\"\n            },\n            \"links\": {\n                \"flightDates\": \"https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&destination=CHI&departureDate=2022-07-02,2022-12-28&oneWay=false&duration=1,15&nonStop=false&maxPrice=300&currency=USD&viewBy=DURATION\",\n                \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22&returnDate=2022-07-28&adults=1&nonStop=false&maxPrice=300&currency=USD\"\n            }\n        }\n    ]\n
"},{"location":"resources/flights/#search-for-destinations-for-a-specific-duration-of-stay","title":"Search for destinations for a specific duration of stay","text":"

For example, let's say a traveler wants to spend six days in a city but doesn't have a strong preference for the destination. With the Flight Inspiration Search API we can recommend the traveler the cheapest destinations based on the stay duration.\u00a0

This can be done using the parameter viewBy which returns\u00a0flight destinations by DATE, DESTINATION, DURATION, WEEK, or COUNTRY. In our scenario we need to pass the value DURATION to the parameter viewBy, like in the example below. Also, as input we give a duration of six days and origin Miami. The departure date will be between the 1st and 3rd of September 2021.

GET https://test.api.amadeus.com/v1/shopping/flight-destinations?departureDate=2021-09-01,2021-09-03&duration=6&origin=MIA&viewBy=DURATION

  {\n            \"type\": \"flight-destination\",\n            \"origin\": \"MIA\",\n            \"destination\": \"MSP\",\n            \"departureDate\": \"2021-09-01\",\n            \"returnDate\": \"2021-09-07\",\n            \"price\": {\n                \"total\": \"136.79\"\n            },\n            \"links\": {\n                \"flightDates\": \"https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MIA&destination=MSP&departureDate=2021-09-01,2021-09-03&oneWay=false&duration=6&nonStop=false&viewBy=DURATION\",\n                \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MIA&destinationLocationCode=MSP&departureDate=2021-09-01&returnDate=2021-09-07&adults=1&nonStop=false\"\n            }\n        },\n        {\n            \"type\": \"flight-destination\",\n            \"origin\": \"MIA\",\n            \"destination\": \"STT\",\n            \"departureDate\": \"2021-09-02\",\n            \"returnDate\": \"2021-09-08\",\n            \"price\": {\n                \"total\": \"137.36\"\n            },\n            \"links\": {\n                \"flightDates\": \"https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MIA&destination=STT&departureDate=2021-09-01,2021-09-03&oneWay=false&duration=6&nonStop=false&viewBy=DURATION\",\n                \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MIA&destinationLocationCode=STT&departureDate=2021-09-02&returnDate=2021-09-08&adults=1&nonStop=false\"\n            }\n        }\n

As you can see, all the recommendations have a duration of six days and are sorted by the lowest price. The API also provides link to the Flight Offers Search API for each result in order to check for available flights.

"},{"location":"resources/flights/#search-for-cheapest-flights-regardless-of-the-dates","title":"Search for cheapest flights regardless of the dates","text":"

The Flight Cheapest Date Search API finds the cheapest dates to travel from one city to another. The API provides a list of flight options with dates and prices, and allows you to order by price, departure date or duration.

Information

The Flight Cheapest Date Search API uses dynamic cache data. This cache data is created daily based on the most trending options that are derived from past searches and bookings. In this way, only the most trending options are included in the response.

Information

This API returns cached prices. Once the dates are chosen, use the Flight Offers Search API to get real-time pricing and availability.

The origin and destination are the two mandatory query parameters:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=MUC\n

We can further refine our search query by the departure dates, one-way/round-trip, trip duration, connecting flights or maximum price.

The API supports one or multiple departure dates in the query provided the dates are speficied in the ISO 8601 YYYY-MM-DD format and separated by a comma:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&destination=CHI&departureDate=2022-08-15,2022-08-28\n

If the oneWay parameter set to true, only one way flight options will be provided in the response. Alternatively, if the oneWay parameter set to false, the search results will show round-trip flights. Otherwise, both flight options will be included in the results. For example, the following request shows one-way flights out of Boston:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&oneWay=true\n

One-way journeys can be optionally refined by the journey duration provided in days with the duration parameter:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&oneWay=true&duration=2\n

The nonStop parameter filters the search query to direct flights only:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&nonStop=true\n

If you need to cap the maximum ticket price, just specify the maximum price in decimals using the maxPrice parameter:

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=BOS&maxPrice=100\n

The API provides a link to the Flight Offers Search API to search for flights once a destination is chosen, in order to proceed with the booking flow.

"},{"location":"resources/flights/#search-for-best-flight-offers","title":"Search for best flight offers","text":"

The Flight Offers Search API searches over 500 airlines to find the cheapest flights for a given itinerary. The API lets you search flights between two cities, perform multi-city searches for longer itineraries and access one-way combinable fares to offer the cheapest options possible. For each itinerary, the API provides a list of flight offers with prices, fare details, airline names, baggage allowances and departure terminals.

Tip

  • Flight Offers Search API is the first step of Flight booking engine flow. Check the details from Video Tutorials and Blog Tutorial.

Warning

  • Flights from low-cost carriers and American Airlines are currently unavailable.

The Flight Offers Search API starts the booking cycle with a search for the best fares. The API returns a list of the cheapest flights given a city/airport of departure, a city/airport of arrival, the number and type of passengers and travel dates. The results are complete with airline name and fares as well as additional information, such as bag allowance and pricing for additional baggage.

The API comes in two flavors:

  • Simple version: GET operation with few parameters but which is quicker to integrate.
  • On steroids: POST operation offering the full functionalities of the API.

The minimum GET request has following mandatory query parameters:

  • IATA code for the origin location
  • IATA code for the destination location
  • Departure date in the ISO 8601 YYYY-MM-DD format
  • Number of adult travellers
GET https://test.api.amadus.com/v2/shopping/flight-offers?adults=1&originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22\n

Let's have a look at all the optional parameters that we can use to refine the search query. One or more of these parameters can be used in addition to the mandatory query parameters.

Return date in the ISO 8601 YYYY-MM-DD format, same as the departure date:

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-22&returnDate=2022-07-26&adults=1\n

Number of children travelling, same as the number of adults:

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&children=1\n

Number of infants travelling, same as the number of adults:

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&infants=1\n

Travel class, which includes economy, premium economy, business or first:

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&travelClass=ECONOMY\n

We can limit the search to a specific airline by providing its IATA airline code, such as BA for the British Airways:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&includedAirlineCodes=BA

Alternatively, we can exclude an airline from the search in a similar way:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&excludedAirlineCodes=BA

The nonStop parameter filters the search query to direct flights only:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&nonStop=true

The currencyCode defines the currency in which we will see the offer prices:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&currencyCode=EUR

We can limit the maximum price to a certain amount and specify the currency as described above:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&maxPrice=500&currencyCode=EUR

The maximum number of results retrieved can be limited using the max parameter in the search query:

https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BOS&destinationLocationCode=CHI&departureDate=2022-07-26&adults=1&max=1

The API returns a list of flight-offer objects (up to 250), including information such as itineraries, price, pricing options, etc.

\"data\": [\n    {\n      \"type\": \"flight-offer\",\n      \"id\": \"1\",\n      \"source\": \"GDS\",\n      \"instantTicketingRequired\": false,\n      \"nonHomogeneous\": false,\n      \"oneWay\": false,\n      \"lastTicketingDate\": \"2022-07-02\",\n      \"numberOfBookableSeats\": 9,\n      \"itineraries\": [ ],\n      \"price\": {\n        \"currency\": \"EUR\",\n        \"total\": \"22.00\",\n        \"base\": \"13.00\",\n        \"fees\": [\n          {\n            \"amount\": \"0.00\",\n            \"type\": \"SUPPLIER\"\n          },\n          {\n            \"amount\": \"0.00\",\n            \"type\": \"TICKETING\"\n          }\n        ],\n        \"grandTotal\": \"22.00\"\n      }\n    }\n  ]\n

The POST endpoint consumes JSON data in the format described below. So, instead of constructing a search query, we can specify all the required parameters in the payload and pass it onto the API in the request body. In addition to this, a X-HTTP-Method-Override header parameter is required.

{\n  \"currencyCode\": \"USD\",\n  \"originDestinations\": [\n    {\n      \"id\": \"1\",\n      \"originLocationCode\": \"RIO\",\n      \"destinationLocationCode\": \"MAD\",\n      \"departureDateTimeRange\": {\n        \"date\": \"2022-11-01\",\n        \"time\": \"10:00:00\"\n      }\n    },\n    {\n      \"id\": \"2\",\n      \"originLocationCode\": \"MAD\",\n      \"destinationLocationCode\": \"RIO\",\n      \"departureDateTimeRange\": {\n        \"date\": \"2022-11-05\",\n        \"time\": \"17:00:00\"\n      }\n    }\n  ],\n  \"travelers\": [\n    {\n      \"id\": \"1\",\n      \"travelerType\": \"ADULT\"\n    },\n    {\n      \"id\": \"2\",\n      \"travelerType\": \"CHILD\"\n    }\n  ],\n  \"sources\": [\n    \"GDS\"\n  ],\n  \"searchCriteria\": {\n    \"maxFlightOffers\": 2,\n    \"flightFilters\": {\n      \"cabinRestrictions\": [\n        {\n          \"cabin\": \"BUSINESS\",\n          \"coverage\": \"MOST_SEGMENTS\",\n          \"originDestinationIds\": [\n            \"1\"\n          ]\n        }\n      ],\n      \"carrierRestrictions\": {\n        \"excludedCarrierCodes\": [\n          \"AA\",\n          \"TP\",\n          \"AZ\"\n        ]\n      }\n    }\n  }\n}\n
"},{"location":"resources/flights/#search-for-flights-including-or-excluding-specific-airlines","title":"Search for flights including or excluding specific airlines","text":"

If you want your search to return flights with only specified airlines, you can use the parameter includedAirlineCodes to consider specific airlines. For example, there is a traveler who wants to travel from Berlin to Athens only with Aegean Airlines (A3):

GET https://test.api.amadeus.com/v2/shopping/flight-offers?max=3&adults=1&includedAirlineCodes=A3&originLocationCode=BER&destinationLocationCode=ATH&departureDate=2022-12-06

With the parameter excludedAirlineCodes you can ignore specific airlines. For example, there is a traveler who wants to travel from Berlin to Athens ignoring both Aegean Airlines (A3) and Iberia (IB):

GET https://test.api.amadeus.com/v2/shopping/flight-offers?max=3&adults=1&excludedAirlineCodes=A3,IB&originLocationCode=BER&destinationLocationCode=ATH&departureDate=2021-09-06

"},{"location":"resources/flights/#interactive-code-examples","title":"Interactive code examples","text":"

Check out this interactive code example which provides a flight search form to help you build your app. You can easily customize it and use the Flight Offers Search API to get the cheapest flight offers.

"},{"location":"resources/flights/#search-for-the-best-flight-option","title":"Search for the best flight option","text":"

The Flight Choice Prediction API predicts the flight your users will choose. Our machine-learning models have analyzed historical interactions with the Flight Offers Search API and can determine each flight\u2019s probability of being chosen. Boost conversions and create a personalized experience by filtering out the noise and showing your users the flights which are best for them.

Here is a quick cURL example piping the Flight Offers Search API results directly to the prediction API. Please note that a X-HTTP-Method-Override header parameter is required.

Let\u2019s look at flight offers for a Madrid-New York round trip (limiting to four options for this test illustration)

curl --request GET \\\n     --header 'Authorization: Bearer <token>' \\\n     --url https://test.api.amadeus.com/v2/shopping/flight-offers\\?origin\\=MAD\\&destination\\=NYC\\&departureDate\\=2019-08-24\\&returnDate\\=2019-09-19\\&adults\\=1 \\\n| curl --request POST \\\n       --header 'content-type: application/json' \\\n       --header 'Authorization: Bearer <token>' \\\n       --header 'X-HTTP-Method-Override: POST' \\\n       --url https://test.api.amadeus.com/v2/shopping/flight-offers/prediction --data @-\n

The prediction API returns the same content as the Low Fare search with the addition of the choiceProbability field for each flight offer element.

 {\n  \"data\": [\n    {\n      \"choiceProbability\": \"0.9437563627430908\",\n      \"id\": \"1558602440311-352021104\",\n      \"offerItems\": [...],\n      \"type\": \"flight-offer\"\n    },\n    {\n      \"choiceProbability\": \"0.0562028823257711\",\n      \"id\": \"1558602440311--1831925786\",\n      \"offerItems\": [...],\n      \"type\": \"flight-offer\"\n    },\n    {\n      \"choiceProbability\": \"0.0000252425060482\",\n      \"id\": \"1558602440311-480701674\",\n      \"offerItems\": [...],\n      \"type\": \"flight-offer\"\n    },\n    {\n      \"choiceProbability\": \"0.0000155124250899\",\n      \"id\": \"1558602440311--966634676\",\n      \"offerItems\": [...],\n      \"type\": \"flight-offer\"\n    }\n  ],\n  \"dictionaries\": {...}\n  },\n  \"meta\": {...}\n  }\n}\n
"},{"location":"resources/flights/#search-for-flight-offers-for-multiple-cities","title":"Search for flight offers for multiple cities","text":"

Many travelers take advantage of their international trips to visit several destinations. Multi-city search is a functionality that lets you search for consecutive one-way flights between multiple destinations in a single request. The returned flights are packaged as a complete, bookable itinerary.

To perform multi-city searches, you must use the POST method of the Flight Offers Search API. The API lets you search for up to six origin and destination city pairs.

In the following example, we\u2019ll fly from Madrid to Paris, where we\u2019ll spend a couple of days, then fly to Munich for three days. Next, we\u2019ll visit Amsterdam for two days before finishing our journey with a return to Madrid. We'll use the following IATA city codes: MAD > PAR > MUC > AMS > MAD

The request will look like this:

curl https://test.api.amadeus.com/v2/shopping/flight-offers \\\n-d '{ \n\u202f\u202f\"originDestinations\": [ \n\u202f\u202f\u202f\u202f{ \n\u202f\u202f\u202f\u202f\u202f\u202f\"id\":\u202f\"1\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"originLocationCode\":\u202f\"MAD\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"destinationLocationCode\":\u202f\"PAR\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"departureDateTimeRange\": { \n\u202f\u202f\u202f\u202f\u202f\u202f\u202f\u202f\"date\":\u202f\"2022-10-03\" \n\u202f\u202f\u202f\u202f\u202f\u202f} \n\u202f\u202f\u202f\u202f}, \n\u202f\u202f\u202f\u202f{ \n\u202f\u202f\u202f\u202f\u202f\u202f\"id\":\u202f\"2\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"originLocationCode\":\u202f\"PAR\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"destinationLocationCode\":\u202f\"MUC\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"departureDateTimeRange\": { \n\u202f\u202f\u202f\u202f\u202f\u202f\u202f\u202f\"date\":\u202f\"2022-10-05\" \n\u202f\u202f\u202f\u202f\u202f\u202f} \n\u202f\u202f\u202f\u202f}, \n\u202f\u202f\u202f\u202f{ \n\u202f\u202f\u202f\u202f\u202f\u202f\"id\":\u202f\"3\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"originLocationCode\":\u202f\"MUC\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"destinationLocationCode\":\u202f\"AMS\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"departureDateTimeRange\": { \n\u202f\u202f\u202f\u202f\u202f\u202f\u202f\u202f\"date\":\u202f\"2022-10-08\" \n\u202f\u202f\u202f\u202f\u202f\u202f} \n\u202f\u202f\u202f\u202f}, \n\u202f\u202f\u202f\u202f{ \n\u202f\u202f\u202f\u202f\u202f\u202f\"id\":\u202f\"4\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"originLocationCode\":\u202f\"AMS\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"destinationLocationCode\":\u202f\"MAD\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"departureDateTimeRange\": { \n\u202f\u202f\u202f\u202f\u202f\u202f\u202f\u202f\"date\":\u202f\"2022-10-11\" \n\u202f\u202f\u202f\u202f\u202f\u202f} \n\u202f\u202f\u202f\u202f} \n\u202f\u202f], \n\u202f\u202f\"travelers\": [ \n\u202f\u202f\u202f\u202f{ \n\u202f\u202f\u202f\u202f\u202f\u202f\"id\":\u202f\"1\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"travelerType\":\u202f\"ADULT\", \n\u202f\u202f\u202f\u202f\u202f\u202f\"fareOptions\": [ \n\u202f\u202f\u202f\u202f\u202f\u202f\u202f\u202f\"STANDARD\" \n\u202f\u202f\u202f\u202f\u202f\u202f] \n\u202f\u202f\u202f\u202f} \n\u202f\u202f], \n\u202f\u202f\"sources\": [ \n\u202f\u202f\u202f\u202f\"GDS\" \n\u202f\u202f], \n\u202f\u202f\"searchCriteria\": { \n\u202f\u202f\u202f\u202f\"maxFlightOffers\":\u202f1 \n\u202f\u202f} \n}' \n
"},{"location":"resources/flights/#search-using-loyalty-programs","title":"Search using loyalty programs","text":"

The Flight Offers Price API and the Seatmap Display API both accept Frequent Flyer information so end-users can benefit from their loyalty program. When adding Frequent Flyer information, please remember that each airline policy is different, and some require additional information, such as passenger name, email or phone number to validate the account. If the validation fails, your user won\u2019t receive their loyalty program advantages.

"},{"location":"resources/flights/#search-for-routes-from-a-specific-airport","title":"Search for routes from a specific airport","text":"

The Airport Routes API shows all destinations from a given airport. To follow up on our previous example, let's check where we can fly to from Madrid (MAD). The options are obviously quite broad, so we can limit the maximum number of results to 10. Keep in mind that this limit will apply from the beginning of the results list in the alphabetical order of the airport IATA codes.

The request will look like this:

curl --request GET \\\n     --header 'Authorization: Bearer <token>' \\\n     --url https://test.api.amadeus.com/v1/airport/direct-destinations?departureAirportCode=MAD&max=10 \\\n

So we can see the the following results:

{\n  \"meta\": {\n    \"count\": 10,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/airport/direct-destinations?departureAirportCode=MAD&max=10\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ALBACETE\",\n      \"iataCode\": \"ABC\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"LANZAROTE\",\n      \"iataCode\": \"ACE\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"MALAGA\",\n      \"iataCode\": \"AGP\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ALGHERO\",\n      \"iataCode\": \"AHO\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ALICANTE\",\n      \"iataCode\": \"ALC\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ALGIERS\",\n      \"iataCode\": \"ALG\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"AMMAN\",\n      \"iataCode\": \"AMM\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"AMSTERDAM\",\n      \"iataCode\": \"AMS\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ASUNCION\",\n      \"iataCode\": \"ASU\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"ATHENS\",\n      \"iataCode\": \"ATH\"\n    }\n  ]\n}\n
"},{"location":"resources/flights/#search-for-routes-for-a-specific-airline","title":"Search for routes for a specific airline","text":"

The Airline Routes API shows all destinations for a given airline. To follow up on our previous example, let's check what destinations the British Airways fly to. There's definitely plenty of options, so we can limit the maximum number of results to two for the sake of simplicity. Keep in mind that this limit will apply from the beginning of the results list in the alphabetical order of the city names.

The request will look like this:

curl --request GET \\\n     --header 'Authorization: Bearer <token>' \\\n     --url https://test.api.amadeus.com/v1/airline/destinations?airlineCode=BA&max=2 \\\n

So we can see the the following results:

{\n  \"data\": [\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"Bangalore\",\n      \"iataCode\": \"BLR\"\n    },\n    {\n      \"type\": \"location\",\n      \"subtype\": \"city\",\n      \"name\": \"Paris\",\n      \"iataCode\": \"PAR\"\n    }\n  ],\n  \"meta\": {\n    \"count\": \"2\",\n    \"sort\": \"iataCode\",\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/airline/destinations?airlineCode=BA&max=2\"\n    }\n  }\n}\n
"},{"location":"resources/flights/#look-up-the-airline-icao-code-by-the-iata-code","title":"Look up the airline ICAO code by the IATA code","text":"

If we need to know the IATA code for a particular airline but only have the airline's ICAO code, the Airline Code Lookup API can help us out. Just specify the IATA code in the query and send out the request:

curl --request GET \\\n     --header 'Authorization: Bearer <token>' \\\n     --url https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA \\\n

The response is pretty straightforward:

{\n  \"meta\": {\n    \"count\": 1,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"airline\",\n      \"iataCode\": \"BA\",\n      \"icaoCode\": \"BAW\",\n      \"businessName\": \"BRITISH AIRWAYS\",\n      \"commonName\": \"BRITISH A/W\"\n    }\n  ]\n}\n
"},{"location":"resources/flights/#search-for-flight-and-fare-availability","title":"Search for flight and fare availability","text":"

With the Flight Availabilities Search API you can check the flight and fare availability for any itinerary. This refers to the full inventory of fares available for an itinerary at any given time. The concept of flight availability originated in the early days of flight booking as a way for agents to check what options existed for their travelers\u2019 itineraries.

You can build the request by passing into the body of the POST request an object that you can customise to your needs. An example of such object is provided in the specification of the Flight Availabilities Search API. In addition to this, a X-HTTP-Method-Override header parameter is required.

Here\u2019s an example request for a one-way flight from Mad (MIA) to Atlanta (ATL) for one traveler departing on December 12, 2021:

POST https://test.api.amadeus.com/v1/shopping/availability/flight-availabilities

{\n    \"originDestinations\": [\n        {\n            \"id\": \"1\",\n            \"originLocationCode\": \"MIA\",\n            \"destinationLocationCode\": \"ATL\",\n            \"departureDateTime\": {\n                \"date\": \"2021-11-01\"\n            }\n        }\n    ],\n    \"travelers\": [\n        {\n            \"id\": \"1\",\n            \"travelerType\": \"ADULT\"\n        }\n    ],\n    \"sources\": [\n        \"GDS\"\n    ]\n}\n

The response contains a list of available flights matching our request criteria (for the sake of this example, we only show the first result). Each flight availability includes descriptive data about the flight and an availabilityClasses list containing the available fare classes and the number of bookable seats remaining in each fare class.

\"data\": [\n        {\n            \"type\": \"flight-availability\",\n            \"id\": \"1\",\n            \"originDestinationId\": \"1\",\n            \"source\": \"GDS\",\n            \"instantTicketingRequired\": false,\n            \"paymentCardRequired\": false,\n            \"duration\": \"PT1H54M\",\n            \"segments\": [\n                {\n                    \"id\": \"1\",\n                    \"numberOfStops\": 0,\n                    \"blacklistedInEU\": false,\n                    \"departure\": {\n                        \"iataCode\": \"MIA\",\n                        \"at\": \"2021-11-01T05:30:00\"\n                    },\n                    \"arrival\": {\n                        \"iataCode\": \"ATL\",\n                        \"terminal\": \"S\",\n                        \"at\": \"2022-11-01T07:24:00\"\n                    },\n                    \"carrierCode\": \"DL\",\n                    \"number\": \"2307\",\n                    \"aircraft\": {\n                        \"code\": \"321\"\n                    },\n                    \"operating\": {},\n                    \"availabilityClasses\": [\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"J\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"C\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"D\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"I\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"Z\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"W\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"Y\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"B\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"M\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"H\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"Q\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"K\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"L\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"U\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"T\"\n                        },\n                        {\n                            \"numberOfBookableSeats\": 9,\n                            \"class\": \"E\"\n                        }\n                    ]\n                }\n            ]\n        },\n

Note that airlines\u2019 bookable seat counters goe up to a maximum of 9, even if more seats are available in that fare class. If there are less than 9 bookable seats available, the exact number is displayed.

"},{"location":"resources/flights/#search-branded-fares","title":"Search branded fares","text":"

Branded fares are airfares that bundle tickets with extras, such as checked bags, seat selection, refundability or loyalty points accrual. Each airline defines and packages its own branded fares and they vary from one airline to another. Branded fares not only help build brand recognition and loyalty, but also offer travelers an attractive deal as the incremental cost of the fare is usually less than that of buying the included services \u00e0 la carte.

The Branded Fares Upsell API receives flight offers from the Flight Offers Search API and returns branded fares as flight offers which can be easily passed to the next step in the booking funnel. The booking flow is the following:

  • Search for flights using the Flight Offers Search API.
  • Find branded fare options for a selected flight using the Branded Fares Upsell API.
  • Confirm the fare and get the final price using the Flight Offers Price API.
  • Book the flight using the Flight Create Orders API.

Let's see an example of how to search for branded fares.

You can build the request by passing the flight-offer object from the Flight Offers Search API into the body of the POST request including the mandatory X-HTTP-Method-Override header parameter:

POST https://test.api.amadeus.com/v1/shopping/flight-offers/upselling\n

Please not that the X-HTTP-Method-Override header parameter is required to make this call.

{ \n  \"data\": { \n    \"type\": \"flight-offers-upselling\", \n    \"flightOffers\": [ \n      {\n            \"type\": \"flight-offer\",\n            \"id\": \"1\",\n            \"source\": \"GDS\",\n            \"instantTicketingRequired\": false,\n            \"nonHomogeneous\": false,\n            \"oneWay\": false,\n            \"lastTicketingDate\": \"2022-06-12\",\n            \"numberOfBookableSeats\": 3,\n            \"itineraries\": [\n                {\n                    \"duration\": \"PT6H10M\",\n                    \"segments\": [\n                        {\n                            \"departure\": {\n                                \"iataCode\": \"MAD\",\n                                \"terminal\": \"1\",\n                                \"at\": \"2022-06-22T17:40:00\"\n                            },\n                            \"arrival\": {\n                                \"iataCode\": \"FCO\",\n                                \"terminal\": \"1\",\n                                \"at\": \"2022-06-22T20:05:00\"\n                            },\n                            \"carrierCode\": \"AZ\",\n                            \"number\": \"63\",\n                            \"aircraft\": {\n                                \"code\": \"32S\"\n                            },\n                            \"operating\": {\n                                \"carrierCode\": \"AZ\"\n                            },\n                            \"duration\": \"PT2H25M\",\n                            \"id\": \"13\",\n                            \"numberOfStops\": 0,\n                            \"blacklistedInEU\": false\n                        },\n                        {\n                            \"departure\": {\n                                \"iataCode\": \"FCO\",\n                                \"terminal\": \"1\",\n                                \"at\": \"2022-06-22T21:50:00\"\n                            },\n                            \"arrival\": {\n                                \"iataCode\": \"ATH\",\n                                \"at\": \"2022-06-23T00:50:00\"\n                            },\n                            \"carrierCode\": \"AZ\",\n                            \"number\": \"722\",\n                            \"aircraft\": {\n                                \"code\": \"32S\"\n                            },\n                            \"operating\": {\n                                \"carrierCode\": \"AZ\"\n                            },\n                            \"duration\": \"PT2H\",\n                            \"id\": \"14\",\n                            \"numberOfStops\": 0,\n                            \"blacklistedInEU\": false\n                        }\n                    ]\n                }\n            ],\n            \"price\": {\n                \"currency\": \"EUR\",\n                \"total\": \"81.95\",\n                \"base\": \"18.00\",\n                \"fees\": [\n                    {\n                        \"amount\": \"0.00\",\n                        \"type\": \"SUPPLIER\"\n                    },\n                    {\n                        \"amount\": \"0.00\",\n                        \"type\": \"TICKETING\"\n                    }\n                ],\n                \"grandTotal\": \"81.95\",\n                \"additionalServices\": [\n                    {\n                        \"amount\": \"45.00\",\n                        \"type\": \"CHECKED_BAGS\"\n                    }\n                ]\n            },\n            \"pricingOptions\": {\n                \"fareType\": [\n                    \"PUBLISHED\"\n                ],\n                \"includedCheckedBagsOnly\": false\n            },\n            \"validatingAirlineCodes\": [\n                \"AZ\"\n            ],\n            \"travelerPricings\": [\n                {\n                    \"travelerId\": \"1\",\n                    \"fareOption\": \"STANDARD\",\n                    \"travelerType\": \"ADULT\",\n                    \"price\": {\n                        \"currency\": \"EUR\",\n                        \"total\": \"81.95\",\n                        \"base\": \"18.00\"\n                    },\n                    \"fareDetailsBySegment\": [\n                        {\n                            \"segmentId\": \"13\",\n                            \"cabin\": \"ECONOMY\",\n                            \"fareBasis\": \"OOLGEU1\",\n                            \"class\": \"O\",\n                            \"includedCheckedBags\": {\n                                \"quantity\": 0\n                            }\n                        },\n                        {\n                            \"segmentId\": \"14\",\n                            \"cabin\": \"ECONOMY\",\n                            \"fareBasis\": \"OOLGEU1\",\n                            \"brandedFare\": \"ECOLIGHT\",\n                            \"class\": \"O\",\n                            \"includedCheckedBags\": {\n                                \"quantity\": 0\n                            }\n                        }\n                    ]\n                }\n            ]\n        } \n    ]\n  } \n}  \n

The API will procide the following JSON in the response:

{\n    \"meta\": {\n        \"count\": 5\n    },\n    \"data\": [{\n                \"type\": \"flight-offer\",\n                \"id\": \"2\",\n                \"source\": \"GDS\",\n                \"instantTicketingRequired\": false,\n                \"paymentCardRequired\": false,\n                \"lastTicketingDate\": \"2022-11-30\",\n                \"itineraries\": [{\n                    \"segments\": [{\n                        \"departure\": {\n                            \"iataCode\": \"MAD\",\n                            \"terminal\": \"2\",\n                            \"at\": \"2022-12-01T07:10:00\"\n                        },\n                        \"arrival\": {\n                            \"iataCode\": \"ORY\",\n                            \"at\": \"2022-12-01T09:05:00\"\n                        },\n                        \"carrierCode\": \"UX\",\n                        \"number\": \"1027\",\n                        \"aircraft\": {\n                            \"code\": \"333\"\n                        },\n                        \"operating\": {\n                            \"carrierCode\": \"UX\"\n                        },\n                        \"duration\": \"PT1H55M\",\n                        \"id\": \"7\",\n                        \"numberOfStops\": 0,\n                        \"blacklistedInEU\": false\n                    }]\n                }],\n                \"price\": {\n                    \"currency\": \"EUR\",\n                    \"total\": \"228.38\",\n                    \"base\": \"210.00\",\n                    \"fees\": [{\n                        \"amount\": \"0.00\",\n                        \"type\": \"TICKETING\"\n                    }],\n                    \"grandTotal\": \"228.38\"\n                },\n                \"pricingOptions\": {\n                    \"fareType\": [\n                        \"PUBLISHED\"\n                    ],\n                    \"includedCheckedBagsOnly\": false,\n                    \"refundableFare\": false,\n                    \"noRestrictionFare\": false,\n                    \"noPenaltyFare\": false\n                },\n                \"validatingAirlineCodes\": [\n                    \"UX\"\n                ],\n                \"travelerPricings\": [{\n                            \"travelerId\": \"1\",\n                            \"fareOption\": \"STANDARD\",\n                            \"travelerType\": \"ADULT\",\n                            \"price\": {\n                                \"currency\": \"EUR\",\n                                \"total\": \"228.38\",\n                                \"base\": \"210.00\",\n                                \"taxes\": [{\n                                        \"amount\": \"3.27\",\n                                        \"code\": \"QV\"\n                                    },\n                                    {\n                                        \"amount\": \"0.63\",\n                                        \"code\": \"OG\"\n                                    },\n                                    {\n                                        \"amount\": \"14.48\",\n                                        \"code\": \"JD\"\n                                    }\n                                ]\n                            },\n                            \"fareDetailsBySegment\": [{\n                                \"segmentId\": \"7\",\n                                \"cabin\": \"ECONOMY\",\n                                \"fareBasis\": \"KYYO5L\",\n                                \"brandedFare\": \"LITE\",\n                                \"class\": \"K\",\n                                \"includedCheckedBags\": {\n                                    \"quantity\": 0\n                                },\n                                \"amenities\": [{\n                                        \"code\": \"0L5\",\n                                        \"description\": \"CARRY ON HAND BAGGAGE\",\n                                        \"isChargeable\": false,\n                                        \"amenityType\": \"BAGGAGE\"\n                                    },\n                                    {\n                                        \"code\": \"0CC\",\n                                        \"description\": \"FIRST PREPAID BAG\",\n                                        \"isChargeable\": true,\n                                        \"amenityType\": \"BAGGAGE\"\n                                    },\n                                    {\n                                        \"code\": \"0GO\",\n                                        \"description\": \"PREPAID BAG\",\n                                        \"isChargeable\": true,\n                                        \"amenityType\": \"BAGGAGE\"\n                                    },\n                                    {\n                                        \"code\": \"059\",\n                                        \"description\": \"CHANGEABLE TICKET\",\n                                        \"isChargeable\": true,\n                                        \"amenityType\": \"BRANDED_FARES\"\n                                    },\n                                    {\n                                        \"code\": \"0B5\",\n                                        \"description\": \"PRE RESERVED SEAT ASSIGNMENT\",\n                                        \"isChargeable\": true,\n                                        \"amenityType\": \"PRE_RESERVED_SEAT\"\n                                    },\n                                    {\n                                        \"code\": \"0G6\",\n                                        \"description\": \"PRIORITY BOARDING\",\n                                        \"isChargeable\": true,\n                                        \"amenityType\": \"TRAVEL_SERVICES\"\n                                    }\n                                ]\n                            }],\n                            \"dictionaries\": {\n                                \"locations\": {\n                                    \"MAD\": {\n                                        \"cityCode\": \"MAD\",\n                                        \"countryCode\": \"ES\"\n                                    },\n                                    \"ORY\": {\n                                        \"cityCode\": \"PAR\",\n                                        \"countryCode\": \"FR\"\n                                    }\n                                }\n                            }\n                        }\n

You can also see the process step to step How to upsell with branded fares in this video tutorial from Advanced flight booking engine series.

"},{"location":"resources/flights/#search-for-personalized-destination-recommendations","title":"Search for personalized destination recommendations","text":"

The Travel Recommendations API provides personalized destinations based on the traveler's location and an input destination, such as a previously searched flight destination or city of interest.

For example, for a traveler based in San Francisco who has searched for multiple flights to Barcelona, what other similar destinations the API could recommend? The API takes as input the country of the traveler and the IATA code of the city that was searched, in our case this will be US and BCN respectively.

GET https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=BCN&travelerCountryCode=US

The response will look like this:

{\n     \"type\": \"flight-date\",\n     \"origin\": \"SFO\",\n     \"destination\": \"ROM\",\n     \"departureDate\": \"2021-09-19\",\n     \"returnDate\": \"2021-09-23\",\n     \"price\": {\n         \"total\": \"348.75\"\n     },\n     \"links\": {\n         \"flightDestinations\": \"https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=SFO&departureDate=2021-04-15,2021-10-11&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION\",\n         \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=SFO&destinationLocationCode=ROM&departureDate=2021-09-19&returnDate=2021-09-23&adults=1&nonStop=false\"\n     }\n }\n

The only required parameter for the Travel Recommendations API is the city code. So, the API is capable of suggesting flight based on that input alone:

https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=PAR\n

You can also narrow the query down by using the destinationCountryCodes parameter, which supports one or more IATA country codes, separated by a comma:

https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=PAR&destinationCountryCodes=US\n

To expand the example of the San Francisco-based traveler searching for multiple flights to Barcelona, we can specify the destination country as well:

https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=BCN&travelerCountryCode=US&destinationCountryCodes=ES\n

If you want to take it to the next level, you can call the Flight Cheapest Date Search API to let the users know not only the recommended destinations but also what are the cheapest dates to visit any of these cities. For real-time flights, you can also call the Flight Offers Search API. The Travel Recommendations API has returned links to both APIs.

"},{"location":"resources/flights/#search-for-recommended-nearby-destinations","title":"Search for recommended nearby destinations","text":"

With the Airport Nearest Relevant API you can find the closest major airports to a starting point. By default, results are sorted by relevance but they can also be sorted by distance, flights, travelers using the parameter sort.

Information

To get the latitude and longitude of a city you can use the Airport & City Search API using the city's IATA code.

Let's call the Airport Nearest Relevant API to find airports within the 500km radius of Madrid.

GET https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=40.416775&longitude=-3.703790&radius=500

A part of the response looks like:

        {\n            \"type\": \"location\",\n            \"subType\": \"AIRPORT\",\n            \"name\": \"AIRPORT\",\n            \"detailedName\": \"BARCELONA/ES:AIRPORT\",\n            \"timeZoneOffset\": \"+02:00\",\n            \"iataCode\": \"BCN\",\n            \"geoCode\": {\n                \"latitude\": 41.29694,\n                \"longitude\": 2.07833\n            },\n            \"address\": {\n                \"cityName\": \"BARCELONA\",\n                \"cityCode\": \"BCN\",\n                \"countryName\": \"SPAIN\",\n                \"countryCode\": \"ES\",\n                \"regionCode\": \"EUROP\"\n            },\n            \"distance\": {\n                \"value\": 496,\n                \"unit\": \"KM\"\n            },\n            \"analytics\": {\n                \"flights\": {\n                    \"score\": 25\n                },\n                \"travelers\": {\n                    \"score\": 25\n                }\n            },\n            \"relevance\": 5.11921\n        }\n
What we want to do at this point, is to find the cheapest dates for all these destinations.

We can do this by calling the Flight Cheapest Date Search API which finds the cheapest dates to travel from one city to another. Let's see, for example, the cheapest dates to fly to Barcelona in November 2021.

GET https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=BCN&departureDate=2021-05-01,2021-05-30

{\n    \"type\": \"flight-date\",\n    \"origin\": \"MAD\",\n    \"destination\": \"BCN\",\n    \"departureDate\": \"2021-05-29\",\n    \"returnDate\": \"2021-06-11\",\n    \"price\": {\n        \"total\": \"73.61\"\n    },\n    \"links\": {\n        \"flightDestinations\": \"https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION\",\n        \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2022-09-29&returnDate=2021-06-11&adults=1&nonStop=false\"\n    },\n{\n    \"type\": \"flight-date\",\n    \"origin\": \"MAD\",\n    \"destination\": \"BCN\",\n    \"departureDate\": \"2021-05-05\",\n    \"returnDate\": \"2021-05-06\",\n    \"price\": {\n        \"total\": \"79.67\"\n    },\n    \"links\": {\n        \"flightDestinations\": \"https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION\",\n        \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-05&returnDate=2021-05-06&adults=1&nonStop=false\"\n    }\n},\n{\n    \"type\": \"flight-date\",\n    \"origin\": \"MAD\",\n    \"destination\": \"BCN\",\n    \"departureDate\": \"2021-05-02\",\n    \"returnDate\": \"2021-05-06\",\n    \"price\": {\n        \"total\": \"80.61\"\n    },\n    \"links\": {\n        \"flightDestinations\": \"https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD&departureDate=2021-05-01,2021-05-30&oneWay=false&duration=1,15&nonStop=false&viewBy=DURATION\",\n        \"flightOffers\": \"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-02&returnDate=2021-05-06&adults=1&nonStop=false\"\n    }\n}\n
As you can see above, in the results we have a list of dates for a roundtrip from Madrid to Barcelona ordered by the lowest price.

In the last step, we want to let the traveler perform a flight search for any of the above dates that are convenient for them. That is very easy with our APIs, as the Flight Cheapest Date Search API for each result contains a link to the Flight Offers Search API. For example, if we want to perform a flight search for the first result, we only have to take the link provided and make an API call:

GET https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=BCN&departureDate=2021-05-29&returnDate=2021-06-11&adults=1&nonStop=false

"},{"location":"resources/flights/#search-for-a-city-that-has-an-airport","title":"Search for a city that has an airport","text":"

The Airport & City Search API finds airports and cities that match a specific word or a string of letters. Using this API, you can automatically suggest airports based on what the traveler enters in the search field. The API provides a list of airports/cities ordered by yearly passenger volume with the name, 3-letter IATA code, time zone and coordinates of each airport.

Information

Please keep in mind that Airport & City Search API only returns the cities which have an airport. If you want to retrieve any city that matches a search keyword, check out City Search API.

The Airport & City Search API has two endpoints:

You can see the process step to step in this video tutorial.

  • GET \u200b/reference-data\u200b/locations to return a list of airports and cities by a keyword
  • GET \u200b/reference-data\u200b/locations//reference-data/locations/{locationId} to return an airport or city by Id

To get a list of airports and cities by a keyword, we need to two mandatory query parameters:

  • subType - this defines whether we are looking for an airport or a city
  • keyword - this defines the keyword (or a part of it) used in our search, which can be any character in the range of A-Za-z0-9./:-'()\"

Here is a basic query to look for any airport whose name starts with a letter M:

https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M\n

To narrow the search down, we can use an optional parameter countryCode, which is a location code in the ISO 3166-1 alpha-2 format:

https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US\n

The Airport & City Search API supports pagination and dynamic sorting. The dynamic sorting enables you to sort by the results by the number of travelers by airport or city where the airports and cities with the highest traffic will be on top of the list:

https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US&sort=analytics.travelers.score\n

In addition to that, we can select how detailed the response will be. This is done by the optional view parameter, which can be:

  • LIGHT - to only show the iataCode, name, detailedName, cityName and countryName
  • FULL - to add on top of the LIGHT information the timeZoneOffset, geoCode, detailed address and travelers.score

The default option is FULL:

https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT&keyword=M&countryCode=US&sort=analytics.travelers.score&view=FULL\n

To search an airport or city by Id, we need to obtain the Id by using the GET \u200b/reference-data\u200b/locations endpoint. For example:

{\n  \"meta\": {\n    \"count\": 2,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/reference-data/locations?subType=CITY,AIRPORT&keyword=MUC&countryCode=DE\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"location\",\n      \"subType\": \"CITY\",\n      \"name\": \"MUNICH INTERNATIONAL\",\n      \"detailedName\": \"MUNICH/DE:MUNICH INTERNATIONAL\",\n      \"id\": \"CMUC\",\n      \"self\": {\n        \"href\": \"https://test.api.amadeus.com/v1/reference-data/locations/CMUC\",\n        \"methods\": [\n          \"GET\"\n        ]\n      },\n      \"timeZoneOffset\": \"+02:00\",\n      \"iataCode\": \"MUC\",\n      \"geoCode\": {\n        \"latitude\": 48.35378,\n        \"longitude\": 11.78609\n      },\n      \"address\": {\n        \"cityName\": \"MUNICH\",\n        \"cityCode\": \"MUC\",\n        \"countryName\": \"GERMANY\",\n        \"countryCode\": \"DE\",\n        \"regionCode\": \"EUROP\"\n      },\n      \"analytics\": {\n        \"travelers\": {\n          \"score\": 27\n        }\n      }\n    },\n    {\n      \"type\": \"location\",\n      \"subType\": \"AIRPORT\",\n      \"name\": \"MUNICH INTERNATIONAL\",\n      \"detailedName\": \"MUNICH/DE:MUNICH INTERNATIONAL\",\n      \"id\": \"AMUC\",\n      \"self\": {\n        \"href\": \"https://test.api.amadeus.com/v1/reference-data/locations/AMUC\",\n        \"methods\": [\n          \"GET\"\n        ]\n      },\n      \"timeZoneOffset\": \"+02:00\",\n      \"iataCode\": \"MUC\",\n      \"geoCode\": {\n        \"latitude\": 48.35378,\n        \"longitude\": 11.78609\n      },\n      \"address\": {\n        \"cityName\": \"MUNICH\",\n        \"cityCode\": \"MUC\",\n        \"countryName\": \"GERMANY\",\n        \"countryCode\": \"DE\",\n        \"regionCode\": \"EUROP\"\n      },\n      \"analytics\": {\n        \"travelers\": {\n          \"score\": 27\n        }\n      }\n    }\n  ]\n}\n

The Id for the city of Munich is CMUC. However, for the Munich Airport the Id will be AMUC. Once we know this Id, we can use it to call the GET \u200b/reference-data\u200b/locations//reference-data/locations/{locationId}, as it is the only parameter that the query requires:

GET https://test.api.amadeus.com/v1/reference-data/locations/CMUC\n
"},{"location":"resources/flights/#compare-the-flight-price-to-historical-fares","title":"Compare the flight price to historical fares","text":"

When booking a flight, travelers need to be confident that they're getting a good deal. You can compare a flight price to historical fares for the same flight route using the Flight Price Analysis API. It uses an Artificial Intelligence algorithm trained on Amadeus historical flight booking data to show how current flight prices compare to historical fares and whether the price of a flight is below or above average.

The only mandatory parameters for this search are the origin airport IATA code, destination airport IATA code and the departure date in the ISO 8601 YYYY-MM-DD format.

Let's see how it works. In our example we will be flying from Madrid (MAD) to Paris (CDG) on 12 December 2022:

https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2022-12-12\n

This is what we get in the response:

{\n  \"warnings\": [],\n  \"data\": [\n    {\n      \"type\": \"itinerary-price-metric\",\n      \"origin\": {\n        \"iataCode\": \"MAD\"\n      },\n      \"destination\": {\n        \"iataCode\": \"CDG\"\n      },\n      \"departureDate\": \"2022-12-12\",\n      \"transportType\": \"FLIGHT\",\n      \"currencyCode\": \"EUR\",\n      \"oneWay\": true,\n      \"priceMetrics\": [\n        {\n          \"amount\": \"29.59\",\n          \"quartileRanking\": \"MINIMUM\"\n        },\n        {\n          \"amount\": \"76.17\",\n          \"quartileRanking\": \"FIRST\"\n        },\n        {\n          \"amount\": \"129.24\",\n          \"quartileRanking\": \"MEDIUM\"\n        },\n        {\n          \"amount\": \"185.59\",\n          \"quartileRanking\": \"THIRD\"\n        },\n        {\n          \"amount\": \"198.15\",\n          \"quartileRanking\": \"MAXIMUM\"\n        }\n      ]\n    }\n  ],\n  \"meta\": {\n    \"count\": 1,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/analytics/flight-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2022-12-12&currencyCode=EUR&oneWay=True\"\n    }\n  }\n}\n

By default the price will be shown in Euros. In this example we can see that the lowest price for such ticket should be 29.59 Euros and the highest 198.15 Euros. The first, medium and trird choices give you an idea about the possible price ranges for this flight.

We also have an option to request the result in a different currency. This is done by using the currencyCode parameter, which is an ISO 4217 format currency code. In addition, we can specify whether we are inquiring about a round trip or a one way ticket.

GET https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2021-03-21&currencyCode=EUR&oneWay=true\n
"},{"location":"resources/flights/#confirm-fares","title":"Confirm Fares","text":"

The availability and price of airfare fluctuate, so it\u2019s important to confirm before proceeding to book. This is especially true if time passes between the initial search and the decision to book, as fares are limited and there are thousands of bookings occurring every minute. During this step, you can also add ancillary products like extra bags or legroom. For that you can use the Flight Offers Price API.

Once a flight has been selected, you\u2019ll need to confirm the availability and price of the fare. This is where the Flight Offers Price API comes in. This API returns the final fare price (including taxes and fees) of flights from the Flight Offers Search as well as pricing for ancillary products and the payment information that will be needed to make the final booking.

The body to be sent via POST is built by a new object of type flight-offers-pricing composed by a list of flight-offers (up to 6) + payment information. In addition to this, a X-HTTP-Method-Override header parameter is required.

{\n   \"data\": {\n        \"type\": \"flight-offers-princing\",\n        \"flightOffers\": [\n            { \"type\": \"flight-offer\" }\n        ],\n        \"payment\" : [\n            { Payment_Object }\n        ]\n    }\n
"},{"location":"resources/flights/#return-fare-rules","title":"Return fare rules","text":"

The Flight Offers Price API confirms the final price and availability of a fare. It also returns detailed fare rules, including the cancellation policy and other information. In addition to this, a X-HTTP-Method-Override header parameter is required. To get the fare rules, add the parameter include=detailed-fare-rules to your API call, as shown below:

POST https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules\n

The FareRules object represents a collection of fare rules and penalties associated with a specific fare. Each rule is represented as a TermAndCondition object, containing information about the rule category, circumstances, applicability, maximum penalty amount, and detailed descriptions.

  • FareRules:

    • currency: The currency in which the penalties are expressed.
    • rules: An array of TermAndCondition objects, each representing a specific fare rule or condition.
  • TermAndCondition:

    • category: A string defining the type of modification concerned in the rule, such as REFUND, EXCHANGE, REVALIDATION, REISSUE, REBOOK, or CANCELLATION.
    • circumstances: A string providing additional information on the circumstances under which the rule applies.
    • notApplicable: A boolean indicating if the rule does not apply to the fare.
    • maxPenaltyAmount: A string representing the maximum penalty amount for the given rule.
    • descriptions: An array of Description objects that provide further details on the rule. Each Description object includes:
      • descriptionType: A string representing the type of description.
      • text: The actual text of the description, providing more context or explanation for the rule.

You can also see the process step to step How to display farerules in this video tutorial from Advanced flight booking engine series.

"},{"location":"resources/flights/#book-a-flight","title":"Book a Flight","text":"

Once the fare is confirmed, you\u2019re ready to use the Flight Create Orders API to perform the actual booking. This API lets you log a reservation in the airlines\u2019 systems and create a PNR, and returns a unique Id number and the reservation details. If you\u2019re using an airline consolidator, the PNR will be automatically sent to the consolidator for ticket issuance. Visit the Flight Create Orders documentation page for more details on this API.

Remember, you need to be able to issue a ticket to make bookings with our Flight Create Orders API. To access the API in production, you need to either sign a contract with an airline consolidator or be accredited to issue tickets yourself.

"},{"location":"resources/flights/#issue-a-ticket","title":"Issue a ticket","text":"

Once the booking is made, you need to complete payment. In most cases, you\u2019ll receive payment from the customer and then pay the airline, typically via an industry-specific settlement procedure like the BSP or ARC (more on those later).

In the final step, a flight ticket is issued. In industry terms, a flight ticket is a confirmation that payment has been received, the reservation has been logged, and the customer has the right to enjoy the flight. For IATA member airlines, only certain accredited parties can issue tickets. In the next section, we\u2019ll go into detail about your options for managing this final step in the booking process.

You can see How to manage and issue flight booking process in this video tutorial from Flight Booking Engine 101 series.

If you are interested in knowing more about issuing tickets in travel industry, please check out this article.

"},{"location":"resources/flights/#view-the-aircraft-cabin-layout","title":"View the aircraft cabin layout","text":"

With the Seatmap Display API you can view the aircraft cabin layout:

  • deckConfiguration - the dimensions of the passenger deck in (x,y) coordinates, including the location of the wings, exit rows, and cabins. These dimensions form a grid on which you will later place facilities and seats.
  • facilities - the (x,y) coordinates of aircraft facilities, such as bathrooms or galleys.
  • seats - the (x,y) coordinates of all seats on the aircraft, with their respective availability status, characteristics, and prices.

To help you build a more consistent display, the API returns a uniform width for all cabins and classes. Rows with special seating like business class or extra-legroom seats have fewer seats per row (e.g., 4 seats for width of 7 coordinates) than economy rows (e.g. 7 seats for a width of 7 coordinates).

You can see the more details about the aircraft cabin layout in the video below.

"},{"location":"resources/flights/#display-in-flight-amenities","title":"Display in-flight amenities","text":"

Both endpoints of the Seatmap Display API return information about the following in-flight amenities:

  • Seat
  • Wi-fi
  • Entertainment
  • Power
  • Food
  • Beverage
"},{"location":"resources/flights/#select-a-seat","title":"Select a seat","text":"

Requests to either endpoint of the Seatmap Display API will return a list of seating options with their characteristics, pricing, and coordinates. Let's look at an example response:

{\n                \"cabin\": \"M\",\n                \"number\": \"20D\",\n                \"characteristicsCodes\": [\n                  \"A\",\n                  \"CH\",\n                  \"RS\"\n                ],\n                \"travelerPricing\": [\n                  {\n                    \"travelerId\": \"1\",\n                    \"seatAvailabilityStatus\": \"AVAILABLE\",\n                    \"price\": {\n                      \"currency\": \"EUR\",\n                      \"total\": \"17.00\",\n                      \"base\": \"17.00\",\n                      \"taxes\": [\n                        {\n                          \"amount\": \"0.00\",\n                          \"code\": \"SUPPLIER\"\n                        }\n                      ]\n                    }\n                  }\n                ],\n                \"coordinates\": {\n                  \"x\": 10,\n                  \"y\": 4\n                }\n              },\n

For each seat, the Seatmap Display API provides a seatAvailabilityStatus so you can indicate which seats are currently available for booking. Seats may have one of three\u202favailability statuses:

  • AVAILABLE\u202f\u2013 the seat is\u202fnot occupied\u202fand\u202fis\u202favailable to book.
  • BLOCKED\u202f\u2013\u202fthe seat is not occupied but isn\u2019t\u202favailable to book for the user. This is usually due to the passenger type (e.g., children may not sit in exit rows) or their fare class (e.g., some seats may be reserved for flyers in higher classes).
  • OCCUPIED\u202f\u2013 the seat is\u202f occupied\u202fand\u202funavailable to book.

If a flight is fully booked, the API returns an OCCUPIED status for all seats. In most cases, fully booked flights are filtered\u202fout during search with\u202fthe Flight Offers Search API\u202for when confirming the price with\u202fthe Flight Offers Price API.\u202fThe Flight Create Orders API returns an error message if you try to book an unavailable seat. For more information on the booking flow, check out how to build a flight booking engine.

Once your user has selected their seat, the next step is to add the desired seat to the flight offer and prepare them for booking.

In the above\u202fexample\u202fresponse,\u202fseat\u202f20D is indicated as AVAILABLE. For your user to be able to book the seat, you must\u202fadd the seat to the flightOffer object and call Flight Offers Price\u202fto\u202fget a final order summary with the included seat.

To include the seat in the flightOffer object, add it to\u202ffareDetailsBySegment \u2192 additionalServices \u2192 chargeableSeatNumber, as shown below:

\"fareDetailsBySegment\": [\n            {\n            \"additionalServices\": {\n             \"chargeableSeatNumber\": \"20D\"\n              },\n              \"segmentId\": \"60\",\n              \"cabin\": \"ECONOMY\",\n              \"fareBasis\": \"NLYO5L\",\n              \"brandedFare\": \"LITE\",\n              \"class\": \"N\",\n              \"includedCheckedBags\": {\n                \"quantity\": 0\n              }\n            }\n          ]\n

The Flight Offers Price API then returns the flightOffer object with the price of the chosen seat included within additionalServices:

\"additionalServices\":\n            {\n              \"type\": \"SEATS\",\n              \"amount\": \"17.00\"\n            }\n

You can use the same process to select seats for multiple passengers.\u202fFor each passenger, you must add the selected seats\u202fin\u202ffareDetailsBySegment\u202ffor each travelerId within the\u202fflight offer.

At this point, you now have a priced flightOffer which includes your user's selected seat. The final step is to book the flight using the Flight Create Orders API. To do this, simply pass the flightOffer object into\u202fa request to the Flight Create Orders API, which will book the flight and return an order summary and a booking Id.

"},{"location":"resources/flights/#add-additional-baggage","title":"Add additional baggage","text":""},{"location":"resources/flights/#search-additional-baggage-options","title":"Search additional baggage options","text":"

The first step is to find the desired flight offer using the Flight Offers Search API. Each flight offer contains an additionalServices field with the types of additional services available, in this case bags, and the maximum price of the first additional bag. Note that at this point, the price is for informational purposes only.

To get the final price of the added baggage with the airline policy and the traveler's tier level taken into account, you must call the Flight Offers Price API. To do this, add the include=bags parameter in the path of the Flight Offers Price API:

POST https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=bags \n

As you see below, the API returns the catalog of baggage options with the price and quantity (or weight):

\"bags\": { \n    \"1\": { \n        \"quantity\": 1, \n        \"name\": \"CHECKED_BAG\", \n        \"price\": { \n            \"amount\": \"25.00\", \n            \"currencyCode\": \"EUR\" \n        }, \n        \"bookableByItinerary\": true, \n        \"segmentIds\": [ \n            \"1\", \n            \"14\" \n        ], \n        \"travelerIds\": [ \n            \"1\" \n        ] \n    } \n    \"2\": {  \n        \"quantity\": 2, \n        \"name\": \"CHECKED_BAG\", \n        \"price\": { \n            \"amount\": \"50.00\", \n            \"currencyCode\": \"EUR\" \n        }, \n        \"bookableByItinerary\": true, \n        \"segmentIds\": [ \n            \"1\", \n            \"14\" \n        ], \n        \"travelerIds\": [ \n            \"1\" \n        ] \n    } \n} \n

The Flight Offers Price API returns two bag offers for the given flight. The catalog shows that either one or two bags are available to be booked per passenger. Higher bag quantity will be rejected due to the airline's policy.

In the example above, the price of two bags is double that of one bag, though some airlines do offer discounts for purchasing more than one checked bag. Each bag offer is coupled to the specific segment and traveler Id returned in each bag offer.

If there is no extra baggage service available, the API won\u2019t return a baggage catalog.

"},{"location":"resources/flights/#add-additional-baggage-to-the-flight-offer","title":"Add additional baggage to the flight offer","text":"

Next, you need to add the additional baggage to the desired flight segments. This gives you the flexibility to include extra bags on only certain segments of the flight.

Fill in chargeableCheckedBags with the desired quantity (or weight, depending on what the airline returns) in travelerPricings/fareDetailsBySegment/additionalServices, as shown below:

\"fareDetailsBySegment\": [{ \n    \"segmentId\": \"1\", \n    \"cabin\": \"ECONOMY\", \n    \"fareBasis\": \"TNOBAGD\", \n    \"brandedFare\": \"GOLIGHT\", \n    \"class\": \"T\", \n    \"includedCheckedBags\": { \n        \"quantity\": 0 \n    }, \n    \"additionalServices\": { \n        \"chargeableCheckedBags\": { \n            \"quantity\": 1 \n        } \n    } \n}] \n
"},{"location":"resources/flights/#confirm-the-final-price-and-book","title":"Confirm the final price and book","text":"

Once you\u2019ve added the desired bags to the flight order, you need to call the Flight Offers Price API to get the final price of the flight with all additional services included. Once this is done, you can then call the Flight Create Orders API to book the flight. If you want to add different numbers of bags for different itineraries, you can do it following the same flow.

If the desired flight you want to book, does not permit the additional service, the Flight Create Orders API will reject the booking and return the following error:

{ \n    \"errors\": [{ \n        \"status\": 400, \n        \"code\": 38034, \n        \"title\": \"ONE OR MORE SERVICES ARE NOT AVAILABLE\", \n        \"detail\": \"Error booking additional services\" \n    }] \n} \n
You can see the process step to step in this video tutorial.

"},{"location":"resources/flights/#video-tutorial","title":"Video Tutorial","text":"

You can also see the process step to step How to add additional baggages in this video tutorial from Advanced flight booking engine series.

"},{"location":"resources/flights/#check-the-flight-status","title":"Check the flight status","text":"

The On-Demand Flight Status API provides real-time flight schedule data including up-to-date departure and arrival times, terminal and gate information, flight duration and real-time delay status.

To get this information, the only mandatory parameters to send a query are the IATA carrier code, flight number and scheduled departure date, and you'll be up to date about your flight schedule. For example, checking the Iberia flight 532 on 23 March 2022:

https://test.api.amadeus.com/v2/schedule/flights?carrierCode=IB&flightNumber=532&scheduledDepartureDate=2022-03-23\n

If the flight changes and the carrier assigns a prefix to the flight number to indicate the change, you can specify it in the query using the additional one-letter operationalSuffix parameter:

https://test.api.amadeus.com/v2/schedule/flights?carrierCode=IB&flightNumber=532&scheduledDepartureDate=2021-03-23&operationalSuffix=A\n

The example response looks as follows:

{\n  \"meta\": {\n    \"count\": 1,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v2/schedule/flights?carrierCode=AZ&flightNumber=319&scheduledDepartureDate=2021-03-13\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"DatedFlight\",\n      \"scheduledDepartureDate\": \"2021-03-13\",\n      \"flightDesignator\": {\n        \"carrierCode\": \"AZ\",\n        \"flightNumber\": 319\n      },\n      \"flightPoints\": [\n        {\n          \"iataCode\": \"CDG\",\n          \"departure\": {\n            \"timings\": [\n              {\n                \"qualifier\": \"STD\",\n                \"value\": \"2021-03-13T11:10+01:00\"\n              }\n            ]\n          }\n        },\n        {\n          \"iataCode\": \"FCO\",\n          \"arrival\": {\n            \"timings\": [\n              {\n                \"qualifier\": \"STA\",\n                \"value\": \"2021-03-13T13:15+01:00\"\n              }\n            ]\n          }\n        }\n      ],\n      \"segments\": [\n        {\n          \"boardPointIataCode\": \"CDG\",\n          \"offPointIataCode\": \"FCO\",\n          \"scheduledSegmentDuration\": \"PT2H5M\"\n        }\n      ],\n      \"legs\": [\n        {\n          \"boardPointIataCode\": \"CDG\",\n          \"offPointIataCode\": \"FCO\",\n          \"aircraftEquipment\": {\n            \"aircraftType\": \"32S\"\n          },\n          \"scheduledLegDuration\": \"PT2H5M\"\n        }\n      ]\n    }\n  ]\n}\n
"},{"location":"resources/flights/#check-for-any-flight-delays","title":"Check for any flight delays","text":"

For any traveller it's quite important to know how far in advance they should get to the airport. The Flight Delay Prediction API estimates the probability of a specific flight being delayed.

The query consists of ten mandatory parameters:

  • originLocationCode - IATA code of the city or airport from which the traveler is departing, e.g. PAR for Paris
  • destinationLocationCode - IATA code of the city or airport to which the traveler is going, e.g. PAR for Paris
  • departureDate - the date on which the traveler will depart from the origin to go to the destination in the ISO 8601 YYYY-MM-DD format, e.g. 2019-12-25
  • departureTime - local time relative to originLocationCode on which the traveler will depart from the origin in the ISO 8601 format, e.g. 13:22:00
  • arrivalDate - the date on which the traveler will arrive to the destination from the origin in the ISO 8601 in the YYYY-MM-DD format, e.g. 2019-12-25
  • arrivalTime - local time relative to destinationLocationCode on which the traveler will arrive to destination in the ISO 8601 standard. e.g. 13:22:00
  • aircraftCode - IATA aircraft code
  • carrierCode - airline / carrier code, e.g. TK
  • flightNumber - flight number as assigned by the carrier, e.g. 1816
  • duration - flight duration in the ISO 8601 PnYnMnDTnHnMnS format, e.g. PT2H10M
GET https://test.api.amadeus.com/v1/travel/predictions/flight-delay?originLocationCode=NCE&destinationLocationCode=IST&departureDate=2020-08-01&departureTime=18%3A20%3A00&arrivalDate=2020-08-01&arrivalTime=22%3A15%3A00&aircraftCode=321&carrierCode=TK&flightNumber=1816&duration=PT31H10M\n

The response result will look as follows:

{\n  \"data\": [\n    {\n      \"id\": \"TK1816NCEIST20200801\",\n      \"probability\": \"0.13336977\",\n      \"result\": \"LESS_THAN_30_MINUTES\",\n      \"subType\": \"flight-delay\",\n      \"type\": \"prediction\"\n    },\n    {\n      \"id\": \"TK1816NCEIST20200801\",\n      \"probability\": \"0.42023364\",\n      \"result\": \"BETWEEN_30_AND_60_MINUTES\",\n      \"subType\": \"flight-delay\",\n      \"type\": \"prediction\"\n    },\n    {\n      \"id\": \"TK1816NCEIST20200801\",\n      \"probability\": \"0.34671372\",\n      \"result\": \"BETWEEN_60_AND_120_MINUTES\",\n      \"subType\": \"flight-delay\",\n      \"type\": \"prediction\"\n    },\n    {\n      \"id\": \"TK1816NCEIST20200801\",\n      \"probability\": \"0.09968289\",\n      \"result\": \"OVER_120_MINUTES_OR_CANCELLED\",\n      \"subType\": \"flight-delay\",\n      \"type\": \"prediction\"\n    }\n  ],\n  \"meta\": {\n    \"count\": 4,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/travel/predictions/flight-delay?originLocationCode=NCE&destinationLocationCode=IST&departureDate=2020-08-01&departureTime=18:20:00&arrivalDate=2020-08-01&arrivalTime=22:15:00&aircraftCode=321&carrierCode=TK&flightNumber=1816&duration=PT31H10M\"\n    }\n  }\n}\n

The main parameter of the dataset is the result, which contains a self-explanatory value, e.g. LESS_THAN_30_MINUTES, BETWEEN_30_AND_60_MINUTES, etc.

"},{"location":"resources/flights/#check-the-on-time-performance-of-an-airport","title":"Check the on-time performance of an airport","text":"

Another way to get prepared for any delays, is checking the on-time performance of the actual airport. The Airport On-Time Performance API estimates the probability of a specific flight being delayed.

The search query is very simple. In our query we only need to provide our flight departure date and the departure airport. For example, JFK on 12 December 2022.

GET https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2022-12-12 \n

This is the result:

{\n  \"data\": {\n    \"id\": \"JFK20221212\",\n    \"probability\": \"0.928\",\n    \"result\": \"0.77541769\",\n    \"subType\": \"on-time\",\n    \"type\": \"prediction\"\n  },\n  \"meta\": {\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2022-12-12\"\n    }\n  }\n}\n

The probability parameter shows the probability of the airport running smoothly. In our example, this metric means that there is a 92.8% chance that there will be no delays.

"},{"location":"resources/flights/#get-a-direct-link-to-the-airline-check-in-page","title":"Get a direct link to the airline check-in page","text":"

Suppose we are building an app with an integrated check-in flow for a particular airline. In this case, we can leverage the Flight Check-in Links API to generate a link to the airline's official check-in page in a required language for both web and mobile platforms. The only parameter that we need to provide in our search query is the airline's IATA code. If required, we can request the links in a specific language, such as UK English (en-GB). This is what our request would look like:

curl --request GET \\\n     --header 'Authorization: Bearer <token>' \\\n     --url https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA&language=en-GB \\\n

This is what we get in the response:

{\n  \"meta\": {\n    \"count\": 3,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA&language=EN-GB\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"checkin-link\",\n      \"id\": \"BAEN-GBAll\",\n      \"href\": \"https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb\",\n      \"channel\": \"All\"\n    },\n    {\n      \"type\": \"checkin-link\",\n      \"id\": \"BAEN-GBMobile\",\n      \"href\": \"https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb/device-mobile\",\n      \"channel\": \"Mobile\"\n    },\n    {\n      \"type\": \"checkin-link\",\n      \"id\": \"BAEN-GBWeb\",\n      \"href\": \"https://www.britishairways.com/travel/olcilandingpageauthreq/public/en_gb\",\n      \"channel\": \"Web\"\n    }\n  ]\n}\n

Here we've got a dedicated link for web applications, a dedicated link for mobile applications and a link that works on all platforms.

"},{"location":"resources/flights/#cancel-a-reservation","title":"Cancel a reservation","text":"

Just as you can help users book a flight with the Flight Create Orders API, you can now also help them cancel their reservations with the Flight Order Management API. However, you have a limited window of time to cancel via API. If you\u2019re working with an airline consolidator for ticketing, cancellations via API are generally only allowed while the order is queued for ticketing. Once the ticket has been issued, you\u2019ll have to contact your consolidator directly to handle the cancellation.

To call the Flight Order Management API, you have pass as a parameter the flight-orderId from the Flight Create Orders API.

To retrieve the flight order data:

GET https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY\n

To delete the flight order data:

DELETE https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY\n
"},{"location":"resources/flights/#view-reservation-details","title":"View reservation details","text":"

With the Flight Order Management API you can consult and check your flight reservation.

To call the Flight Order Management API, you have pass as a parameter the flight-orderId from the Flight Create Orders API, such as:

GET https://test.api.amadeus.com/v1/booking/flight-orders/eJzTd9f3NjIJdzUGAAp%2fAiY\n
"},{"location":"resources/flights/#common-errors","title":"Common Errors","text":""},{"location":"resources/flights/#issuance-not-allowed-in-self-service","title":"Issuance not allowed in Self Service","text":"

Self-Service users must work with an airline consolidator that can issue tickets on your behalf. In that case, the payment is not processed by the API but directly between you and the consolidator. Adding a form of payment to the Flight Create Orders API will be rejected by error INVALID FORMAT.

"},{"location":"resources/flights/#price-discrepancy","title":"Price discrepancy","text":"

The price of airfare fluctuates constantly. Creating an order for a flight whose price is no longer valid at the time of booking will trigger the following error:

{\n  \"errors\": [\n    {\n      \"status\": 400,\n      \"code\": 37200,\n      \"title\": \"PRICE DISCREPANCY\",\n      \"detail\": \"Current grandTotal price (2780.28) is different from request one (2779.58)\"\n    }\n  ]\n}\n

If you receive this error, reconfirm the fare price with the Flight Offers Price API before booking.

The following is a common error in the test environment, as you can perform many bookings without restrictions (no real payment), but the inventory is a copy of the real one, so if you book many seats, the inventory will be empty and you won't be able to book anymore.

{\n            \"status\": 400,\n            \"code\": 34651,\n            \"title\": \"SEGMENT SELL FAILURE\",\n            \"detail\": \"Could not sell segment 1\"\n        }\n
"},{"location":"resources/flights/#notes","title":"Notes","text":""},{"location":"resources/flights/#carriers-and-rates","title":"Carriers and rates","text":"
  • Low cost carriers (LCCs), American Airlines are not available. Depending on the market, British Airways is also not available.
  • Published rates only returned in Self-Service. Cannot access to negotiated rates, or any other special rates.
"},{"location":"resources/flights/#post-booking-modifications","title":"Post-booking modifications","text":"

With the current version of our Self-Service APIs, you can\u2019t add additional baggage after the flight has been booked. This and other post-booking modifications must be handled directly with the airline consolidator that is issuing tickets on your behalf.

"},{"location":"resources/flights/#how-payment-works","title":"How payment works","text":"

There are two things to consider regarding payments for flight booking:

  • The payment between you (the app owner) and your customers (for the services provided + the price of the flight ticket). You decide how to collect this payment, it is not included in the API. A third party payment gateway, such as Stripe will be an easier solution for this.
  • The payment between you and the consolidator (to be able to pay the airline and issue the flight ticket). This will be done between you and your consolidator of choice, and is to be agreed with the consolidator.
"},{"location":"resources/flights/#flight-booking-engine-101-video-tutorial","title":"Flight Booking Engine 101 Video tutorial","text":"

A video tutorial series to Explain Flight Booking Engine is available in Youtube channel.

"},{"location":"resources/hotels/","title":"Hotels","text":"

The Hotels category contains APIs that can help you find the right hotel and complete the booking.

Information

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

APIs Description Hotel List Returns the name, address, geoCode, and time zone for each hotel bookable in Amadeus. Hotel Ratangs Uses sentiment analysis of hotel reviews to provide an overall hotel ratings and ratings for categories like location, comfort, service, staff, internet, food, facilities, pool or sleep quality. Hotel Search Provides a list of the cheapest hotels in a given location with detailed information on each hotel and the option to filter by category, chain, facilities or budget range. Hotel Booking Lets you complete bookings at over 150,000 hotels and accommodations around the world. Hotel Name Autocomplete API Provides a list of up to 20 hotels whose names most closely match the search query string.

Let's learn how to get started and help your users book the perfect rooms at over 150,000 hotels worldwide.

Information

This page has been updated based on Hotel Search V3 updates since MAY 2022.

"},{"location":"resources/hotels/#search-hotels","title":"Search hotels","text":""},{"location":"resources/hotels/#get-a-list-of-hotels-by-location","title":"Get a list of hotels by location","text":"

First, users should be able to search hotels for a given location. The Hotel List API returns a list of hotels based on a city, a geographic code or the unique Amadeus hotel Id. To answer a question, such as \"what are the hotels closed to the city hall?\" the Hotel List API has three endpoints to utilize based on your search criteria. It returns hotel name, location, and hotel id for you to proceed to the next steps of the hotel search.

The Hotel List API contains the following endpoints:

  • GET \u200b/reference-data\u200b/locations\u200b/hotels\u200b/by-city - searches hotels by a city code
  • GET \u200b/reference-data\u200b/locations\u200b/hotels\u200b/by-geocode - searches hotels by geographic coordinates
  • GET /reference-data\u200b/locations\u200b/hotels\u200b/by-hotels - searches hotels by a unique Amadeus hotel Id
"},{"location":"resources/hotels/#search-hotels-by-a-city","title":"Search hotels by a city","text":"

You can specify an IATA city code or Geocode to search a more specific area to get the list of hotels. You can customize the request using parameters, such as radius, chain code, amenities, star ratings, and hotel source.

To search a hotel by a city code, the IATA city code is the only required query parameter:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR\n

To include places within a certain radius of the queried city, you can use the optional radius parameter in conjunction with the radiusUnit parameter that defines the unit of measurement for the radius. For example, to look for places within 100 km from Paris:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&radius=100&radiusUnit=KM\n

Another way to narrow down our search query is to limit the search to a specific hotel chain. To do this, we need to pass the hotel chain code (which is a two letters string) as the chainCodes parameter, such as EM for Marriott:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&chainCodes=EM\n

If you are looking for hotels with certain amenities, such as a spa or a swimming pool, you can use the amenities parameter, which is an enum with the following options:

  • FITNESS_CENTER
  • AIR_CONDITIONING
  • RESTAURANT
  • PARKING
  • PETS_ALLOWED
  • AIRPORT_SHUTTLE
  • BUSINESS_CENTER
  • DISABLED_FACILITIES
  • WIFI
  • MEETING_ROOMS
  • NO_KID_ALLOWED
  • TENNIS
  • GOLF
  • KITCHEN
  • ANIMAL_WATCHING
  • BABY-SITTING
  • BEACH
  • CASINO
  • JACUZZI
  • SAUNA
  • SOLARIUM
  • MASSAGE
  • VALET_PARKING
  • BAR or LOUNGE
  • KIDS_WELCOME
  • NO_PORN_FILMS
  • MINIBAR
  • TELEVISION
  • WI-FI_IN_ROOM
  • ROOM_SERVICE
  • GUARDED_PARKG
  • SERV_SPEC_MENU

The query to find a hotel in Paris with a swimming pool will look like this:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&chainCodes=&amenities=SWIMMING_POOL\n

If stars rating is important for the search, you can include up to four values separated by comma in the ratings parameter:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&ratings=5\n

The source data for the Hotel List API comes from BEDBANK for aggregators and DIRECTCHAIN for GDS/Distribution. You can select both sources or include/ exclude a particular source:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-city?cityCode=PAR&hotelSource=ALL\n

The response will also include a dedicated Amadeus hotelId:

        {\n            \"chainCode\": \"AC\",\n            \"iataCode\": \"PAR\",\n            \"dupeId\": 700169556,\n            \"name\": \"ACROPOLIS HOTEL PARIS BOULOGNE\",\n            \"hotelId\": \"ACPARH29\",\n            \"geoCode\": {\n                \"latitude\": 48.83593,\n                \"longitude\": 2.24922\n            },\n            \"address\": {\n                \"countryCode\": \"FR\"\n            },\n            \"lastUpdate\": \"2022-03-01T15:22:17\"\n        }\n
"},{"location":"resources/hotels/#search-hotels-by-geocode","title":"Search hotels by Geocode","text":"

Using the by-geocode endpoint, get a list of hotels in Paris (latitude=41.397158 and longitude=2.160873):

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873\n

To include places within a certain radius of the queried city, you can use the optional radius parameter in conjunction with the radiusUnit parameter that defines the unit of measurement for the radius. For example, to look for places within 100 km from Paris:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&radius=100&radiusUnit=KM\n

Another way to narrow down our search query is to limit the search to a specific hotel chain. To do this, we need to pass the hotel chain code (which is a two letters string) as the chainCodes parameter, such as EM for Marriott:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&chainCodes=EM\n

If you are looking for hotels with certain amenities, such as a spa or a swimming pool, you can use the amenities parameter, which is an enum with the following options:

  • FITNESS_CENTER
  • AIR_CONDITIONING
  • RESTAURANT
  • PARKING
  • PETS_ALLOWED
  • AIRPORT_SHUTTLE
  • BUSINESS_CENTER
  • DISABLED_FACILITIES
  • WIFI
  • MEETING_ROOMS
  • NO_KID_ALLOWED
  • TENNIS
  • GOLF
  • KITCHEN
  • ANIMAL_WATCHING
  • BABY-SITTING
  • BEACH
  • CASINO
  • JACUZZI
  • SAUNA
  • SOLARIUM
  • MASSAGE
  • VALET_PARKING
  • BAR or LOUNGE
  • KIDS_WELCOME
  • NO_PORN_FILMS
  • MINIBAR
  • TELEVISION
  • WI-FI_IN_ROOM
  • ROOM_SERVICE
  • GUARDED_PARKG
  • SERV_SPEC_MENU

The query to find a hotel in Paris with a swimming pool will look like this:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&chainCodes=&amenities=SWIMMING_POOL&ratings=\n

If stars rating is important for the search, you can include up to four values separated by comma in the ratings parameter:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&ratings=5\n

The source data for the Hotel List API comes from BEDBANK for aggregators and DIRECTCHAIN for GDS/Distribution. You can select both sources or include/ exclude a particular source:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode?latitude=41.397158&longitude=2.160873&hotelSource=ALL\n

The response will also include a dedicated Amadeus hotelId:

        {\n            \"chainCode\": \"AC\",\n            \"iataCode\": \"PAR\",\n            \"dupeId\": 700169556,\n            \"name\": \"ACROPOLIS HOTEL PARIS BOULOGNE\",\n            \"hotelId\": \"ACPARH29\",\n            \"geoCode\": {\n                \"latitude\": 48.83593,\n                \"longitude\": 2.24922\n            },\n            \"address\": {\n                \"countryCode\": \"FR\"\n            },\n            \"lastUpdate\": \"2022-03-01T15:22:17\"\n        }\n
"},{"location":"resources/hotels/#search-hotels-by-hotel-ids","title":"Search hotels by hotel ids","text":"

If you already know the Id of a hotel that you would like to check, you can use it to call the Hotel List API.

GET https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-hotels?hotelIds=ACPARF58\n
"},{"location":"resources/hotels/#interactive-code-examples","title":"Interactive code examples","text":"

Check out this interactive code example which provides a hotel search form to help you build your app. You can easily customize it and use the Hotel Search API to get the cheapest flight offers.

"},{"location":"resources/hotels/#autocomplete-hotel-names","title":"Autocomplete Hotel Names","text":"

Your application can also display a list of suggested hotel names based on keywords used in the search query.

Hotel Name Autocomplete API provides a list of up to 20 hotels whose names most closely match the search query string. For each hotel in the results, the API also provides descriptive data, including the hotel name, address, geocode, property type, IATA hotel code and the Amadeus hotel ID.

The two mandatory query parameters for this API are the keyword and subtype. The keyword can be anything from four to fourty letters. The sub type is the category of search, which can be either HOTEL_LEISURE to target aggregators or HOTEL_GDS to target the chains directly.

GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE\n
{\n    \"data\": [\n        {\n            \"id\": 2969353,\n            \"name\": \"BEST WESTERN PREMIER OPERA FAUBOURG PARI\",\n            \"iataCode\": \"PAR\",\n            \"subType\": \"HOTEL_LEISURE\",\n            \"relevance\": 70,\n            \"type\": \"location\",\n            \"hotelIds\": [\n                \"TEPARCFG\"\n            ],\n            \"address\": {\n                \"cityName\": \"PARIS\",\n                \"countryCode\": \"FR\"\n            },\n            \"geoCode\": {\n                \"latitude\": 48.86821,\n                \"longitude\": 2.40085\n            }\n        },\n        {\n            \"id\": 3012697,\n            \"name\": \"HOTEL PARI MAHAL\",\n            \"iataCode\": \"SXR\",\n            \"subType\": \"HOTEL_LEISURE\",\n            \"relevance\": 70,\n            \"type\": \"location\",\n            \"hotelIds\": [\n                \"TKSXRAHS\"\n            ],\n            \"address\": {\n                \"cityName\": \"SRINAGAR\",\n                \"countryCode\": \"IN\"\n            },\n            \"geoCode\": {\n                \"latitude\": 34.08106,\n                \"longitude\": 74.83126\n            }\n        },\n

We can narrow the search down to a country specified by a code in the ISO 3166-1 alpha-2 format:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&countryCode=FR\n

We can request the results in various languages, although if a language is not supported, the results will be shown in English by default:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&lang=FR\n

We can also define the maximum number of results by using the max parameter:

GET https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&countryCode=FR&lang=EN&max=20\n
"},{"location":"resources/hotels/#display-hotel-ratings","title":"Display Hotel Ratings","text":"

When users search for hotels in a desired area, they may wonder about the hotel rating. Hotel Ratings API returns ratings for many crucial elements of a hotel, such as sleep quality, services, facilities, room comfort, value for money, location and many others. Hotel Ratings API guarantees high-quality service for your customers.

The sentiment analysis, just like the one below, is displayed in a simple flow to allow you to easily identify the best hotels based on traveler reviews:

GET https://test.api.amadeus.com/v2/e-reputation/hotel-sentiments?hotelIds=TELONMFS,ADNYCCTB,XXXYYY01\n
{ \"data\": [  {\n    \"type\": \"hotelSentiment\",\n    \"numberOfReviews\": 218,\n    \"numberOfRatings\": 278,\n   \"hotelId\": \"ADNYCCTB\",\n    \"overallRating\": 93,\n    \"sentiments\": {\n      \"sleepQuality\": 87,\n      \"service\": 98,\n      \"facilities\": 90,\n      \"roomComforts\": 92,\n      \"valueForMoney\": 87,\n      \"catering\": 89,\n      \"location\": 98,\n      \"pointsOfInterest\": 91,\n      \"staff\": 100\n    }\n  },\n  {\n    \"type\": \"hotelSentiment\",\n    \"numberOfReviews\": 2667,\n    \"numberOfRatings\": 2666,\n    \"hotelId\": \"TELONMFS\",\n    \"overallRating\": 81,\n    \"sentiments\": {\n      \"sleepQuality\": 78,\n      \"service\": 80,\n      \"facilities\": 75,\n      \"roomComforts\": 87,\n      \"valueForMoney\": 75,\n      \"catering\": 81,\n     \"location\": 89,\n      \"internet\": 72,\n      \"pointsOfInterest\": 81,\n      \"staff\": 89\n    }\n  }\n]\n

With these additional filters, your booking process becomes more efficient and you can offer your customers an enriched shopping experience. In this way, you can be confident that you are offering a highly rated hotels selection in the areas that customers appreciate the most.

"},{"location":"resources/hotels/#check-availabilities-and-prices","title":"Check Availabilities and Prices","text":"

Once users have explored the list of hotels in their desired area, they would want to check the price of a specific hotel or compare the prices of hotels on the list. With the hotelIds that you got from Hotel List API, you now can check the available rooms with real-time prices and room descriptions by calling the Hotel Search API.

An example to request available rooms and prices for one room in Hilton Paris Opera for one adult with check-in date 2022-11-22:

GET https://test.api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=1&checkInDate=2022-11-22&roomQuantity=1\n

The API returns a list of offers objects containing the price of the cheapest available room as well as information including the room description and payment policy.

Note

The response of Hotel Search V3 contains real-time data, so you don't need an additional validation step anymore. However, as there are thousands of people reserving hotels at any given second, the availability of a given room may change between the moment you search and the moment you decide to book. It is therefore advised that you proceed with booking as soon as possible or add a validation step by searching by offerid described below.

{\n    \"data\": [\n        {\n            \"type\": \"hotel-offers\",\n            \"hotel\": {\n                \"type\": \"hotel\",\n                \"hotelId\": \"HLPAR266\",\n                \"chainCode\": \"HL\",\n                \"dupeId\": \"700006199\",\n                \"name\": \"Hilton Paris Opera\",\n                \"cityCode\": \"PAR\",\n                \"latitude\": 48.8757,\n                \"longitude\": 2.32553\n            },\n            \"available\": true,\n            \"offers\": [\n                {\n                    \"id\": \"ZBC0IYFMFV\",\n                    \"checkInDate\": \"2022-11-22\",\n                    \"checkOutDate\": \"2022-11-23\",\n                    \"rateCode\": \"RAC\",\n                    \"rateFamilyEstimated\": {\n                        \"code\": \"PRO\",\n                        \"type\": \"P\"\n                    },\n                    \"commission\": {\n                        \"percentage\": \"8\"\n                    },\n                    \"room\": {\n                        \"type\": \"A07\",\n                        \"typeEstimated\": {\n                            \"category\": \"SUPERIOR_ROOM\"\n                        },\n                        \"description\": {\n                            \"text\": \"ADVANCE PURCHASE\\nSUPERIOR ROOM\\nFREE WIFI/AIRCON\\nHD/ SAT TV/SAFE\",\n                            \"lang\": \"EN\"\n                        }\n                    },\n                    \"guests\": {\n                        \"adults\": 1\n                    },\n                    \"price\": {\n                        \"currency\": \"EUR\",\n                        \"base\": \"359.01\",\n                        \"total\": \"361.89\",\n                        \"taxes\": [\n                            {\n                                \"code\": \"TOTAL_TAX\",\n                                \"pricingFrequency\": \"PER_STAY\",\n                                \"pricingMode\": \"PER_PRODUCT\",\n                                \"amount\": \"2.88\",\n                                \"currency\": \"EUR\",\n                                \"included\": false\n                            }\n                        ],\n                        \"variations\": {\n                            \"average\": {\n                                \"base\": \"359.01\"\n                            },\n                            \"changes\": [\n                                {\n                                    \"startDate\": \"2022-11-22\",\n                                    \"endDate\": \"2022-11-23\",\n                                    \"base\": \"359.01\"\n                                }\n                            ]\n                        }\n                    },\n                    \"policies\": {\n                        \"deposit\": {\n                            \"acceptedPayments\": {\n                                \"creditCards\": [\n                                    \"VI\",\n                                    \"CA\",\n                                    \"AX\",\n                                    \"DC\",\n                                    \"DS\",\n                                    \"JC\",\n                                    \"CU\"\n                                ],\n                                \"methods\": [\n                                    \"CREDIT_CARD\"\n                                ]\n                            }\n                        },\n                        \"paymentType\": \"deposit\",\n                        \"cancellation\": {\n                            \"amount\": \"361.89\",\n                            \"type\": \"FULL_STAY\",\n                            \"description\": {\n                                \"text\": \"Non refundable rate\",\n                                \"lang\": \"EN\"\n                            }\n                        }\n                    },\n                    \"self\": \"https://api.amadeus.com/v3/shopping/hotel-offers/ZBC0IYFMFV\",\n                    \"cancelPolicyHash\": \"F1DC3A564AF1C421C90F7DB318E70EBC688A5A70A93B944F6628D0338F9\"\n                }\n            ],\n            \"self\": \"https://api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=1&checkInDate=2022-11-22&roomQuantity=1\"\n        }\n    ]\n}\n

Information

The commission information returned by the commission parameter is for information only. Hotels can voluntary provide commission. They are only obliged to do it if you are a IATA certified travel agency, in which case you need to contact our Enterprise APIs team to get access to our REST/JSON booking APIs. Once you have moved to the production environment and obtained the offerId, it will be necessary for you to directly communicate with the hotel to receive the commission on this offer.

If the time between displaying prices and booking the room is long enough to allow others to book the same room, you can consider requesting Hotel Search API again with the offerid that you got before. This is not mandatory as you always will see if the offer is available or not when you try to book the offer.

An example to request the offer information with offer id:

GET https://test.api.amadeus.com/v3/shopping/hotel-offers/ZBC0IYFMFV\n

Now that you have found the available offer (and its offerId) with the price, you're ready to book!

"},{"location":"resources/hotels/#booking-the-hotel","title":"Booking the Hotel","text":"

The Hotel Booking API\u202fis the final step in the hotel booking flow. By making a POST request with the offer Id returned by the Hotel Search API, the guest information, and the payment information, you can create a booking directly in the hotel reservation system.

POST https://test.api.amadeus.com/v1/booking/hotel-bookings \\\n{\n  \"data\": {\n    \"offerId\": \"ZBC0IYFMFV\",\n    \"guests\": [\n      {\n        \"id\": 1,\n        \"name\": {\n          \"title\": \"MR\",\n          \"firstName\": \"BOB\",\n          \"lastName\": \"SMITH\"\n        },\n        \"contact\": {\n          \"phone\": \"+33679278416\",\n          \"email\": \"bob.smith@email.com\"\n        }\n      }\n    ],\n    \"payments\": [\n      {\n        \"id\": 1,\n        \"method\": \"creditCard\",\n        \"card\": {\n          \"vendorCode\": \"VI\",\n          \"cardNumber\": \"4151289722471370\",\n          \"expiryDate\": \"2023-08\"\n        }\n      }\n    ],\n    \"rooms\": [\n      {\n        \"guestIds\": [\n          1\n        ],\n        \"paymentId\": 1,\n        \"specialRequest\": \"I will arrive at midnight\"\n      }\n    ]\n  }\n}'\n

Congratulations! You\u2019ve just performed your first hotel booking! Once the reservation is made, the API will return a unique booking confirmation ID which you can send to your users.

"},{"location":"resources/hotels/#notes-about-payment","title":"Notes about Payment","text":"

The Hotel Search API returns information about the payment policy of each hotel. The main policy types are:

  • Guarantee: the hotel will save credit card information during booking but not make any charges to the account. In the case of a no-show or out-of-policy cancellation, the hotel may charge penalties to the card.
  • Deposit: at the time of booking or by a given deadline, the hotel will charge the guest a percentage of the total amount of the reservation. The remaining amount is paid by the traveler directly at the hotel.
  • Prepay: the total amount of the reservation fee must be paid by the traveler when making the booking.

The current version of the Hotel Booking API only permits booking at hotels that accept credit cards. During the booking process, Amadeus passes the payment and guest information to the hotel but does not validate this information. Be sure to validate the payment and guest information, as invalid information may result in the reservation being canceled.

As soon as your application stores transmits, or processes cardholder information, you will need to comply with\u202fPCI Data Security Standard (PCI DSS). For more information, visit the PCI Security Council website.

"},{"location":"resources/hotels/#guide-for-multiple-hotel-rooms","title":"Guide for multiple hotel rooms","text":"

Now that we have gone through the hotel booking flow, you may wonder how to proceed to booking more than two rooms in a hotel.

"},{"location":"resources/hotels/#check-availability-and-prices-for-multiple-rooms","title":"Check availability and prices for multiple rooms","text":"

The first step to booking multiple rooms is to search for hotels in your destination with the desired number of available rooms. You can do this by specifying the roomQuantity parameter when you call the Hotel Search API using the hotelid that you got from the Hotel List API.

Here is an example of a search in Hilton Paris for two rooms for three adults:

GET https://test.api.amadeus.com/v3/shopping/hotel-offers?hotelIds=HLPAR266&adults=3&checkInDate=2022-11-22&roomQuantity=2\n

The API will then return the available offers where roomQuantityis equal to 2.

 \"offers\": [ \n            { \n                \"id\": \"48E6C8C7DAA0BA5C22663E2A2A2B7629F5468BCBE2722FE4AB8174\", \n                \"roomQuantity\": \"2\", \n                \"checkInDate\": \"2022-11-22\", \n                \"checkOutDate\": \"2022-11-23\",\n
"},{"location":"resources/hotels/#book-multiple-rooms-with-details-for-one-guest","title":"Book multiple rooms with details for one guest","text":"

To call the Hotel Booking API, you must provide details for at least one guest per offer (the offer contains all rooms for the reservation). For example, the JSON query below provides details of one guest to book two rooms by offerId:

{ \n   \"data\":{ \n      \"offerId\":\"F837D841218665647003CC9A8CA2A37CEC7276BBE14F9B9C525FBD1B7B69A8FF\", \n      \"guests\":[ \n         { \n            \"name\":{ \n               \"title\":\"MR\", \n               \"firstName\":\"BOB\", \n               \"lastName\":\"SMITH\" \n            }, \n            \"contact\":{ \n               \"phone\":\"+33679278416\", \n               \"email\":\"bob.smith@email.com\" \n            } \n         } \n      ], \n      \"payments\":[ \n         { \n            \"method\":\"creditCard\", \n            \"card\":{ \n               \"vendorCode\":\"VI\", \n               \"cardNumber\":\"4111111111111111\", \n               \"expiryDate\":\"2026-01\" \n            } \n         } \n      ] \n   } \n} \n
Once the booking is complete, the API will return the following confirmation:

{ \n    \"data\": [ \n        { \n            \"type\": \"hotel-booking\", \n            \"id\": \"HA_36000507\", \n            \"providerConfirmationId\": \"36000507\", \n            \"associatedRecords\": [ \n                { \n                    \"reference\": \"R622XL\", \n                    \"originSystemCode\": \"GDS\" \n                } \n            ] \n        }, \n        { \n            \"type\": \"hotel-booking\", \n            \"id\": \"HA_36000506\", \n            \"providerConfirmationId\": \"36000506\", \n            \"associatedRecords\": [ \n                { \n                    \"reference\": \"R622XL\", \n                    \"originSystemCode\": \"GDS\" \n                } \n            ] \n        } \n    ] \n}\n
"},{"location":"resources/hotels/#book-multiple-rooms-with-guest-distribution","title":"Book multiple rooms with guest distribution","text":"

One common question is how to assign guest distribution among the booked rooms.

When you call the Hotel Booking API, the rooms object represents the rooms. Each room contains guests distributed per room. Specifically, each room object needs IDs of the guests staying in that room.

Below is a sample request to book two rooms with guest distribution. The first room is for guest ID\u2019s 1 & 2 and the second room for guest Id 3.

{ \n  \"data\": { \n    \"offerId\": \"4A449AE835DD68F2E7C3571740FD00B76209D7311E719E3B66DE4E1100\", \n    \"guests\": [ \n      { \n        \"id\": 1, \n        \"name\": { \n          \"title\": \"MR\", \n          \"firstName\": \"BOB\", \n          \"lastName\": \"SMITH\" \n        }, \n        \"contact\": { \n          \"phone\": \"+33679278416\", \n          \"email\": \"bob.smith@email.com\" \n        } \n      }, \n      { \n        \"id\": 2, \n        \"name\": { \n          \"title\": \"MRS\", \n          \"firstName\": \"EMILY\", \n          \"lastName\": \"SMITH\" \n        }, \n        \"contact\": { \n          \"phone\": \"+33679278416\", \n          \"email\": \"bob.smith@email.com\" \n        } \n      }, \n      { \n        \"id\": 3, \n        \"name\": { \n          \"firstName\": \"JOHNY\", \n          \"lastName\": \"SMITH\" \n        }, \n        \"contact\": { \n          \"phone\": \"+33679278416\", \n          \"email\": \"bob.smith@email.com\" \n        } \n      } \n    ], \n    \"payments\": [ \n      { \n        \"id\": 1, \n        \"method\": \"creditCard\", \n        \"card\": { \n          \"vendorCode\": \"VI\", \n          \"cardNumber\": \"4151289722471370\", \n          \"expiryDate\": \"2026-08\" \n        } \n      } \n    ], \n    \"rooms\": [ \n      { \n        \"guestIds\": [ \n          1, 2 \n        ], \n        \"paymentId\": 1, \n        \"specialRequest\": \"I will arrive at midnight\" \n      }, \n      { \n        \"guestIds\": [ \n          3 \n        ], \n        \"paymentId\": 1, \n        \"specialRequest\": \"I will arrive at midnight\" \n      } \n    ] \n  } \n} \n

The API response will be the same as when you booked multiple rooms using the details of just one guest:

{ \n    \"data\": [ \n        { \n            \"type\": \"hotel-booking\", \n            \"id\": \"XK_88803316\", \n            \"providerConfirmationId\": \"88803316\", \n            \"associatedRecords\": [ \n                { \n                    \"reference\": \"MJ6HLK\", \n                    \"originSystemCode\": \"GDS\" \n                } \n            ] \n        }, \n        { \n            \"type\": \"hotel-booking\", \n            \"id\": \"XK_88803315\", \n            \"providerConfirmationId\": \"88803315\", \n            \"associatedRecords\": [ \n                { \n                    \"reference\": \"MJ6HLK\", \n                    \"originSystemCode\": \"GDS\" \n                } \n            ] \n        } \n    ]\u200b \n
"},{"location":"resources/hotels/#common-errors","title":"Common Errors","text":""},{"location":"resources/hotels/#acceptedpayments-must-be-creditcards","title":"AcceptedPayments must be creditCards","text":"

The current version of the Hotel Booking API only supports credit card payments, which are accepted by most hotels. The Hotel Search API returns the payment policy of each hotel under acceptedPayments in the policies section.

"},{"location":"resources/hotels/#empty-response-from-the-view-room-endpoint","title":"Empty response from the View Room endpoint","text":"

If you get an empty response from the Hotel Search API\u2019s second endpoint, then the hotel is fully booked and has no vacancy for the requested dates. If you don't use the checkInDate and checkOutDate parameters in the request, the API will return results for a one-night stay starting on the current date. If the hotel is full, the response will be empty.

"},{"location":"resources/hotels/#no-rooms-available-at-requested-property","title":"No rooms available at requested property","text":"
{\n    \"errors\": [\n        {\n            \"status\": 400,\n            \"code\": 3664,\n            \"title\": \"NO ROOMS AVAILABLE AT REQUESTED PROPERTY\"\n        }\n    ]\n}\n

The offer for the selected Hotel is no longer available. Please select a new one.

"},{"location":"resources/itinerary-managment/","title":"Itinerary Management","text":"

In the Itinerary Management category, you can give travelers a simple and personalized way to view their itinerary.

Information

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

APIs Description Trip Parser Build a single itinerary with information from different booking confirmation emails. Trip Purpose Prediction Analyze a flight itinerary and predict whether the trip is for business or leisure. City Search Finds cities that match a specific word or string of letters."},{"location":"resources/itinerary-managment/#parse-the-email-confirmation-into-json","title":"Parse the email confirmation into JSON","text":"

The Trip Parser API helps to extract information from different booking confirmation emails and compile it into a single structured JSON itinerary. This API can parse information from flight, hotel, rail, and rental car confirmation emails. It provides the result of your parsing immediately, thanks to our algorithm.

"},{"location":"resources/itinerary-managment/#encode-your-booking-confirmation-in-base64","title":"Encode your booking confirmation in Base64","text":"

The first step to parsing is to encode your booking confirmation file in Base64 format. This will give you the base of your API request. You should not add formatting or any other elements to your booking confirmation as it will affect the parsing.

There are many tools and software that you can use for Base64 encoding. Some programming languages implement encoding and decoding functionalities in their standard library. In python, for example, it will look similar to this:

import base64 \nwith open(\"booking.pdf\", \"rb\") as booking_file: \n    encoded_string = base64.b64encode(booking_file.read()) \nprint(encoded_string)\n
"},{"location":"resources/itinerary-managment/#get-the-parsing-results","title":"Get the parsing results","text":"

Next, add the encoded booking confirmation to the body of a POST request to the endpoint

POST https://test.api.amadeus.com/v3/travel/trip-parser\n
{\n  \"payload\": \"your Base64 code here\",\n  \"metadata\": {\n    \"documentType\": \"PDF\",\n    \"name\": \"BOOKING_DOCUMENT\",\n    \"encoding\": \"BASE_64\"\n  }\n}\n
  • documentType : pdf, xml, json or jpg
  • encoding : BASE_64 or BASE_64_URL

This will extract all the relevant data from the booking information into a structured JSON format, just like the example below.

{\n  \"data\": {\n    \"trip\": {\n      \"reference\": \"JUPDRM\",\n      \"stakeholders\": [\n        {\n          \"name\": {\n            \"firstName\": \"MIGUEL\",\n            \"lastName\": \"TORRES\"\n          }\n        }\n      ],\n      \"products\": [\n        {\n          \"air\": {\n            \"departure\": {\n              \"localDateTime\": \"2021-06-16T08:36:00\"\n            },\n            \"arrival\": {\n              \"localDateTime\": \"2021-06-17T00:00:00\"\n            },\n            \"marketing\": {\n              \"flightDesignator\": {\n                \"carrierCode\": \"CM\",\n                \"flightNumber\": \"644\"\n              }\n            }\n          }\n        },\n        {\n          \"air\": {\n            \"departure\": {\n              \"localDateTime\": \"2021-06-16T11:21:00\"\n            },\n            \"arrival\": {\n              \"localDateTime\": \"2021-06-17T00:00:00\"\n            },\n            \"marketing\": {\n              \"flightDesignator\": {\n                \"carrierCode\": \"CM\",\n                \"flightNumber\": \"426\"\n              }\n            }\n          }\n        },\n        {\n          \"air\": {\n            \"departure\": {\n              \"localDateTime\": \"2021-06-20T18:56:00\"\n            },\n            \"arrival\": {\n              \"localDateTime\": \"2021-06-21T00:00:00\"\n            },\n            \"marketing\": {\n              \"flightDesignator\": {\n                \"carrierCode\": \"CM\",\n                \"flightNumber\": \"645\"\n              }\n            }\n          }\n        }\n      ]\n    }\n  }\n}\n
"},{"location":"resources/itinerary-managment/#predict-the-trip-purpose-from-a-flight","title":"Predict the trip purpose from a flight","text":"

Another API in the itinerary management category, the Trip Purpose Prediction API, predicts whether a flight is searched for business or leisure. Our machine-learning models have detected which patterns of departure and arrival cities, flight dates, and search dates are associated with business and leisure trips. Understand why your users travel and show them the flights, fares, and ancillaries that suit them best.

Below is an example to see if the flight from New York to Madrid from 2022-12-01 to 2022-12-12 is leisure or business.

GET https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2022-12-01&returnDate=2022-12-12\n

The result? You can probably guess it. :)

{\n  \"data\": {\n    \"id\": \"NYCMAD20221201\",\n    \"probability\": \"0.9970142\",\n    \"result\": \"LEISURE\",\n    \"subType\": \"trip-purpose\",\n    \"type\": \"prediction\"\n  },\n  \"meta\": {\n    \"defaults\": {\n      \"searchDate\": \"2022-06-30\"\n    },\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2022-12-01&returnDate=2022-12-12&searchDate=2022-06-30\"\n    }\n  }\n}\n
"},{"location":"resources/itinerary-managment/#find-a-city-by-keywords","title":"Find a city by keywords","text":"

If you are unsure of the exact spelling of a city, you can reach out to the City Search API. This API uses a keyword, which is a string containing a minimum of 3 and a maximum of 10 characters, to search for a city whose name contains this keyword. It is not critical whether you enter the entire city name or only a part of it. For example, Paris, Par or ari will all return Paris in the search results.

There are two optional parameters to help you make the query more precise - countryCode and max. The countryCode is a string for the ISO 3166 Alpha-2 code of the country where you need to locate a city, for example, FR for France. The max is an integer that defines the maximum number of search results.

You can also include a list of airports for each city returned in the search results. To do this, you need to add AIRPORTS to the include field, which is an array of strings defining additional resources for your search.

Let's check out the results for keyword PAR. We will limit the search scope to FR and the number of results to two.

GET https://test.api.amadeus.com/v1/reference-data/locations/cities?countryCode=FR&keyword=PAR&max=2\n

The results are probably rather predictable:

{\n  \"meta\": {\n    \"count\": 2,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/reference-data/locations/cities?countryCode=FR&keyword=PAR&max=2\"\n    }\n  },\n  \"data\": [\n    {\n      \"type\": \"location\",\n      \"subType\": \"city\",\n      \"name\": \"Paris\",\n      \"iataCode\": \"PAR\",\n      \"address\": {\n        \"countryCode\": \"FR\",\n        \"stateCode\": \"FR-75\"\n      },\n      \"geoCode\": {\n        \"latitude\": 48.85341,\n        \"longitude\": 2.3488\n      }\n    },\n    {\n      \"type\": \"location\",\n      \"subType\": \"city\",\n      \"name\": \"Le Touquet-Paris-Plage\",\n      \"iataCode\": \"LTQ\",\n      \"address\": {\n        \"countryCode\": \"FR\",\n        \"stateCode\": \"FR-62\"\n      },\n      \"geoCode\": {\n        \"latitude\": 50.52432,\n        \"longitude\": 1.58571\n      }\n    }\n  ]\n}\n

First of all we see the French capital at the top of the list. The second result refers to the town Le Touquet-Paris-Plage, whose official name contains three letters that match our keyword. If we want to see more results, we can always adjust the max number of results.

The main difference between the Airport & City Search API and City Search API is that the Airport & City Search API only shows cities that have an airport, while the City Search API retrieves any city that matches a keyword.

"},{"location":"resources/market-insight/","title":"Market insights","text":"

With Amadeus Self-Service APIs, you can get insights from millions of bookings and our technology partners. In the Market insights category, we have four APIs available.

Information

Our catalogue of Self-Service APIs is currently organised by categories that are different to what you see on this page.

APIs Description Flight Most Traveled Destinations See the top destinations by passenger volume for a given city and month. Flight Most Booked Destinations See the top destinations by booking volume for a given city and month. Flight Busiest Traveling Period See monthly air traffic levels by city to understand season trends. Location Score Assess a neighborhood\u2019s popularity for sightseeing, shopping, eating out, or nightlife."},{"location":"resources/market-insight/#find-the-top-destinations-or-the-busiest-period-for-a-given-city","title":"Find the top destinations or the busiest period for a given city","text":"

You may wonder which destination the travelers travel to the most and when is the busiest period for a given city. You can get the travel insight from a given city and month with the following three endpoints.

Information

  • The results of these three endpoints are based on estimated flight traffic summary data from the past 12 months.
  • Flight traffic summary data is based on bookings made over Amadeus systems.
"},{"location":"resources/market-insight/#the-top-destinations-by-passenger-volume","title":"The top destinations by passenger volume","text":"

Flight Most Traveled Destinations API returns the most visited destinations from a given city.

GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=NCE&period=2018-01\n
"},{"location":"resources/market-insight/#the-top-destinations-by-booking-volume","title":"The top destinations by booking volume","text":"

Flight Most Booked Destinations API returns the most booked destinations from a given city.

GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=NCE&period=2018-01\n
"},{"location":"resources/market-insight/#the-busiest-monthperiod-by-air-traffic","title":"The busiest month/period by air traffic","text":"

Flight Busiest Traveling Period API returns the peak periods for travel to/from a specific city.

GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=NCE&period=2018\n
"},{"location":"resources/market-insight/#response","title":"Response","text":"

The three endpoints have the same response structure.

Response to the top destinations from a given city :

{\n    \"meta\": {\n        \"count\": 8,\n        \"links\": {\n            \"self\": \"https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=NCE&page%5Blimit%5D=10&page%5Boffset%5D=0&period=2018-01&sort=analytics.travelers.score\"\n        }\n    },\n    \"data\": [\n        {\n            \"type\": \"air-traffic\",\n            \"destination\": \"PAR\",\n            \"subType\": \"BOOKED\",\n            \"analytics\": {\n                \"flights\": {\n                    \"score\": 100\n                },\n                \"travelers\": {\n                    \"score\": 100\n                }\n            }\n        },\n        {\n            \"type\": \"air-traffic\",\n            \"destination\": \"MAD\",\n            \"subType\": \"BOOKED\",\n            \"analytics\": {\n                \"flights\": {\n                    \"score\": 10\n                },\n                \"travelers\": {\n                    \"score\": 8\n                }\n            }\n        }\n    ]\n}\n

Response to the busines period from a given city :

{\n    \"meta\": {\n        \"count\": 3,\n        \"links\": {\n            \"self\": \"https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=PAR&direction=ARRIVING&period=2018\"\n        }\n    },\n    \"data\": [\n        {\n            \"type\": \"air-traffic\",\n            \"period\": \"2018-03\",\n            \"analytics\": {\n                \"travelers\": {\n                    \"score\": 34\n                }\n            }\n        },\n        {\n            \"type\": \"air-traffic\",\n            \"period\": \"2018-02\",\n            \"analytics\": {\n                \"travelers\": {\n                    \"score\": 33\n                }\n            }\n        },\n        {\n            \"type\": \"air-traffic\",\n            \"period\": \"2018-01\",\n            \"analytics\": {\n                \"travelers\": {\n                    \"score\": 33\n                }\n            }\n        }\n    ]\n}\n
  • subType is BOOKED or TRAVELED, depending on the endpoint.
  • In analytics, the score in flight is flights to this destination as a percentage of total departures, and the score in traveler is the number of passengers traveling to the destination as a percentage of total passenger departures.
"},{"location":"resources/market-insight/#sorting","title":"Sorting","text":"

Sorting is enabled on the \"top destinations\" endpoints.

  • analytics.flights.score - sort destination by flights score (decreasing)
  • analytics.travelers.score - sort destination by traveler's score (decreasing)

For example :

GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=NCE&period=2018-01&sort=analytics.travelers.score\n
"},{"location":"resources/market-insight/#direction","title":"Direction","text":"

For the Flight Busiest Traveling Period insight, you can specify the direction as:

  • ARRIVING for statistics on travelers arriving in the city
  • DEPARTING for statistics on travelers leaving the city

By default, statistics are given on travelers ARRIVING in the city.

GET https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=PAR&period=2018&direction=ARRIVING\n
"},{"location":"resources/market-insight/#find-insight-within-a-given-city","title":"Find insight within a given city","text":"

Apart from the top destinations and busiest period insight in a city, you can also help users gain insights into a neighborhood, hotel, or vacation rental with the Location Score API.

For a given latitude and longitude, it provides popularity scores for the following leisure and tourism categories:

  • Sightseeing
  • Restaurants
  • Shopping
  • Nightlife

For each category, the API provides an overall popularity score as well as scores for select subcategories, such as luxury shopping, vegetarian restaurants, or historical sights. Location scores are on a simple 0-100 scale and are powered by the AVUXI TopPlace algorithm, which analyzes millions of online reviews, comments, and points of interest.

Notes

  • For each location, the API will return scores for a 200m., 500m., and 1500m. radius.
  • Scores indicate positive traveler sentiments and may not reflect the most visited locations.

Request:

curl https://test.api.amadeus.com/v1/location/analytics/category-rated-areas?latitude=41.397158&longitude=2.160873\n

Response:

{\n  \"data\": [\n    {\n      \"type\": \"category-rated-area\",\n      \"geoCode\": {\n        \"latitude\": 41.397158,\n        \"longitude\": 2.160873\n      },\n      \"radius\": 200,\n      \"categoryScores\": {\n        \"sight\": {\n          \"overall\": 87,\n          \"historical\": 83,\n          \"beachAndPark\": 0\n        },\n        \"restaurant\": {\n          \"overall\": 92,\n          \"vegetarian\": 61\n        },\n        \"shopping\": {\n          \"overall\": 96,\n          \"luxury\": 96\n        },\n        \"nightLife\": {\n          \"overall\": 86\n        }\n      }\n    },\n    {\n      \"type\": \"category-rated-area\",\n      \"geoCode\": {\n        \"latitude\": 41.397158,\n        \"longitude\": 2.160873\n      },\n      \"radius\": 500,\n      \"categoryScores\": {\n        \"sight\": {\n          \"overall\": 99,\n          \"historical\": 69,\n          \"beachAndPark\": 0\n        },\n        \"restaurant\": {\n          \"overall\": 94,\n          \"vegetarian\": 71\n        },\n        \"shopping\": {\n          \"overall\": 99,\n          \"luxury\": 99\n        },\n        \"nightLife\": {\n          \"overall\": 88\n        }\n      }\n    }\n  ],\n  \"meta\": {\n    \"count\": 3,\n    \"links\": {\n      \"self\": \"https://test.api.amadeus.com/v1/location/analytics/category-rated-areas?latitude=41.397158&longitude=2.160873\"\n    }\n  }\n}\n
"},{"location":"resources/travel-safety/","title":"Travel Safety","text":"

Amadeus for Developers provides travel safety data making it easy for developers to build applications that keep travelers safe at every step of the journey.

APIs Description Safe Place Provides updated safety and security ratings for over 65,000 cities and neighborhoods worldwide, helping travelers consult and compare destination safety."},{"location":"resources/travel-safety/#search-by-an-area","title":"Search by an area","text":"

With the Safe Place API you can find categorized risk levels with neighborhood-level granularity. You will get an overall safety score and scores for six-component categories:

  • Women\u2019s Safety
  • Health & Medical Safety
  • Physical Harm
  • Theft
  • Political Freedoms
  • LGBTQ+ Safety
            \"subType\": \"CITY\",\n            \"name\": \"Seoul\",\n            \"geoCode\": {\n                \"latitude\": 37.566534999999995,\n                \"longitude\": 126.97796899999999\n            },\n            \"safetyScores\": {\n                \"lgbtq\": 45,\n                \"medical\": 45,\n                \"overall\": 35,\n                \"physicalHarm\": 33,\n                \"politicalFreedom\": 28,\n                \"theft\": 44,\n                \"women\": 34\n            }\n        }\n

Safety scores range on a scale of 1-100, with 1 being the safest and 100 being the least safe. In this example of Seoul, South Korea, a \u201cpoliticalFreedom\u201d score of 28 indicates that the potential for infringement of political rights or political unrest is less likely to happen at this location.

Each location found by the Safe Place API is shown with its Amadeus location Id, which can be used in subsequent search queries:

\"type\": \"safety-rated-location\",\n      \"id\": \"Q930402720\"\n
"},{"location":"resources/travel-safety/#available-blog-articles","title":"Available blog articles","text":"

How to build a neighborhood safety map in Python with Amadeus Safe Place

"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 00000000..cc23a1d3 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,193 @@ + + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/api-rate-limits/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/common-errors/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/faq/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/glossary/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/pagination/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/pricing/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/quick-start/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/test-data/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/API-Keys/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/API-Keys/authorization/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/API-Keys/moving-to-production/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/java/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/mock-server/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/node/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/openapi-generator/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/php/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/postman/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/python/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/graphql/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/graphql/rest-to-graphql-export/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/graphql/rest-to-graphql-node/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/developer-tools/graphql/rest-to-graphql-python/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/examples/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/examples/code-example/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/examples/live-examples/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/examples/prototypes/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/migration-guides/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/migration-guides/hotel-search/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/cars-transfers/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/destination-experiences/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/flights/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/hotels/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/itinerary-managment/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/market-insight/ + 2023-12-19 + daily + + + https://developers.amadeus.com/self-service/apis-docs/guides/developer-guides/resources/travel-safety/ + 2023-12-19 + daily + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 00000000..c2859dfd Binary files /dev/null and b/sitemap.xml.gz differ diff --git a/stylesheets/extra.css b/stylesheets/extra.css new file mode 100644 index 00000000..6a07ac0f --- /dev/null +++ b/stylesheets/extra.css @@ -0,0 +1,54 @@ +:root { + /* Primary color shades */ + --md-primary-fg-color--light: #3A8BFF; + --md-primary-fg-color--dark: #3A8BFF; + --md-accent-fg-color: #3A8BFF; + + } + .md-header { + background-color: #000835; + } + .md-typeset a { + color: #3A8BFF; + } + .md-footer-meta { + background-color: #000835; + } + .md-footer { + background-color: #C5D5F9; + color: #000835 + } + .md-nav__item .md-nav__link--active { + color:#3A8BFF; + } + +@font-face { + font-family: 'AmadeusNeue'; + src: url('../fonts/AmadeusNeue-Light.woff2') format('woff2'), + url('../fonts/AmadeusNeue-Light.woff') format('woff'), + url('../fonts/AmadeusNeue-Light.ttf') format('truetype'), + url('../fonts/AmadeusNeue-Light.otf') format('opentype'); + font-weight: light; + font-style: normal; +} + +@font-face { + font-family: 'AmadeusNeue'; + src: url('../fonts/AmadeusNeue-Bold.woff2') format('woff2'), + url('../fonts/AmadeusNeue-Bold.woff') format('woff'), + url('../fonts/AmadeusNeue-Bold.ttf') format('truetype'), + url('../fonts/AmadeusNeue-Bold.otf') format('opentype'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'AmadeusNeue'; + src: url('../fonts/AmadeusNeue-Regular.woff2') format('woff2'), + url('../fonts/AmadeusNeue-Regular.woff') format('woff'), + url('../fonts/AmadeusNeue-Regular.ttf') format('truetype'), + url('../fonts/AmadeusNeue-Regular.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} + diff --git a/test-data/index.html b/test-data/index.html new file mode 100644 index 00000000..bdf1ff77 --- /dev/null +++ b/test-data/index.html @@ -0,0 +1,2099 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Free test data collection - Amadeus for Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Free test data collection of Self-Service APIs

+

Amadeus for Developers offers a test environment with free limited data. This allows developers to build and test their applications before deploying them to production. To access real-time data, you will need to move to the production environment.

+
+

Warning

+

It is important to note that the test environment protects our customers and data and it's exclusively intended for development purposes.

+
+

Test vs Production

+

The test environment has the following differences with the production:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
BillingRate LimitsDataBase URL
TestFree monthly quota10 TPSLimited, cachedtest.api.amadeus.com
ProductionUnlimited40 TPSUnlimited, real-timeapi.amadeus.com
+

Check out the rate limits guide and pricing page if you want to get more information on the specific topics. In this tutorial you can learn how to build a mock server in Postman to help you consume less of your free quota.

+
+

Important

+

Please note that in the production environment, you will only be charged for API calls that exceed the monthly free limit. Our Flight Order Management API, for instance, may offer a free limit of up to 10,000 calls. So, by registering for production, you can enjoy the benefits of free quotas while accessing our APIs for the latest and unrestricted data without any hidden costs.

+
+

API usage

+

To make sure you don't pass your monthly quota, you can go to My Self-Service Workspace > API usage and quota and review how many transactions you've performed. In case you pass the limit, you will need to wait for the new month and your quota will be renewed.

+
+

Information

+

It may take up to 12 minutes to display your most recent API calls.

+
+

The table below details the available test data for each Self-Service API:

+

Test Data Collection

+

Travel safety

+ + + + + + + + + + + + + +
APITest data
Safe PlaceSee list of valid cities.
+

Flights

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
APITest data
Flight Inspiration SearchCached data including most origin and destination cities.
Flight Cheapest Date SearchCached data including most origin and destination cities.
Flight Availabilities SearchCached data including most origin and destination cities/airports.
Airport RoutesStatic dataset containing all airport routes in November 2021.
Airline RoutesStatic dataset containing all airport routes in November 2021.
Flight Offers SearchCached data including most origin and destination cities/airports.
Flight Offers PriceCached data including most origin and destination cities/airports.
Branded Fares UpsellCached data including most airlines.
SeatMap DisplayWorks with the response of Flight Offers Search.
Flight Create OrdersWorks with the response of Flight Offers Price.
Flight Order ManagementWorks with the response of Flight Create Orders.
Flight Price AnalysisContains the following routes in both test and production environments.
Flight Delay PredictionNo data restrictions in test.
Airport On-time PerformanceNo data restrictions in test.
Flight Choice PredictionNo data restrictions in test.
On Demand Flight StatusContains a copy of live data at a given time and real-time updates are not supported. Check out the differences between test and production environment.
Airline Code LookupNo data restrictions in test.
Airport & City SearchCities/airports in the United States, Spain, the United Kingdom, Germany and India.
Airport Nearest RelevantCities/airports in the United States, Spain, the United Kingdom, Germany and India.
Flight Check-in LinksSee list of valid airlines.
Travel RecommendationsNo data restrictions in test.
+

Hotels

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
APITest data
Hotel ListSee list of valid hotel chains.
Hotel SearchSee list of valid hotel chains. Test with major cities like LON or NYC.
Hotel BookingWorks with the response of Hotel Search.
Hotel RatingsSee list of valid hotels.
Hotel Name AutocompleteCached data including most hotels available through Amadeus
+

Destination experiences

+ + + + + + + + + + + + + + + + + + + + + +
APITest data
Points of InterestSee list of valid cities.
Tours and ActivitiesSee list of valid cities.
City SearchNo data restrictions in test.
+

Itinerary management

+ + + + + + + + + + + + + + + + + +
APITest data
Trip ParserNo data restrictions in test.
Trip Purpose PredictionNo data restrictions in test.
+

Market insights

+ + + + + + + + + + + + + + + + + + + + + + + + + +
APITest data
Flight Most Traveled DestinationsSee list of origin and destination cities/airports.
Flight Most Booked DestinationsSee list of origin and destination cities/airports.
Flight Busiest Traveling PeriodSee list of origin and destination cities/airports.
Location ScoreSee list of valid cities.
+

Video Tutorial

+

Check out this video to know more about the differences between Test and Production from Get Started with Amadeus Self-Service APIs Series.

+

+ +
+
+ + + Last update: + December 19, 2023 + + + +
+ + + + + + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file

Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Java using the Amadeus Java SDK here.