Suggest hotel and region

Suggest hotel and region

#b2b

POST
https://api.ostrovok.ru/api/b2b/v3/search/multicomplete/

Метод реализует автодополнение: регион или отель можно найти по части названия. В ответе возвращается не более 5 результатов в каждой категории.

Пример запроса

curl --user '<KEY_ID>:<API_KEY>' 'https://api.ostrovok.ru/api/b2b/v3/search/multicomplete/' \
--header 'Content-Type: application/json' \
--data '{
  "query": "Ber",
  "language": "en"
}'

Тело запроса

Ответ

Пример ответа

{
  "data": {
    "hotels": [
      {
        "id": "gostinitsa_berlin",
        "hid": 8066022,
        "name": "Berlin Hotel",
        "region_id": 1798
      },
      {
        "id": "bergs_hotel_2",
        "hid": 9974510,
        "name": "Bergs Spa and Сonference Hotel",
        "region_id": 5580
      },
      {
        "id": "rp_bergamo_hotel",
        "hid": 10575679,
        "name": "Bergamo Eco Hotel",
        "region_id": 6057804
      },
      {
        "id": "hotel_dacha_na_berezovoy",
        "hid": 6344433,
        "name": "Dacha Na Berezovoi Apartments",
        "region_id": 965821558
      },
      {
        "id": "travel_hotels_bereg_hotel",
        "hid": 10211188,
        "name": "Hotel Priboi by Sun City Hotels",
        "region_id": 299
      }
    ],
    "regions": [
      {
        "id": 536,
        "name": "Berlin",
        "type": "City",
        "country_code": "DE"
      },
      {
        "id": 965888340,
        "name": "Saint-Philbert-de-Grand-Lieu",
        "type": "City",
        "country_code": "FR"
      },
      {
        "id": 6340759,
        "name": "Montalbert",
        "type": "City",
        "country_code": "FR"
      },
      {
        "id": 965850065,
        "name": "Cote d'Azur",
        "type": "Multi-Region (within a country)",
        "country_code": "FR"
      },
      {
        "id": 966047519,
        "name": "Saint-Philbert-sur-Orne, Normandy",
        "type": "City",
        "country_code": "FR"
      }
    ]
  },
  "debug": {
    "request": {
      "query": "Ber",
      "language": "en"
    },
    "key_id": 7705,
    "validation_error": null
  },
  "status": "ok",
  "error": null
}

Ошибки

Значение поля error указано в заголовках ниже.

invalid_params

Поле query обязательно.

core_search_error

Внутренняя ошибка поиска. HTTP-статус — 500.