{"id":37395612,"url":"https://github.com/amadeus4dev-examples/amadeus-android","last_synced_at":"2026-01-16T05:36:51.954Z","repository":{"id":45409030,"uuid":"251277473","full_name":"amadeus4dev-examples/amadeus-android","owner":"amadeus4dev-examples","description":"Android (Kotlin) library for the Amadeus Self-Service travel APIs ","archived":false,"fork":false,"pushed_at":"2022-09-19T12:53:36.000Z","size":3421,"stargazers_count":22,"open_issues_count":14,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-14T04:22:58.531Z","etag":null,"topics":["amadeus","android","api","kotlin","sdk","travel"],"latest_commit_sha":null,"homepage":"https://developers.amadeus.com/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amadeus4dev-examples.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T10:54:41.000Z","updated_at":"2025-08-25T16:51:32.000Z","dependencies_parsed_at":"2023-01-18T14:16:47.130Z","dependency_job_id":null,"html_url":"https://github.com/amadeus4dev-examples/amadeus-android","commit_stats":null,"previous_names":["amadeus4dev/amadeus-android"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/amadeus4dev-examples/amadeus-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amadeus4dev-examples","download_url":"https://codeload.github.com/amadeus4dev-examples/amadeus-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amadeus","android","api","kotlin","sdk","travel"],"created_at":"2026-01-16T05:36:51.848Z","updated_at":"2026-01-16T05:36:51.931Z","avatar_url":"https://github.com/amadeus4dev-examples.png","language":"Kotlin","readme":"# Amadeus Android (Kotlin) SDK\n\n[![Build and Deploy](https://github.com/amadeus4dev/amadeus-android/actions/workflows/build.yml/badge.svg)](https://github.com/amadeus4dev/amadeus-android/actions/workflows/build.yml)\n[![Discord](https://img.shields.io/discord/696822960023011329?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/cVrFBqx)\n\nAmadeus has a rich set of APIs for the travel industry. For more details, check out the [Amadeus for Developers Portal](https://developers.amadeus.com).\n\n## :warning: Important message :warning:\n\n:heavy_exclamation_mark: This SDK is maintained **by the developer community only**. The Amadeus for Developers team doesn't support or maintain it. :heavy_exclamation_mark:\n\n\n## Installation\n\nThis library requires Java version 1.8 and Kotlin version 1.3.70 minimum.\n\nYou can install the SDK via Maven or Gradle.\n\n#### Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.amadeus\u003c/groupId\u003e\n  \u003cartifactId\u003eamadeus-android\u003c/artifactId\u003e\n  \u003cversion\u003e1.3.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n#### Gradle\n```kotlin\nimplementation 'com.amadeus:amadeus-android:1.3.1'\n```\n\n## Getting Started\n\nTo make your first API call, you will need to [register](https://developers.amadeus.com/register) for an Amadeus Developer Account and [set up your first application](https://developers.amadeus.com/my-apps).\n\n```kotlin\n// Being in an Activity/Fragment/ViewModel or any file you want\n\nimport com.amadeus.android.Amadeus\nimport com.amadeus.android.ApiResult\nimport kotlinx.coroutines.CoroutineScope\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.SupervisorJob\nimport kotlinx.coroutines.launch\nimport android.util.Log;\n\nval job = SupervisorJob()\nval scope = CoroutineScope(Dispatchers.Main + job)\n\nval amadeus = Amadeus.Builder(context)\n    .setClientId(\"REPLACE_BY_YOUR_API_KEY\")\n    .setClientSecret(\"REPLACE_BY_YOUR_API_SECRET\")\n    .build()\n\nscope.launch {\n  when (val checkinLinks = amadeus.referenceData.urls.checkinLinks.get(airlineCode = \"LH\")) {\n    is ApiResult.Success -\u003e {\n      Log.d(\"Result\", \"${result.data}\")\n    }\n    is ApiResult.Error -\u003e {\n      // Handle your error\n    }\n  }\n}\n```\n\nAs you can see, we don't throw `Exceptions` (except for some specific cases) in the API, but we provide a `ApiResult.Error` object with all the information you need to know. Coroutines and exceptions are not good friends, so with this abstraction, you can handle every use case you want in a safe way.\n\n## Initialization\n\nThe client can be initialized using a dedicated builder:\n\n```kotlin\nval amadeus = Amadeus.Builder(context)\n    .setClientId(\"REPLACE_BY_YOUR_API_KEY\")\n    .setClientSecret(\"REPLACE_BY_YOUR_API_SECRET\")\n    .build()\n```\n\nAlternatively, it can be initialized without any parameters if the string resources `R.string.amadeus_client_id` and `R.string.amadeus_client_secret` are present.\n\n```kotlin\nAmadeus amadeus = Amadeus.Builder(context).build();\n```\n\n*__Warning__: Do not commit your credentials on GitHub.*\n\nWe recommend to add the credentials by including them in your app gradle file using one of these methods:\n\n```kotlin\n// Credentials from system env. variables, placed in App BuildConfig\ndev {\n    // Your build config...\n\n    //Amadeus credentials\n    if (System.getenv('amadeus.api.key') != null) {\n        buildConfigField \"String\", \"AMADEUS_CLIENT_ID\", System.getenv('amadeus.api.key')\n    } else {\n        buildConfigField \"String\", \"AMADEUS_CLIENT_ID\", \"\"\n    }\n    if (System.getenv('amadeus.api.secret') != null) { // Same as above\n        buildConfigField \"String\", \"AMADEUS_CLIENT_SECRET\", System.getenv('amadeus.api.secret')\n    } else {\n        buildConfigField \"String\", \"AMADEUS_CLIENT_SECRET\", \"\"\n    }\n}\n\n// Credentials from user-level gradle.properties files, placed in App Strings\n// /!\\ This method is suitable to use Builder without credentials parameters. /!\\\ndev {\n    // Your build config...\n\n    //Amadeus credentials\n    if (project.hasProperty(\"amadeus.api.key\")) {\n      resValue \"string\", \"amadeus_client_id\", property(\"amadeus.api.key\")\n    }\n    if (project.hasProperty(\"amadeus.api.secret\")) {\n        resValue \"string\", \"amadeus_client_secret\", property(\"amadeus.api.secret\")\n    }\n}\n```\n\n*__Note__: These are just examples, you can mix and match these approaches.*\n\nYour credentials can be found on the [Amadeus dashboard](https://developers.amadeus.com/my-apps).\n\nBy default, the SDK environment is set to `test` environment. To switch to a `production` (pay-as-you-go) environment, please switch the hostname as follows:\n\n```kotlin\nval amadeus = Amadeus.Builder(context)\n    .setHostName(Amadeus.Builder.Hosts.PRODUCTION)\n    .build();\n```\n\n## Documentation\n\nAmadeus has a large set of APIs, and our documentation is here to get you started today. Head over to our [API documentation](https://developers.amadeus.com/self-service)  for in-depth information about every API.\n\n## Making API calls\nThis library conveniently maps every API path to a similar path. You have 2 ways to call the API:\n\nThe first one is by passing the mandatory parameters (in the right order) only. For example, `GET /v2/reference-data/urls/checkin-links?airlineCode=BA` would be:\n\n```kotlin\namadeus.referenceData.urls.checkinLinks.get(\"BA\")\n```\n\n\nThe second way is to call the API by passing the name of the parameter before the value:\n```kotlin\namadeus.referenceData.urls.checkinLinks.get(airlineCode = \"BA\")\n```\n\nSimilarly, to select a resource by ID, you can pass in the ID to the **singular** path.\n\nFor example,  `GET /v2/shopping/hotel-offers/XXX` would be:\n\n```kotlin\namadeus.shopping.hotelOffer(\"XXX\").get()\n```\n\nYou can make any arbitrary API call as well directly with the `.get`, `.post` or `.delete` method. You will get a raw string version of the JSON response.\n\n```kotlin\nval stringResult = amadeus.get(\"https://test.api.amadeus.com/v1/travel/analytics/air-traffic/busiest-period?cityCode=MAD\u0026period=2017\u0026direction=ARRIVING\")\n```\n\nYou can then cast it into the corresponding object:\n\n```kotlin\nval type = Types.newParameterizedType(\n            List::class.java,\n            AirTraffic::class.java\n        )\nval resultType = Types.newParameterizedTypeWithOwner(\n            ApiResult::class.java,\n            Success::class.java,\n            type\n        )\nval adapter = moshi.adapter\u003cSuccess\u003cList\u003cAirTraffic\u003e\u003e\u003e(resultType)\nval airTraffic = adapter.fromJson(stringResult)\n```\n\n## Pagination\n\nIf an API endpoint supports pagination, the other pages are available under the\n`.next`, `.previous`, `.last` and `.first` methods.\n\n```kotlin\nval result = amadeus.referenceData.locations.pointsOfInterest.get(\n            latitude = 41.397158,\n            longitude = 2.160873,\n            radius = 2\n        )\n\n// Fetches the next page\nval next = amadeus.next(result)\n```\n\nIf a page is not available, the method will return `null`.\n\n## Logging \u0026 Debugging\nTo enable more verbose logging, you can set the appropriate level on your logger. The easiest way would be to enable debugging via a parameter on initialization. You can chose between:\n- `NONE`: No logs.\n- `BASIC`: Logs request and response lines.\n- `HEADERS`: Logs request and response lines and their respective headers.\n- `BODY`: Logs request and response lines and their respective headers and bodies (if present).\n\n```kotlin\nval amadeus = Amadeus.Builder(context)\n    .setLogLevel(Amadeus.Builder.LogLevel.BODY)\n    .build()\n```\n\n## List of supported endpoints\n```kotlin\n// Flight Inspiration Search\nval flightDestinations = amadeus.shopping.flightDestinations.get(origin = \"MAD\")\n\n// Flight Cheapest Date Search\nval flightDates = amadeus.shopping.flightDates.get(origin = \"MAD\", destination = \"MUC\")\n\n// Flight Offer Search v2 GET\nval flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n                            originLocationCode = \"SYD\",\n                            destinationLocationCode = \"BKK\",\n                            departureDate = \"2021-03-01\",\n                            returnDate = \"2021-03-08\",\n                            adults = 2,\n                            max = 3)\n\n// Flight Offer Search v2 POST\n// body can be a String version of your JSON or the body object\nval flightOffersSearches = amadeus.shopping.flightOffersSearch.post(body)\n\n// Flight Offers Price\nval pricing = amadeus.shopping.flightOffersSearch.pricing.post(flightOffersSearches.data.first())\n\n// Flight Create Orders\n// You can find how to define a complete working example\n// here: https://bit.ly/2zz9bTy\nval order = amadeus.booking.flightOrders.post(\n                    flightPrice = pricing.data,\n                    travelers = listOf(traveler)\n                )\n\n// Flight Order Management\n// Retrieve booking\n// The flightOrderID comes from the Flight Create Orders (in test environment it's temporary)\nval flightOffer = amadeus.booking.flightOrder(order.data.id).get()\n\n// Flight Order Management\n// Cancel booking\namadeus.booking.flightOrder(order.data.id).delete()\n\n// Flight Choice Prediction\n// Note that the example calls 2 APIs: Flight Offers Search \u0026 Flight Choice Prediction v2\nval flightOffersSearches = amadeus.shopping.flightOffersSearch.get(\n                            originLocationCode = \"SYD\",\n                            destinationLocationCode = \"BKK\",\n                            departureDate = \"2021-03-01\",\n                            adults = 1,\n                            max = 3)\n\n// Using a JSonObject\nTODO: Not implemented yet\n\n// Using a String\nTODO: Not implemented yet\n\n// Flight Check-in Links\nval checkinLinks = amadeus.referenceData.urls.checkinLinks.get(airlineCode = \"LH\")\n\n// Airline Code LookUp\nval airlines = amadeus.referenceData.airlines.get(airlineCodes = \"BA\")\n\n// Airport \u0026 City Search (autocomplete)\n// Find all the cities and airports starting by the keyword 'LON'\nval locations = amadeus.referenceData.locations.get(\n                  subType = listOf(Location.SubTypeEnum.AIRPORT.value, Location.SubTypeEnum.CITY.value),\n                  keyword = \"LON\")\n\n// Get a specific city or airport based on its id\nval location = amadeus.referenceData.location(\"ALHR\").get()\n\n// Airport Nearest Relevant (for London)\nval locations = amadeus.referenceData.locations.airports.get(\n                  latitude = 40.416775,\n                  longitude = -3.703790)\n\n// Flight Most Booked Destinations\nval airTraffics = amadeus.travel.analytics.airTraffic.booked.get(\n                    originCityCode = \"MAD\",\n                    period = \"2017-05\")\n\n// Flight Most Traveled Destinations\nval airTraffics = amadeus.travel.analytics.airTraffic.traveled.get(\n                    originCityCode = \"MAD\",\n                    period = \"2017-05\")\n\n// Flight Busiest Traveling Period\nval busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get(\n                      cityCode = \"MAD\",\n                      period = \"2017\",\n                      direction = \"ARRIVING\")\n\n// Hotel Search API\n// Get list of hotels by city code\nval offers = amadeus.shopping.hotelOffers.get(cityCode = \"PAR\")\n// Get list of offers for a specific hotel\nval offers = amadeus.shopping.hotelOffersByHotel.get(hotelId = \"BGLONBGB\")\n// Confirm the availability of a specific offer\nval offer = amadeus.shopping.hotelOffer(offers.data.offers?.get(0)?.id ?: \"\").get()\n\n// Hotel Booking\nval hotelBooking = amadeus.booking.hotelBooking.post(body);\n\n// Hotel Ratings / Sentiments\nval hotelSentiments = amadeus.ereputation.hotelSentiments.get(listOf(\"TELONMFS\",\"ADNYCCTB\",\"XXXYYY01\"))\n\n// Points of Interest\n// What are the popular places in Barcelona (based a geo location and a radius)\nval pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get(\n                        latitude = 41.397158,\n                        longitude = 2.160873)\n\n// What are the popular places in Barcelona? (based on a square)\nval pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.bySquare.get(\n                        north = 41.397158,\n                        west = 2.160873,\n                        south = 41.394582,\n                        east = 2.177181)\n\n// Returns a single Point of Interest from a given id\nval pointOfInterest = amadeus.referenceData.locations.pointsOfInterest(\"9CB40CB5D0\").get()\n\n// Tours \u0026 Activities\n// What are the popular activities in Madrid (based a geo location and a radius)\nval activities = amadeus.shopping.activities.get(\n                    latitude = 41.397158,\n                    longitude = 2.160873,\n                    radius = 2)\n\n// What are the popular activities in Barcelona? (based on a square)\nval activities = amadeus.shopping.activities.bySquare.get(\n                    north = 41.397158,\n                    west = 2.160873,\n                    south = 41.394582,\n                    east = 2.177181)\n\n// Returns a single activity from a given id\nval activity = amadeus.shopping.activity(\"23642\").get()\n\n// Safe Place\n// How safe is Barcelona? (based a geo location and a radius)\nval safetyScores = amadeus.safety.safetyRatedLocations.get(\n                     latitude = 41.397158,\n                     longitude = 2.160873,\n                     radius = 2)\n\n// How safe is Barcelona? (based on a square)\nval safetyScores = amadeus.safety.safetyRatedLocations.bySquare.get(\n                      north = 41.397158,\n                      west = 2.160873,\n                      south = 41.394582,\n                      east = 2.177181)\n\n// What is the safety information of a location based on it's Id?\nval safetyScore = amadeus.safety.safetyRatedLocation(\"Q930402753\").get()\n\n\n// Airport On-Time Performance\n// What's the likelihood flights from this airport will leave on time?\nval airportOnTime = amadeus.airport.predictions.onTime.get(\n                      airportCode = \"BOS\",\n                      date = \"2021-12-01\")\n\n// Flight Delay Prediction\n// What's the likelihood of a given flight to be delayed?\nval flightDelay = amadeus.travel.predictions.flightDelay.get(\n                    originLocationCode = \"NCE\",\n                    destinationLocationCode = \"IST\",\n                    departureDate = \"2020-08-01\",\n                    departureTime = \"18:20:00\",\n                    arrivalDate = \"2020-08-01\",\n                    arrivalTime = \"22:15:00\",\n                    aircraftCode = \"321\",\n                    carrierCode = \"TK\",\n                    flightNumber = \"1816\",\n                    duration = \"PT31H10M\")\n\n// Trip Purpose Prediction\nval tripPurpose = amadeus.travel.predictions.tripPurpose.get(\n                    originLocationCode = \"NYC\",\n                    destinationLocationCode = \"MAD\",\n                    departureDate = \"2021-12-01\",\n                    returnDate = \"2021-12-12\",\n                    searchDate = \"2021-05-20\")\n\n// SeatMap Display\n// What is the the seat map of a given flight?\nval seatMaps = amadeus.shopping.seatMaps.get(flightOfferId = \"eJzTd9f3NjIJdzUGAAp%2fAiY=\")\n\n// What is the the seat map of a given flight?\n// The body can be a String version of your JSON or a Object\nval flightOffers = amadeus.get(\"https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=MAD\u0026destinationLocationCode=MUC\u0026departureDate=2021-03-22\u0026adults=1\u0026max=1\")\nval seatMaps = amadeus.shopping.seatMaps.post(flightOffers)\n\n// On-Demand Flight Status\n// Retrieve status of a given flight\nval flightStatus = amadeus.schedule.flights.get(\n         carrierCode = \"IB\",\n         flightNumber = \"532\",\n         scheduleDepartureDate = \"2021-03-23\")\n\n// Travel Recommendations\nval recommendedLocations = amadeus.referenceData.recommendedLocations.get(\n                            cityCodes = \"PAR\",\n                            travelerCountryCode = \"FR\")\n\n// Flight Price Analysis\nval priceMetrics = amadeus.analytics.itineraryPriceMetrics.get(\n                originIataCode = \"MAD\",\n                destinationIataCode = \"CDG\",\n                departureDate = \"2021-03-21\"\n            )\n```\n\n## Development \u0026 Contributing\n\nWant to contribute? Read our [Contributors Guide](.github/CONTRIBUTING.md) for\nguidance on installing and running this code in a development environment.\n\n## License\n\nThis library is released under the [MIT License](LICENSE).\n\n## Help\n\nYou can find us on [StackOverflow](https://stackoverflow.com/questions/tagged/amadeus) or join our developer community on\n[Discord](https://discord.gg/cVrFBqx).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadeus4dev-examples%2Famadeus-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famadeus4dev-examples%2Famadeus-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadeus4dev-examples%2Famadeus-android/lists"}