GET

Agoda Reviews from URL API

Extract hotel reviews directly from any Agoda hotel URL without needing to know the hotel ID.

Overview

Automatic Hotel ID Extraction

Simply provide any Agoda hotel URL and the API will automatically extract the hotel ID and fetch reviews.

This endpoint simplifies the review extraction process by accepting any valid Agoda hotel URL. The API automatically identifies the hotel ID from the URL and retrieves all review data, making it perfect for applications that work with URLs rather than IDs.

Endpoint URL

GET https://api.stayapi.com/v1/agoda/hotel/reviews-from-url

Supported URL Formats

Valid Agoda URL Patterns

https://www.agoda.com/hotel-name/hotel/city-country.html

Standard hotel page URL

https://www.agoda.com/hotel-name/hotel/all/city-country.html

Hotel page with all locations

https://www.agoda.com/en-us/hotel-name/hotel/city.html

Localized URL with language prefix

agoda.com/hotel-123456.html

Short format with hotel ID in URL

URL Parameters

Query parameters like check-in dates, guest counts, etc. are ignored. Only the hotel identifier is extracted.

Parameters

Parameter Type Required Description
url string Required Full Agoda hotel URL (query parameter)
page integer Optional Page number for pagination (starts at 1, default: 1)
page_size integer Optional Number of reviews per page (1-20, default: 5)
sorting integer Optional Sort order: 7 = most recent, 6 = highest rating, 5 = lowest rating (default: 7)

How It Works

1

URL Validation

The API validates that the provided URL is from agoda.com domain.

2

Hotel ID Extraction

The system automatically extracts the hotel ID from the URL by analyzing the page content.

3

Review Fetching

Reviews are retrieved using the extracted hotel ID with your specified parameters.

4

Response Delivery

Complete review data is returned in the same format as the standard reviews endpoint.

Usage Examples

Basic Review Extraction

Extract reviews from any Agoda hotel page:

GET /v1/agoda/hotel/reviews-from-url?url=https://www.agoda.com/omena-hotel-jyvaskyla/hotel/jyvaskyla-fi.html

With Pagination

Get specific page of reviews:

GET /v1/agoda/hotel/reviews-from-url?url=https://www.agoda.com/hotel-name/hotel/city.html&page=2&page_size=10

Sorted by Rating

Get highest-rated reviews first:

GET /v1/agoda/hotel/reviews-from-url?url=https://www.agoda.com/hotel/city.html&sorting=6

Error Handling

400

Invalid URL

The provided URL is not a valid Agoda hotel URL

{
  "error": {
    "code": "INVALID_URL",
    "message": "The provided URL is not a valid Agoda hotel URL"
  }
}
400

Hotel ID Not Found

Could not extract hotel ID from the provided URL

{
  "error": {
    "code": "HOTEL_ID_NOT_FOUND",
    "message": "Could not extract hotel ID from the provided URL"
  }
}

URL Requirements

Ensure the URL points to a valid Agoda hotel page, not search results or other pages.

Best Practices

Recommendations

  • Validate URLs on the client side before making API calls
  • Cache the extracted hotel ID for subsequent requests
  • Use URL encoding for special characters in the URL parameter
  • Consider using the direct hotel ID endpoint if you already have the ID
  • Handle pagination based on the total_pages returned in the response
  • Implement retry logic for temporary extraction failures
Request
curl -X GET "https://api.stayapi.com/v1/agoda/hotel/reviews-from-url" \
  -G \
  --data-urlencode "url=https://www.agoda.com/omena-hotel-jyvaskyla/hotel/jyvaskyla-fi.html" \
  --data-urlencode "page=1" \
  --data-urlencode "page_size=5" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "success": true,
  "hotel_id": 319457,
  "hotel_name": "Omena Hotel Jyvaskyla",
  "reviews": [
    {
      "review_id": "1013949992",
      "rating": 10.0,
      "title": "Thanks a lot for Omena Call Support",
      "comment": "Omena Call Support helped me to get my check-in link...",
      "pros": "",
      "cons": "",
      "reviewer": {
        "name": "Shintaro",
        "country": "Japan",
        "level": "",
        "group_type": "Group"
      },
      "date": "August 22, 2025",
      "stay_date": "August 2025",
      "room_type": "Double Room",
      "helpful_count": 0,
      "language": "en",
      "photos": [],
      "sub_ratings": {
        "cleanliness": 9.0,
        "location": 9.5,
        "service": 8.0
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "page_size": 5,
    "total_count": 1459,
    "total_pages": 292
  },
  "review_score": {
    "overall": 7.9,
    "score_text": "Very good",
    "review_count": 1459
  },
  "retrieved_at": "2025-09-04T10:30:00Z"
}