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
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) |
| sorting | integer | Optional | Sort order: 7 = most recent, 6 = highest rating, 5 = lowest rating (default: 7) |
How It Works
URL Validation
The API validates that the provided URL is from agoda.com domain.
Hotel ID Extraction
The system automatically extracts the hotel ID from the URL by analyzing the page content.
Review Fetching
Reviews are retrieved using the extracted hotel ID with your specified parameters.
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:
With Pagination
Get specific page of reviews (20 reviews per page):
Sorted by Rating
Get highest-rated reviews first:
Error Handling
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"
}
}
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