Dataspryva

Use Expedia Hotel Rate & Guest Rating Finder with Python

Searches Expedia for a destination and travel dates and returns hotel names, nightly and total pricing, guest ratings, neighborhoods, and promotional badges.

1. Choose the data you need

Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.

2. Prepare a source-based input

This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.

{
  "adults": 2,
  "amenities": [],
  "availableOnly": false,
  "checkIn": "",
  "checkOut": "",
  "childrenAges": [],
  "destination": "New York",
  "freeCancellationOnly": false,
  "includePropertyDetails": false,
  "includeRoomRates": false,
  "maxItems": 1,
  "minGuestRating": "any",
  "mode": "search",
  "propertyType": "any",
  "rooms": 1,
  "sortBy": "recommended",
  "starRatings": [],
  "startUrls": []
}

Download input.example.json and save your reviewed copy as input.json.

FieldTypeRequiredDescription
modestringrequiredSearch by destination, or scrape Expedia hotel and search URLs/IDs.
destinationstringoptionalCity, area, landmark, airport, or hotel name to search (mode=search). Examples: New York, London, Tokyo, Times Square.
destinationIdstringoptionalOptional Expedia region ID to skip destination lookup (mode=search). Use only if you already know the region ID.
startUrlsarrayoptionalExpedia hotel pages, Hotel-Search links, share links, or bare hotel IDs such as h17117062 or 17117062 (mode=urls).
checkInstringoptionalYYYY-MM-DD. Leave empty to use 30 days from today.
checkOutstringoptionalYYYY-MM-DD. Leave empty to use 2 nights after check-in.
adultsintegeroptionalAdult guests per room (1-14).
childrenAgesarrayoptionalOne age (0-17) per child. Leave empty for no children.
roomsintegeroptionalNumber of rooms (1-8).
maxItemsintegeroptionalHard cap on hotel records (1-1000). Expedia returns up to 500 per request; larger caps use nextSubSet pagination.
sortBystringoptionalOrder of the hotel search results.
starRatingsarrayoptionalOnly these star classes (1-5). Leave empty for all stars.
minGuestRatingstringoptionalMinimum guest review score on Expedia's 10-point scale.
minPricenumberoptionalMinimum nightly price in USD. Hotels without a nightly price are skipped when a price limit is set.
maxPricenumberoptionalMaximum nightly price in USD. Hotels without a nightly price are skipped when a price limit is set.
propertyTypestringoptionalRestrict results to a type of place.
amenitiesarrayoptionalOnly hotels with all selected amenities. Leave empty for no amenity filter.
freeCancellationOnlybooleanoptionalOnly return properties with a fully refundable rate.
availableOnlybooleanoptionalOnly return properties with rooms available for the selected dates.
propertyNamestringoptionalFilter by property name, for example Marriott or Hilton.
includePropertyDetailsbooleanoptionalAdd exact star class, address, coordinates, full amenities, policies, and gallery images. This fetches one property page per hotel (mode=search).
includeRoomRatesbooleanoptionalAdd room types, live nightly rates, payment policy, and cancellation policy for each hotel. This makes one extra request per hotel.

3. Start an Actor run

Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.

Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.

import json
import os
import urllib.request

# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
    actor_input = json.load(stream)

token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
    "https://api.apify.com/v2/acts/aGnG4rQ2ykpjOw44W/runs?timeout=120&maxTotalChargeUsd=0.50",
    data=json.dumps(actor_input).encode("utf-8"),
    headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
    method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
    run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.

4. Inspect the actual results

Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.

Expedia hotel records with live nightly and total rates, exact star class, guest rating and review count, address and coordinates, amenities, images, and optional room rates and cancellation policies.

Questions before you run

Which inputs are required?

The published required fields are mode

What does this guide verify?

The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.

What if the run request times out?

Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.

Generated from source build omOFbmXA6vxSUIWfn and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.