All URIs are relative to https://api.unifapi.com
| Method | HTTP request | Description |
|---|---|---|
| hotelsInfoPost | POST /hotels/info | Get Hotels detail |
| hotelsSearchPost | POST /hotels/search | Search Hotels |
HotelsInfoPost200Response hotelsInfoPost(hotelInfoRequest)
Get Hotels detail
Run one live Hotels detail lookup for a hotel id from /hotels/search and receive the full profile, including class rating, address, phone, description, guest reviews, images, and prices.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HotelsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HotelsApi apiInstance = new HotelsApi(defaultClient);
HotelInfoRequest hotelInfoRequest = new HotelInfoRequest(); // HotelInfoRequest |
try {
HotelsInfoPost200Response result = apiInstance.hotelsInfoPost(hotelInfoRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HotelsApi#hotelsInfoPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| hotelInfoRequest | HotelInfoRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HotelsSearchPost200Response hotelsSearchPost(hotelSearchRequest)
Search Hotels
Run one live Hotels search and receive ranked hotel listings for a location and stay dates, including hotel id, class rating, guest reviews, and nightly prices. Pass a hotel id to /hotels/info for full details.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HotelsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HotelsApi apiInstance = new HotelsApi(defaultClient);
HotelSearchRequest hotelSearchRequest = new HotelSearchRequest(); // HotelSearchRequest |
try {
HotelsSearchPost200Response result = apiInstance.hotelsSearchPost(hotelSearchRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HotelsApi#hotelsSearchPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| hotelSearchRequest | HotelSearchRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |