ScraperScrap Detail Hotel

Scrap Detail Hotel

Scraping Detail Hotel by Url

Endpoint

Base URL
http://localhost:5000
Method and Endpoint
POST /api/users/current/scraphotel
Headers
Authorization: Bearer access_token

Request Body

Request Body
{
  "url": "https://traveloka.com/full-url-of-the-page"
}

Responses

You will get responses like this:

200 (success)

Response Body
{
  "message": "Hotel successfully scraped and saved to database",
  "hotel": {
    "title": "The Ritz-Carlton Jakarta",
    "price": "Rp 2.500.000",
    "description": "This luxury hotel offers an unforgettable experience with 5-star amenities, breathtaking city views, and world-class services.",
    "address": "Jl. Sudirman No. 1, Jakarta",
    "facilities": [
      "Free Wi-Fi",
      "Swimming Pool",
      "Spa",
      "Fitness Center",
      "24-hour Room Service"
    ],
    "images": [
      "https://example.com/image1.jpg",
      "https://example.com/image2.jpg",
      "https://example.com/image3.jpg"
    ],
    "userId": "12345"
  }
}

400 (Bad Request)

Response Body
{
  "message": "Url is invalid"
}

401 (Unauthorized)

Response Body
{
  "message": "Unauthorized"
}

500 (server error)

Response Body
{
  "message": "Internal server error"
}