{"id":37009501,"url":"https://github.com/amadeus4dev-examples/amadeus-php","last_synced_at":"2026-01-14T00:53:57.769Z","repository":{"id":36991567,"uuid":"464652168","full_name":"amadeus4dev-examples/amadeus-php","owner":"amadeus4dev-examples","description":"PHP library for the Amadeus Self-Service APIs ","archived":false,"fork":false,"pushed_at":"2023-01-02T14:35:39.000Z","size":1673,"stargazers_count":16,"open_issues_count":13,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-19T11:31:44.733Z","etag":null,"topics":["amadeus","api","php","sdk","travel"],"latest_commit_sha":null,"homepage":"https://amadeus4dev-examples.github.io/amadeus-php/","language":"PHP","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":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-28T21:36:47.000Z","updated_at":"2025-09-09T08:36:29.000Z","dependencies_parsed_at":"2023-01-17T12:01:43.650Z","dependency_job_id":null,"html_url":"https://github.com/amadeus4dev-examples/amadeus-php","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/amadeus4dev-examples/amadeus-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amadeus4dev-examples","download_url":"https://codeload.github.com/amadeus4dev-examples/amadeus-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadeus4dev-examples%2Famadeus-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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","api","php","sdk","travel"],"created_at":"2026-01-14T00:53:55.618Z","updated_at":"2026-01-14T00:53:57.198Z","avatar_url":"https://github.com/amadeus4dev-examples.png","language":"PHP","readme":"# Amadeus PHP SDK\n\n[![Tests](https://github.com/amadeus4dev/amadeus-php/actions/workflows/build.yml/badge.svg)](https://github.com/amadeus4dev/amadeus-php/actions/workflows/build.yml)\n[![Packagist](https://img.shields.io/packagist/v/amadeus4dev/amadeus-php.svg)](https://packagist.org/packages/amadeus4dev/amadeus-php)\n[![Packagist](https://img.shields.io/packagist/dt/amadeus4dev/amadeus-php.svg)](https://packagist.org/packages/amadeus4dev/amadeus-php)\n[![Discord](https://img.shields.io/discord/696822960023011329?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/cVrFBqx)\n\nAmadeus provides 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\nJump To:\n* [Installation](#Installation)\n* [Getting Started](#Getting-Started)\n* [Initialization](#Initialization)\n* [Using SSL Certificate](#Using-SSL-Certificate)\n* [Documentation](#Documentation)\n* [Making API Calls](#Making-API-Calls)\n* [Response](#Response)\n* [Logging and Debugging](#Logging-and-Debugging)\n* [List of Supported Endpoints](#List-of-Supported-Endpoints)\n* [Development and Contributing](#Development-and-Contributing)\n* [Getting Help](#Getting-Help)\n\n## Installation\n\nThis library requires PHP 7.4+. You can install the SDK via [Composer](https://getcomposer.org/)\n\n``` \ncomposer require amadeus4dev/amadeus-php\n```\n\n## Getting Started\n\nTo make your first API call you will need to [register for an Amadeus\nDeveloper Account](https://developers.amadeus.com/create-account) and set up\nyour first application.\n\n```PHP \n\u003c?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        -\u003ebuild();\n\n    // Flight Offers Search GET\n    $flightOffers = $amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003eget(\n                        array(\n                            \"originLocationCode\" =\u003e \"PAR\",\n                            \"destinationLocationCode\" =\u003e \"MAD\",\n                            \"departureDate\" =\u003e \"2022-12-29\",\n                            \"adults\" =\u003e 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\": \"2022-12-29\"\n                  }\n                }\n              ],\n              \"travelers\": [\n                {\n                  \"id\": \"1\",\n                  \"travelerType\": \"ADULT\"\n                }\n              ],\n              \"sources\": [\n                \"GDS\"\n              ]\n            }';\n    $flightOffers = $amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003epost($body);\n    print $flightOffers[0];\n} catch (ResponseException $e) {\n    print $e;\n}\n```\n\n## Initialization\nThe client can be initialized directly:\n```PHP\n//Initialize using parameters\n$amadeus = Amadeus\n    ::builder(\"REPLACE_BY_YOUR_API_KEY\", \"REPLACE_BY_YOUR_API_SECRET\")\n    -\u003ebuild();\n```\n\nAlternatively, it can be initialized without any parameters if the environment variables ``AMADEUS_CLIENT_ID`` and ``AMADEUS_CLIENT_SECRET`` are present.\n```PHP\n$amadeus = Amadeus\n    ::builder()\n    -\u003ebuild();\n```\n\nYour credentials can be found on the [Amadeus dashboard](https://developers.amadeus.com/my-apps).\n\nBy default, the SDK is set to `test` environment. To switch to a `production` (pay-as-you-go) environment, please switch the hostname as follows:\n\n```PHP\n//Initialize using parameters\n$amadeus = Amadeus\n    ::builder(\"REPLACE_BY_YOUR_API_KEY\", \"REPLACE_BY_YOUR_API_SECRET\")\n    -\u003esetProductionEnvironment()\n    -\u003ebuild();\n```\n\n## Using SSL Certificate\nThis library is using PHP core extension cURL for making Http Request but disabling the options for SSL certificate verification. \nThus it is highly suggested using a certificate with PHP’s cURL functions.\n\nYou can download the ```cacert.pem``` certificate bundle from the [official cURL website](https://curl.se/docs/caextract.html). \nOnce you have downloaded the ```cacert.pem``` file, you should move it to whatever directory makes the most sense for you and your setup.\n\n```PHP\n// Set your certificate path for opening SSL verification\n$amadeus-\u003egetClient()-\u003esetSslCertificate($REPLACE_BY_YOUR_SSL_CERT_PATH);\n```\n\n## Documentation\n\nAmadeus has a large set of APIs, and our documentation is here to get you started. Head over to our [reference documentation](https://amadeus4dev-examples.github.io/amadeus-php/) for in-depth information about every SDK method, its arguments and return types.\n\n## Making API Calls\n\nThis library conveniently maps every API path to a similar path. \n\nFor example, `GET /v1/airport/direct-destinations?departureAirportCode=MAD` would be:\n\n```PHP\n$amadeus-\u003egetAirport()-\u003egetDirectDestinations()-\u003eget([\"departureAirportCode\" =\u003e \"MAD\"]);\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```PHP\n$amadeus-\u003egetShopping()-\u003egetHotelOffer(\"XXX\")-\u003eget();\n```\n\nAdditionally, You can make any arbitrary API call as well directly with the methods provided below:\n\n```PHP\n// Make a GET request only using path\n$amadeus-\u003egetClient()-\u003egetWithOnlyPath(\"/v1/airport/direct-destinations?departureAirportCode=MAD\");\n\n// Make a GET request using path and passed parameters\n$amadeus-\u003egetClient()-\u003egetWithArrayParams(\"/v1/airport/direct-destinations\", [\"departureAirportCode\" =\u003e \"MAD\"]);\n\n// Make a POST request using path and passed body\n$amadeus-\u003egetClient()-\u003epostWithStringBody(\"/v1/shopping/availability/flight-availabilities\", $body);\n```\n\nKeep in mind, this returns a raw `Resource`.\n\n\n## Response\nEvery successful API call returns a ```Resource``` object. The ```Resource``` object has the raw response body (in string format) available:\n\n```PHP\n$locations = $amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003eget(\n                array(\n                    \"subType\" =\u003e \"CITY\",\n                    \"keyword\" =\u003e \"PAR\"\n                )\n            );\n\n// The raw response, as a string\n$locations[0]-\u003egetResponse()-\u003egetResult(); // Include response headers\n$locations[0]-\u003egetResponse()-\u003egetBody(); //Without response headers\n\n// Directly get response headers as an array\n$locations[0]-\u003egetResponse()-\u003egetHeadersAsArray();\n\n// Directly get response body as a Json Object\n$locations[0]-\u003egetResponse()-\u003egetBodyAsJsonObject();\n\n// Directly get the data part of response body\n$locations[0]-\u003egetResponse()-\u003egetData();\n\n// Directly get the dictionary part of the response body\n$locations[0]-\u003egetResponse()-\u003egetDictionary();\n```\n\n## Logging and Debugging\nYou can enable debugging in the default HTTP client via a parameter during initialization, or using the ```AMADEUS_LOG_LEVEL``` environment variable.\n\n```PHP\n$amadeus = Amadeus::builder()\n    -\u003esetLogLevel(\"debug\")\n    -\u003ebuild();\n```\n\n## List of Supported Endpoints\n```PHP\n/* Flight Offers Search GET */\n// function get(array $params) :\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003eget(\n    array(\n        \"originLocationCode\" =\u003e \"PAR\",\n        \"destinationLocationCode\" =\u003e \"MAD\",\n        \"departureDate\" =\u003e \"2022-12-29\",\n        \"adults\" =\u003e 1\n));\n\n/* Flight Offers Search POST */\n// function get(string $body) :\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003epost($body);\n\n/* SeatMap Display */\n// function get(string $params)\n$amadeus-\u003egetShopping()-\u003egetSeatMaps()-\u003eget(\n    array(\n        \"flightOrderId\" =\u003e \"eJzTd9f3NjIJdzUGAAp%2fAiY=\"   \n    )\n)\n// function post(string $body)\n$amadeus-\u003egetShopping()-\u003egetSeatMaps()-\u003epost($body)\n\n/* Flight Offers Price */\n// function post(string $body) :\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003egetPricing()-\u003epost($body);\n// function postWithFlightOffers(array $flightOffers, ?array $payments = null, ?array $travelers = null, ?array $params = null) : \n$flightOffers = $this-\u003egetShopping()-\u003egetFlightOffers()-\u003eget([\"originLocationCode\"=\u003e\"SYD\", \"destinationLocationCode\"=\u003e\"BKK\", \"departureDate\"=\u003e\"2022-11-01\", \"adults\"=\u003e1, \"max\"=\u003e6]);\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003egetPricing()-\u003epostWithFlightOffers($flightOffers);\n            \n/* Flight Create Orders */\n// function post(string $body) :\n$amadeus-\u003egetBooking()-\u003egetFlightOrders()-\u003epost($body);\n// function postWithFlightOffersAndTravelers(array $flightOffers, array $travelers);\n$amadeus-\u003egetBooking()-\u003egetFlightOrders()-\u003epostWithFlightOffersAndTravelers($flightOffers, $travelers);\n\n/* Flight Choice Prediction */\n// function post(string $body) :\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003egetPrediction()-\u003epost($body);\n// function postWithFlightOffers(array $flightOffers) : \n$flightOffers = $this-\u003egetShopping()-\u003egetFlightOffers()-\u003eget([\"originLocationCode\"=\u003e\"LON\", \"destinationLocationCode\"=\u003e\"NYC\", \"departureDate\"=\u003e\"2022-12-06\", \"adults\"=\u003e1, \"max\"=\u003e20]);\n$amadeus-\u003egetShopping()-\u003egetFlightOffers()-\u003egetPrediction()-\u003epostWithFlightOffers($flightOffers);\n\n/* Airport and City Search (autocomplete) */\n// Get a list of airports and cities matching a given keyword\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations([\"subType\"=\u003e\"CITY,AIRPORT\", \"keyword\"=\u003e\"MUC\"]);\n// Get a specific airport or city based on its id\n// function get() :\n$amadeus-\u003egetReferenceData()-\u003egetLocation(\"CMUC\")-\u003eget();\n\n/* Hotel Name Autocomplete */\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003egetHotel()-\u003eget([\"keyword\"=\u003e\"PARI\", \"subType\"=\u003e\"HOTEL_GDS\"]);\n\n/* Hotel List */\n// Get list of hotels by hotel id\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003egetHotels()-\u003egetByHotels()-\u003eget([\"hotelIds\"=\u003e\"XXX\"]);\n// Get list of hotels by city code\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003egetHotels()-\u003egetByCity()-\u003eget([\"cityCode\"=\u003e\"PAR\"]);\n// Get list of hotels by a GeoCode\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003egetHotels()-\u003egetByGeocode()-\u003eget([\"longitude\"=2.160873, \"latitude\"=\u003e41.397158]);\n\n/* Hotel Search */\n// Get list of available offers by hotel ids\n// function get(array $params) :\n$amadeus-\u003egetShopping()-\u003egetHotelOffers()-\u003eget([\"hotelId\" =\u003e \"MCLONGHM\",\"adults\" =\u003e 1]);\n// Check conditions of a specific offer\n// function get() :\n$amadeus-\u003egetShopping()-\u003egetHotelOffer(\"XXX\")-\u003eget();\n\n/* Hotel Booking */\n// The offerId comes from the hotel offer above\n// function post(string $body) :\n$amadeus-\u003egetBooking()-\u003egetHotelBookings()-\u003epost($body);\n\n/* Hotel Ratings */\n// function get(array $params) :\n$amadeus-\u003egetEReputation()-\u003egetHotelSentiments()-\u003eget([\"hotelIds\" =\u003e \"TELONMFS\"]);\n\n/* Flight Availabilities Search */\n// function post(string $body) :\n$amadeus-\u003egetShopping()-\u003egetAvailability()-\u003egetFlightAvailabilities()-\u003epost($body);\n\n/* Airport Routes */\n// function get(array $params) :\n$amadeus-\u003egetAirport()-\u003egetDirectDestinations()-\u003eget([\"departureAirportCode\" =\u003e \"MAD\", \"max\" =\u003e 2]);\n\n/* Flight Cheapest Date Search */\n// function get(array $params) :\n$amadeus-\u003egetShopping()-\u003egetFlightDates()-\u003eget([\"origin\"=\u003e\"MAD\", \"destination\"=\u003e\"LON\"]);\n\n/* Airline Code Lookup */\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetAirlines()-\u003eget([\"airlineCodes\"=\u003e\"BA\"]);\n\n/* On-Demand Flight Status */\n// function get(array $params) :\n$amadeus-\u003egetSchedule()-\u003egetFlights()-\u003eget([\"carrierCode\"=\u003e\"IB\", \"flightNumber\"=\u003e532, \"scheduledDepartureDate\"=\u003e\"2022-09-23\"]);\n\n/* Airport Nearest Relevant */\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetLocations()-\u003egetAirports()-\u003eget([\"latitude\"=\u003e51.57285, \"longitude\"=\u003e-0.44161, \"radius\"=\u003e500]);\n\n/* Flight Delay Prediction */\n// function get(array $params) :\n$amadeus-\u003egetTravel()-\u003egetPredictions()-\u003egetFlightDelay()-\u003eget([\n    \"originLocationCode\"=\u003e\"NCE\", \"destinationLocationCode\"=\u003e\"ATH\",\n    \"departureDate\"=\u003e\"2022-10-06\", \"departureTime\"=\u003e\"18:40:00\",\n    \"arrivalDate\"=\u003e\"2022-10-06\", \"arrivalTime\"=\u003e\"22:05:00\",\n    \"aircraftCode\"=\u003e\"32N\", \"carrierCode\"=\u003e\"A3\",\n    \"flightNumber\"=\u003e\"691\", \"duration\"=\u003e\"PT2H25M\"\n]);\n\n/* Travel Restrictions */\n// function get(array $params) :\n$amadeus-\u003egetDutyOfCare()-\u003egetDiseases()-\u003egetCovid19AreaReport()-\u003eget([\"countryCode\"=\u003e\"US\"]);\n\n/* Flight Inspiration Search */\n// function get(array $params) :\n$amadeus-\u003egetShopping()-\u003egetFlightDestination()-\u003eget([\"origin\"=\u003e\"MUC\"]);\n\n/* Tours and Activities */\n// What are the popular activities in Barcelona (based a geo location and a radius)\n// function get(array $params) :\n$activities = $amadeus-\u003egetShopping()-\u003egetActivities()-\u003eget(\n    [\"longitude\" =\u003e 2.160873, \"latitude\" =\u003e 41.397158]);\n// What are the popular activities in Barcelona? (based on a square)\n// function get(array $params) :\n$activities = $amadeus-\u003egetShopping()-\u003egetActivities()-\u003egetBySquare()-\u003eget(\n    [\"west\" =\u003e 2.160873, \"north\" =\u003e 41.397158, \"south\" =\u003e 41.394582, \"east\" =\u003e 2.177181]);\n// Get a single activity from a given id\n// function get() :\n$amadeus-\u003egetShopping()-\u003egetActivity(\"3044851\")-\u003eget();\n\n/* Travel Recommendations */\n// function get(array $params) :\n$amadeus-\u003egetReferenceData()-\u003egetRecommendedLocations()-\u003eget([\"cityCodes\"=\u003e\"PAR\", \"travelerCountryCode\"=\u003e\"FR\"]);\n\n/* Airport On-Time Performance */\n// function get(array $params) :\n$amadeus-\u003egetAirport()-\u003egetPredictions()-\u003egetOnTime()-\u003eget(\n    [\"airportCode\" =\u003e \"NCE\", \"date\" =\u003e 2022-11-01]);\n\n```\n\n## Development and 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\n## License\n\nThis library is released under the [MIT License](LICENSE).\n\n## Getting 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-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famadeus4dev-examples%2Famadeus-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadeus4dev-examples%2Famadeus-php/lists"}