施設 の静的データを取得する
SDP(Static Data Platform) では、施設 などのID、名称、説明、住所、設備など、頻繁に変更されないさまざまな種類の静的データを提供しています。
このプラットフォームを活用する方法の一つとして、データを自社側でローカルにホストし、定期的に更新を行い、空室状況や価格といった変動の激しいデータについてのみ、Lodging APIを呼び出すという方法があります。そうすることで、実際のAPI呼び出しを減らし、アプリケーションのパフォーマンスを向上させることができます。
このページでは、SDP DownloadURL APIを使用して、アクセス可能な 施設IDリストおよびこれらのプロパティの位置情報を取得する方法について説明します。SDPがサポートするその他の静的データへのアクセス方法の詳細については、こちらのをご覧ください。
SDP DownloadURL APIから、利用可能なExpedia施設IDを取得します
GetFeedDownloadUrlOperationParams getPropertyIdListParams =
GetFeedDownloadUrlOperationParams.builder()
// Use the type LISTINGS to get the list of accessible property IDs.
.type(GetFeedDownloadUrlOperationParams.Type.LISTINGS)
// Without any filters, this operation will return the information of all lodging
// properties in en_US by default.
.build();
GetFeedDownloadUrlOperation getFeedDownloadUrlOperation =
new GetFeedDownloadUrlOperation(getPropertyIdListParams);
Response<PresignedUrlResponse> downloadUrlListingsResponse =
client.execute(getFeedDownloadUrlOperation);
// Get the download URL from the response.
String listingsDownloadUrl = downloadUrlListingsResponse.getData()
.getBestMatchedFile()
.getDownloadUrl();ダウンロードURLは、さまざまなjsonlファイルが含まれたzipファイルを指しています。jsonlファイルの各行には、施設 を表すJSONオブジェクトが含まれています。
LISTINGSファイルに含まれるJSON行の一例です(propertyId.expedia フィールドは、ExpediaのID「施設」です):
{
"propertyId": {
"expedia": "1234567",
"hcom": "123456789",
"vrbo": "123.1234567.7654321"
},
"bookable": {
"expedia": true,
"hcom": true,
"vrbo": true
},
"propertyType": {
"id": 16,
"name": "Apartment"
},
"lastUpdated": "10-27-2024 13:41:16",
"country": "France",
"inventorySource": "vrbo",
"referencePrice": {
"value": "89.52",
"currency": "USD"
},
"vrboPropertyType": {
"instantBook": true
}
}LISTINGSファイルから取得した 施設IDを使用すると、Lodging Listings APIを呼び出すことができます。の「施設ID検索」では、物件の詳細情報、料金、空室状況を取得する例をご覧いただけます。
ただし、Vrboの物件のうち、( instant-bookableではないもの)は、( ではないもの)が、現時点では「宿泊施設一覧」からアクセス可能です。
LISTINGSファイルでは、「propertyId.vrbo」フィールドが空かどうかを確認することでVrboの物件を特定し、「vrboPropertyType.instantBook」フィールドでフィルタリングすることができます。
SDP DownloadURL APIからVrbo施設 のIDを取得する
GetFeedDownloadUrlOperationParams getPropertyIdListParams =
GetFeedDownloadUrlOperationParams.builder()
// Use the type VACATION_RENTAL to get the list of accessible Vrbo property IDs.
.type(GetFeedDownloadUrlOperationParams.Type.VACATION_RENTAL)
// Without any filters, this operation will return the information of all Vrbo
// properties in en_US by default.
.build();
GetFeedDownloadUrlOperation getFeedDownloadUrlOperation =
new GetFeedDownloadUrlOperation(getPropertyIdListParams);
Response<PresignedUrlResponse> downloadUrlVacationRentalResponse =
client.execute(getFeedDownloadUrlOperation);
// Get the download URL from the response.
String vacationRentalDownloadUrl = downloadUrlListingsResponse.getData()
.getBestMatchedFile()
.getDownloadUrl();LISTINGSファイルと同様に、ダウンロードURLはjsonlファイルを含むzipファイルを指しており、その各行には、Vrboの施設を表すJSONオブジェクトが含まれています。
VACATION_RENTALファイルに含まれるJSON行の一例です(propertyId.expedia フィールドは、このVrbo(施設)のExpedia IDです):
{
"propertyId": {
"expedia": "1234567",
"hcom": "987654321",
"vrbo": "123.1234567.7654321"
},
"country": "France",
"propertySize": {
"measurement": 441,
"units": "SQUARE_FEET"
},
"maxOccupancy": 4,
"bathrooms": {
"numberOfBathrooms": 1
},
"bedrooms": {
"numberOfBedrooms": 2
},
"houseRules": {
"partyOrEventRules": {
"partiesOrEventsPermitted": false,
"ownerPartyFreeText": "No events allowed"
},
"smokingRules": {
"smokingPermitted": false,
"ownerSmokingFreeText": "Smoking is not permitted"
},
"petRules": {
"petsPermitted": true,
"ownerPetsFreeText": "Pets allowed"
},
"childRules": {
"childrenPermitted": true,
"ownerChildrenFreeText": "Children allowed: ages 0-17 "
}
},
"propertyManager": {
"name": "Résidences Louis",
"hostType": "Professional"
},
"premierHost": true,
"propertyLiveDate": "2022-05-31"
}VACATION_RENTALファイルから取得したExpediaの施設IDは、Lodging Quotes APIまたはLodging Availability Calendars APIを呼び出す際に使用できます。物件の料金や空室状況を確認する例については、の「宿泊料金見積もり」()およびの「Vrbo空室状況カレンダー」()をご覧ください。
物件の名称および所在地情報を取得する
GetFeedDownloadUrlOperationParams getPropertyLocationParams =
GetFeedDownloadUrlOperationParams.builder()
// Use the type LOCATIONS to get the names and address of accessible properties.
.type(GetFeedDownloadUrlOperationParams.Type.LOCATIONS)
// If you are looking for Vrbo properties specifically, you can also filter the properties by brand.
// .brand(GetFeedDownloadUrlOperationParams.Brand.VRBO)
.build();
GetFeedDownloadUrlOperation getFeedDownloadUrlOperation =
new GetFeedDownloadUrlOperation(getPropertyLocationParams);
Response<PresignedUrlResponse> downloadUrlLocationsResponse =
client.execute(getFeedDownloadUrlOperation);
// Get the download URL from the response.
String locationsDownloadUrl = downloadUrlLocationsResponse.getData()
.getBestMatchedFile()
.getDownloadUrl();ファイル構造は、他のSDPファイルと同様です。
LOCATIONSファイルに含まれるJSON行の一例:
{
"propertyId": {
"expedia": "1234567",
"hcom": "987654321",
"vrbo": "123.1234567.1234567"
},
"propertyType": {
"id": 16,
"name": "Apartment"
},
"propertyName": "Property Name",
"address1": "",
"address2": "",
"city": "Newark",
"province": "Delaware",
"country": "United States",
"postalCode": "19711",
"geoLocation": {
"latitude": "10.999999",
"longitude": "-10.999999",
"obfuscated": false
},
"locationAttribute": {
"neighborhood": {
"id": "553248635976468695",
"name": "Westmoreland"
},
"city": {
"id": "8946",
"name": "Newark"
},
"region": {
"id": "6055689",
"name": "North Wilmington"
},
"airport": {
"id": "6028579",
"code": "ILG",
"name": "Wilmington, DE (ILG-New Castle)",
"distance": "13.17",
"unit": "km"
},
"distanceFromCityCenter": {
"distance": "1.24",
"unit": "km"
}
}
}この時点で、施設 の名前と位置情報を 施設 のIDと組み合わせることで、ローカルキャッシュを構築することができます。
SDPを柔軟に活用することで、Lodging APIへの実稼働時の呼び出し回数を減らし、コストを削減することができます。また、このデータを活用して、独自の検索エンジンやレコメンデーションシステムを構築することも可能です。