Simple search API to find regions and hotels.
🔍 - fast full-text search
✋ - rate limiter to secure from DDoS attacks
🗜️ - gzip or brotli compression (more then body length 1400 bytes)
- Create
.envfile at your root project folder and fill it with your data (see.env.exampleto reference)
docker-compose up -dReturns json data with list of region and hotels.
-
URL
api/v1/hotels
-
Method:
GET -
URL Params
Required:
query=[string]Hotel search query string
Required:
limit=[decimal]Limit hotels per one region
-
Success Response:
-
Code: 200
Content:{ "hotels": { "Bavaro": [ "Impressive Resorts Spas", "Melia Punta Cana Beach Resort Adults Only", "Royalton Bavaro Resort Spa" ], "La Romana": [ "Santana Beach Resort", "Viva Wyndham Dominicus Palace Resort" ], "Punta Cana Hotels": [ "The Westin Punta Сana Resort Club", "Tortuga Bay Hotel at Punta Сana Resort Club" ], "Uvero Alto": [ "Dreams Punta Cana Resort Hotel", "Nickelodeon Hotels Resorts Punta Cana", "Sensatori Resort Punta Cana" ] } }
-
-
Error Response:
-
Code: 400 BAD REQUEST
Content:HTTP page 400 Bad Request -
Code: 405 METHOD NOT ALLOWED
Content:HTTP page 405 Method Not Allowed -
Code: 429 TOO MANY REQUESTS
Content:HTTP page 429 Too Many Requests -
Code: 500 INTERNAL SERVER ERROR
Content:HTTP page 500 Internal Server Error
-
-
Sample Call:
curl "http://localhost:4000/api/v1/hotels?query=resort&limit=10"