GET

Search by URL API

Search for hotels using a Booking.com search results URL directly from your browser.

Overview

Simplest Search Method

Copy any Booking.com search URL from your browser and use it directly to get hotel results via the API.

The Search by URL endpoint allows you to use any Booking.com search results URL directly. This is perfect when you want to replicate a search you've already configured on Booking.com's website without manually extracting all the parameters.

Endpoint URL

GET https://api.stayapi.com/v1/booking/search_by_url

Query Parameters

Parameter Type Required Description
url string Required Booking.com search results URL to parse and execute
debug boolean Optional Return parsed parameters without executing search (default: false)

How It Works

Step 1: Get Your URL

  1. Go to Booking.com
  2. Search for hotels with your desired criteria
  3. Copy the URL from your browser's address bar

Step 2: Use the API

Pass the copied URL to this endpoint:

https://api.stayapi.com/v1/booking/search_by_url?url=https://www.booking.com/searchresults.html?dest_id=-3233180&checkin=2024-06-01&checkout=2024-06-07...

Supported URL Parameters

The API automatically extracts and uses:

  • Destination (city, region, hotel)
  • Check-in and check-out dates
  • Number of adults, children, and rooms
  • Property types and filters
  • Price ranges and sort preferences
  • Any other search criteria from the URL

Debug Mode

Testing Parameters

Use debug=true to see what parameters are extracted from your URL without running the actual search.

When debug=true, the API returns the parsed parameters instead of search results. This is useful for:

  • Verifying the URL is parsed correctly
  • Understanding what parameters are being used
  • Debugging search issues
Request
curl -X GET "https://api.stayapi.com/v1/booking/search_by_url?url=https%3A%2F%2Fwww.booking.com%2Fsearchresults.html%3Fdest_id%3D-3233180%26checkin%3D2024-06-01%26checkout%3D2024-06-07" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "success": true,
  "data": [
    {
      "hotel_id": 302297,
      "hotel_name": "Banyan Tree Phuket",
      "url": "https://www.booking.com/hotel/th/banyan-tree-phuket.html",
      "image_url": "https://cf.bstatic.com/xdata/images/hotel/square60/495123456.jpg",
      "star_rating": 5,
      "review_score": 8.7,
      "review_count": 1234,
      "review_score_word": "Fabulous",
      "address": "33, 33/27 Moo 4, Srisoonthorn Road Cherngtalay, Amphur Talang, 83110 Bang Tao Beach, Thailand",
      "distance_from_center": 18.2,
      "unit_configuration_label": "Entire villa",
      "min_total_price": 450.50,
      "currency_code": "USD",
      "is_free_cancellable": 1,
      "is_no_prepayment_block": 1,
      "checkin": "2024-06-01",
      "checkout": "2024-06-07"
    }
  ],
  "pagination": {
    "rows_per_page": 25,
    "current_offset": 0,
    "total_count_with_filters": 247
  },
  "search_metadata": {
    "original_url": "https://www.booking.com/searchresults.html?dest_id=-3233180&checkin=2024-06-01&checkout=2024-06-07",
    "dest_id": "-3233180",
    "dest_type": "CITY",
    "search_type": "regular"
  },
  "message": "Successfully retrieved search results from URL",
  "retrieved_at": "2024-01-15T10:30:00Z"
}