A curated set of examples that show how to call the Expedia Group XAP APIs with the official Java SDK.
| Tool | Version |
|---|---|
| Java | > 1.8 |
| Gradle | Wrapper included – no local install needed |
| XAP Keys | Contact your Expedia Group account manager |
Below is a living catalogue of example scenarios. We are continually adding more – pull requests welcome!
| Scenario | Source File | What it demonstrates |
|---|---|---|
| Listings Quick Start | ListingsQuickStartScenario.java |
Search for properties by location keyword with basic filters (Lodging Listings API). |
| Hotel Ids End‑to‑End | HotelIdsSearchEndToEndScenario.java |
Download accessible property IDs (SDP DownloadURL API) and fetch their content & prices (Lodging Listings API). |
| Quotes Quick Start | QuotesQuickStartScenario.java |
Retrieve price quotes for a list of property IDs (Lodging Quotes API). |
| Vrbo Property End‑to‑End | VrboPropertySearchEndToEndScenario.java |
Obtain Vrbo property IDs + location content (SDP DownloadURL), then price them (Lodging Quotes API). |
| Availability Calendar Quick Start | AvailabilityCalendarsQuickStartScenario.java |
Simple availability calendar request. (Property IDs obtained in the Quotes Quick Start). |
| Scenario | Source File | What it demonstrates |
|---|---|---|
| Listings Quick Start | CarListingsQuickStartScenario.java |
Search car offers for an airport, with filters (Car Listings API). |
| Details Quick Start | CarDetailsQuickStartScenario.java |
Retrieve detailed offer data using an offerToken (Car Details API). |
Step‑by‑step (click to expand)
-
Open the project in IntelliJ.
-
In the Project tool‑window, locate the scenario class you want to run.
-
Right‑click ➜ Modify Run Configuration… Enable VM options and paste:
-Dxapkey="${API_KEY}" -Dxapsecret="${API_SECRET}"Replace the placeholders with your real credentials.
Vrbo brand? Use:-Dvrbokey="${VRBO_KEY}" -Dvrbosecret="${VRBO_SECRET}" -
Hit Run ▶︎ on the
mainmethod.
./gradlew :examples:run \
-Pscenario="path.to.example.Scenario" \
-Pxapkey="${API_KEY}" \
-Pxapsecret="${API_SECRET}"For Vrbo credentials:
./gradlew :examples:run \
-Pscenario="path.to.example.Scenario" \
-Pvrbokey="${VRBO_KEY}" \
-Pvrbosecret="${VRBO_SECRET}"We support Basic (default) and OAuth 2.0:
# OAuth 2.0 – CLI example
./gradlew :examples:run \
-Pscenario="path.to.example.Scenario" \
-Pxapkey="${API_KEY}" \
-Pxapsecret="${API_SECRET}" \
-Ppartnerkey="${PARTNER_KEY}" \
-Pauthtype="oauth"ℹ️
${PARTNER_KEY}is provided during onboarding. Talk to your account manager if unsure.
# Basic auth
./gradlew :examples:run \
-Pscenario="com.expediagroup.sdk.xap.examples.XapSdkDemoTestRun" \
-Pxapkey="${API_KEY}" \
-Pxapsecret="${API_SECRET}" \
-Pvrbokey="${VRBO_KEY}" \
-Pvrbosecret="${VRBO_SECRET}"
# OAuth 2.0
./gradlew :examples:run \
-Pscenario="com.expediagroup.sdk.xap.examples.XapSdkDemoTestRun" \
-Pxapkey="${API_KEY}" \
-Pxapsecret="${API_SECRET}" \
-Pvrbokey="${VRBO_KEY}" \
-Pvrbosecret="${VRBO_SECRET}" \
-Ppartnerkey="${PARTNER_KEY}" \
-Pauthtype="oauth"Distributed under the Apache 2.0 license.
See LICENSE for the full text.