API tìm kiếm khách sạn và giá phòng từ Agoda
Hotelia Hub Raw API là một hệ thống PHP thuần (không framework) được thiết kế để xử lý việc tìm kiếm thông tin khách sạn và giá phòng từ Agoda. Hệ thống được convert từ Laravel sang PHP thuần để tối ưu hiệu suất và giảm dependency.
| Parameter | Type | Required | Description |
|---|---|---|---|
hotels |
array | Required | Danh sách mã khách sạn (ví dụ: ["HOTEL001", "HOTEL002"]) |
checkIn |
string | Required | Ngày nhận phòng (định dạng: YYYY-MM-DD) |
checkOut |
string | Required | Ngày trả phòng (định dạng: YYYY-MM-DD) |
occupancy.rooms |
integer | Required | Số phòng (tối thiểu: 1) |
occupancy.adults |
integer | Required | Số người lớn (tối thiểu: 1) |
occupancy.childrenAges |
array | Optional | Danh sách tuổi trẻ em (ví dụ: [8, 12]) |
log |
boolean | Optional | Bật/tắt logging (true/false) |
{
"hotels": ["HOTEL001", "HOTEL002"],
"checkIn": "2025-01-15",
"checkOut": "2025-01-17",
"occupancy": {
"rooms": 1,
"adults": 2,
"childrenAges": [8, 12]
},
"log": true
}
GET /api/agoda/v1.37/hotelSearch?hotels[]=HOTEL001&hotels[]=HOTEL002&checkIn=2025-01-15&checkOut=2025-01-17&occupancy[rooms]=1&occupancy[adults]=2&occupancy[childrenAges][]=8&occupancy[childrenAges][]=12&log=true
Request thành công
Lỗi validation parameters
Lỗi hệ thống
{
"responseStatus": "SUCCESS",
"version": "v1.37",
"checkIn": "2025-01-15",
"checkOut": "2025-01-17",
"currency": "USD",
"hotels": [
{
"hotelCode": "HOTEL001",
"hotelName": "Example Hotel",
"rooms": [
{
"roomType": "Deluxe Room",
"price": 120.50,
"availability": "Available"
}
]
}
],
"cache": false
}
{
"responseStatus": "INVALID_REQUEST",
"version": "v1.37",
"remark": {
"hotels": ["The hotels field is required."],
"checkIn": ["The checkIn field is required."]
}
}
| PHP Version | 7.4 hoặc cao hơn |
| Extensions | curl, json, mbstring |
| Web Server | Apache với mod_rewrite |
| Permissions | Write access cho thư mục cache/ và logs/ |