weblab54/booking-com-api

此包的最新版本(0.0.3)没有可用的许可信息。

Booking.com API 客户端

0.0.3 2020-05-29 10:37 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:42:42 UTC


README

使用他们的API访问Booking.com酒店数据:https://developers.booking.com

第一步

首先,您必须设置您的API用户名和密码(由Booking.com提供),然后转到src/config/app.php进行设置。

您可能还需要在Client.php构造函数中将配置文件路径从getDevConfig更改为getConfig

用法

$hotel = new \WEBLAB54\BookingComClient\Hotel();
$data = $hotel->getHotelByDestinationId('20088325', 1)

getHotelByDestinationId接受目的地ID和要返回的酒店数量。

`$data中的输出为json格式`

[
    {
        "hotel_id": 21985,
        "hotel_data": {
            "district_id": 929,
            "number_of_reviews": 870,
            "class_is_estimated": false,
            "creditcard_required": true,
            "book_domestic_without_cc_details": false,
            "hotel_important_information": "Please note that as of March 2016, the hotel no longer has an indoor pool. Please note that as of 1 July, 2016, the hotel no longer provides transportation\/taxi assistance or luggage storage\/carry service. Self-service lockers are available upon request.\nGuests are required to show a photo identification and credit card upon check-in. Please note that all Special Requests are subject to availability and additional charges may apply.",
            "review_score": 8.1,
            "hotel_type_id": 204,
            "deep_link_url": "booking:\/\/hotel\/21985?affiliate_id=964078",
            "city_id": 20088325,
            "name": "Courtyard New York Manhattan\/Upper East Side",
            "city": "New York",
            "max_rooms_in_reservation": 9,
            "number_of_rooms": 226,
            "checkin_checkout_times": {
                "checkin_to": "00:00",
                "checkin_from": "15:00",
                "checkout_to": "12:00",
                "checkout_from": ""
            },
            "zip": "NY 10128",
            "location": {
                "longitude": -73.94608,
                "latitude": 40.78029
            },
            "exact_class": 3,
            "spoken_languages": [
                "ru",
                "pt",
                "ko",
                "hi",
                "es",
                "en"
            ],
            "max_persons_in_reservation": 0,
            "address": "410 East 92nd Street",
            "chain_id": [
                1093
            ],
            "country": "us",
            "ranking": 2345121,
            "hotel_description": "Located in Manhattan\u2019s Upper East Side, this hotel is within 15 minutes\u2019 walk from Guggenheim Museum and Central Park. A fitness centre is available. All rooms include free Wi-Fi.",
            "preferred": false,
            "url": "https:\/\/www.booking.com\/hotel\/us\/manhattan-upper-east-side-courtyard-by-marriott.html",
            "default_language": "en",
            "class": 3,
            "currency": "USD"
        }
    }
]

进行中...