Setting up the Java SDK for Rapid API

Software development kits make integration simple so you can quickly get products to market

Become a partner and get your credentials

You can find more details here.

Information

Note

Expedia Group has made branding changes to the Rapid Java SDK. Information on this page refers to the rebranded SDK. Learn more


1. Set up a Java development environment

Your development environment needs to have Java 8 or later. You can use Apache Maven or Gradle to configure SDK dependencies for your projects.


2. Create a service client and configure it

To make requests to Rapid endpoints, create a service client and configure it with your credentials.

RapidClient rapidClient =
    RapidClient
        .builder()
        .key("KEY")
        .secret("SECRET")
        .build();

The service client can be configured with a request timeout (in milliseconds) to override the default interval allowed for HTTP calls.

RapidClient rapidClient =
    RapidClient
        .builder()
        .requestTimeout(10000)
        .key("KEY")
        .secret("SECRET")
        .build();

(Optional) 2.1. Configure endpoint

The service client can also be configured to override the Rapid API endpoint, for example to use the test environment.

RapidClient rapidClient =
    RapidClient
        .builder()
        .endpoint("https://test.ean.com/v3/")
        .key("KEY")
        .secret("SECRET")
        .build();

3. Make API calls

The service client has a method for each endpoint in the Rapid API. You can access the endpoint by calling the corresponding method with the requisite parameters.

List<PropertyAvailability> propertyAvailabilityList =
    rapidClient.getAvailability(
        "CHECK_IN",
        "CHECK_OUT",
        "CURRENCY",
        /* ... */
    );

Need more information? Check out our usage examples. To get better insight into your API calls, configure logging.

Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve Developer Hub!