Home    About    Travel Chat Bot    API    Privacy

API


HotelSearchFreeText Natural Language API

This API is used to parse natural language queries, and return a json object with the fields representing checkin date, checkout date, travel location, and person count.

Endpoint:  http://www.HotelSearchFreeText.com/api/TravelQuery
Method:
POST
Request
message text
Request format:
application/json
Response
travel query response object
Response format
json object



Sample Request:

curl -X POST \
http://www.HotelSearchFreeText.com/api/TravelQuery \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '"jan 24 boston for 5 nights"'

Response:

{
   "hasCheckInDate": true,
   "hasCheckOutDate": true,
   "checkInDate": {
      "day": 24,
      "month": 1,
      "year": 2019
   },
   "checkOutDate": {
      "day": 29,
      "month": 1,
      "year": 2019
   },
   "hasDepartureLocation": true,
   "hasDestinationLocation": false,
   "departureLocation": {
      "city": "Boston",
      "stateShort": "Ma",
      "stateLong": "Massachusetts",
      "country": "United states"
   },
   "destinationLocation": null,
   "personCount": 0,
   "adultCountExists": false,
   "adultCount": 0,
   "childCountExists": false,
   "childCount": 0,
   "childAgeExists": false,
   "childAges": null,
   "currencyCode": null
}