All URIs are relative to https://api.unifapi.com
| Method | HTTP request | Description |
|---|---|---|
| hotels_info_post | POST /hotels/info | Get Hotels detail |
| hotels_search_post | POST /hotels/search | Search Hotels |
HotelsInfoPost200Response hotels_info_post(hotel_info_request=hotel_info_request)
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.
- Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.hotel_info_request import HotelInfoRequest
from unifapi.models.hotels_info_post200_response import HotelsInfoPost200Response
from unifapi.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
host = "https://api.unifapi.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = unifapi.HotelsApi(api_client)
hotel_info_request = unifapi.HotelInfoRequest() # HotelInfoRequest | (optional)
try:
# Get Hotels detail
api_response = api_instance.hotels_info_post(hotel_info_request=hotel_info_request)
print("The response of HotelsApi->hotels_info_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling HotelsApi->hotels_info_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| hotel_info_request | 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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
HotelsSearchPost200Response hotels_search_post(hotel_search_request=hotel_search_request)
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.
- Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.hotel_search_request import HotelSearchRequest
from unifapi.models.hotels_search_post200_response import HotelsSearchPost200Response
from unifapi.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
host = "https://api.unifapi.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = unifapi.HotelsApi(api_client)
hotel_search_request = unifapi.HotelSearchRequest() # HotelSearchRequest | (optional)
try:
# Search Hotels
api_response = api_instance.hotels_search_post(hotel_search_request=hotel_search_request)
print("The response of HotelsApi->hotels_search_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling HotelsApi->hotels_search_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| hotel_search_request | 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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]