Skip to content

gooddog-rent/hotels_api

Repository files navigation

🏨 Starightforward API to search regions and hotels with one endpoint


Tests

Build and Push Docker image to Registry

Description

Simple search API to find regions and hotels.

Features

🔍 - fast full-text search

✋ - rate limiter to secure from DDoS attacks

🗜️ - gzip or brotli compression (more then body length 1400 bytes)

Setup enviroments

  • Create .env file at your root project folder and fill it with your data (see .env.example to reference)

Run in Docker container via docker compose (example)

docker-compose up -d

Get hotels (API endpoint)

Returns 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"

About

🏨 API hotels list

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors