Flight fares, hotel rates, and rental prices change by the hour. They also change by date, currency, number of guests, and the country you search from. That makes it one of the hardest kinds of data to scrape. However, the travel data is valuable for price trackers, comparison sites, market research, and AI travel agents.
This guide maps each type of travel data to a SerpApi engine that you can call with one API key. Every section has a short Python example and a link to a full tutorial for that source. At the end, you'll have a script that compares hotel prices across Google Hotels, Booking.com, and Airbnb.
What travel data can you scrape
Here is the travel data you can get, the engine to use, and where to read more.
You can see the full list of engines on the travel and hospitality APIs page.
Why scraping travel sites is hard
If you have tried to scrape a travel site yourself, you have probably hit at least one of these problems:
- JavaScript rendering. Prices load after the page does, so a plain HTTP request returns an empty shell.
- Prices depend on context. The same hotel shows a different rate for a different currency, guest count, or country.
- Layouts change. A selector that works today breaks after the next site update.
SerpApi handles all those problems for you. You send search query and get back the results in structured JSON or Markdown. You can customize the search by filtering the results based on the parameters like currency, gl, and adults, so your results are consistent from one run to the next.
Set up your environment
Install the official SerpApi Python library.
pip install serpapiGet your API key from the SerpApi dashboard and save it as an environment variable.
export SERPAPI_API_KEY="your_api_key"Every example below reuses this client.
import os
import serpapi
client = serpapi.Client(api_key=os.getenv("SERPAPI_API_KEY"))Scrape flight data
Flight prices and schedules
The Google Flights API returns the same results you see on Google Flights such as prices, airlines, durations, layovers, carbon emissions, and price insights.
results = client.search({
"engine": "google_flights",
"departure_id": "JFK",
"arrival_id": "LHR",
"outbound_date": "2027-03-12",
"return_date": "2027-03-19",
"currency": "USD",
"hl": "en",
})
for flight in results.get("best_flights", []):
first_leg = flight["flights"][0]
print(first_leg["airline"], flight["price"], f'{flight["total_duration"]} min')Add deep_search: True when you need results that match the browser exactly. The full walkthrough, with filters and JavaScript examples, is in our guide on how to scrape Google Flights.
Cheapest dates, deals, and airport codes
Three smaller Google Flights APIs help you build around the main search:
- The Google Flights Calendar API returns prices for a range of dates on one route. Use it to find the cheapest dates to fly, then pass those dates to the Google Flights API.
- The Google Flights Deals API returns discounted destinations from a departure airport. See how to scrape Google Flights deals.
- The Google Flights Autocomplete API turns a city name into airport codes you can use in
departure_idandarrival_id. See how to scrape Google Flights autocomplete.
Live flight tracking
The Flightradar24 API returns aircraft that are in the air or on the ground right now, with position, altitude, speed, and route. You can filter by airport, map area, flight number, airline, or aircraft type.
results = client.search({
"engine": "flightradar24",
"airport": "LHR",
})
for flight in results.get("flights", [])[:10]:
origin = flight.get("departure_airport", {}).get("id", "?")
destination = flight.get("arrival_airport", {}).get("id", "?")
print(flight.get("flight_number"), f"{origin} -> {destination}", flight.get("altitude"), "ft")Read the full guide on how to scrape Flightradar24 live flights.
Scrape hotel and vacation rental data
Google Hotels
Google Hotels pulls rates from many booking sites into one listing. The Google Hotels API returns each property's nightly rate, total rate, rating, amenities, and a property_token you can use for details and reviews.
results = client.search({
"engine": "google_hotels",
"q": "hotels in Lisbon",
"check_in_date": "2027-03-12",
"check_out_date": "2027-03-15",
"adults": 2,
"currency": "USD",
})
for hotel in results.get("properties", [])[:10]:
rate = hotel.get("rate_per_night", {}).get("lowest")
print(hotel["name"], rate, hotel.get("overall_rating"))Set vacation_rentals: True to get rentals instead of hotels. To go further:
- How to scrape Google Hotels covers pagination, property details, autocomplete, and the price calendar.
- Scrape hotel prices using Python focuses on nightly rates and booking options.
- How to scrape Google Hotels reviews shows sorting, filtering by topic, and pagination with the Google Hotels Reviews API.
- Categorizing hotels using Google Hotels images uses the Google Hotels Photos API with a vision model.
Booking.com
The Booking.com API returns properties with stay totals, nightly prices, taxes, room types, cancellation terms, and ratings out of 10. Set currency, since it defaults to each property's own currency.
results = client.search({
"engine": "booking",
"q": "Lisbon",
"check_in_date": "2027-03-12",
"check_out_date": "2027-03-15",
"adults": 2,
"currency": "USD",
})
for prop in results.get("properties", [])[:10]:
print(prop["name"], prop.get("price_per_night"), prop.get("rating"))Read the full tutorial on how to scrape Booking.com.
Airbnb
The Airbnb API returns rental listings with prices, ratings, bedrooms, beds, and GPS coordinates. Use name for the listing name, since title is the property type (for example, "Apartment in Lisbon"). Note that extracted_price is the total for the stay, not the nightly rate.
results = client.search({
"engine": "airbnb",
"q": "Lisbon",
"check_in_date": "2027-03-12",
"check_out_date": "2027-03-15",
"adults": 2,
"currency": "USD",
})
for listing in results.get("organic_results", [])[:10]:
print(listing.get("name"), listing.get("price"), listing.get("price_qualifier"))Read the full guide on how to scrape Airbnb data.
Scrape travel reviews and attractions
Tripadvisor covers hotels, restaurants, things to do, and destinations. SerpApi splits it into three APIs that work together:
- The Tripadvisor Search API finds places and returns each one's
place_id. - The Tripadvisor Place API returns details for one place, such as hours, price level, and photos.
- The Tripadvisor Reviews API returns the reviews for one place.
results = client.search({
"engine": "tripadvisor",
"q": "Lisbon",
"ssrc": "A", # Things to Do. Use "h" for hotels or "r" for restaurants.
})
for place in results.get("places", [])[:10]:
print(place["title"], place.get("rating"), place.get("reviews"), place["place_id"])Each step has its own tutorial:
- How to scrape Tripadvisor with the Search and Place APIs
- How to scrape Tripadvisor place data and save it to CSV
- How to scrape Tripadvisor reviews, including no-code options
- Compare hotels with Tripadvisor data in Python, with scoring and charts
Find destinations and travel trends
Sometimes the user doesn't know where to go yet. The Google Travel Explore API returns destinations from a departure airport, with flight prices, airlines, stops, and suggested dates.
results = client.search({
"engine": "google_travel_explore",
"departure_id": "AUS",
"currency": "USD",
"gl": "us",
"hl": "en",
})
for place in results.get("destinations", [])[:10]:
print(place["name"], place.get("flight_price"), place.get("airline"), place.get("start_date"))Read the Google Travel Explore API introduction for more filters, like trip length (travel_duration), month, and interests. To rank destinations by search interest instead of price, see how to find trending travel destinations with Google Trends.
Compare hotel prices across Google Hotels, Booking.com, and Airbnb
Each source has its own response format. Google Hotels returns nightly and total rates, Booking.com lists taxes separately and rates properties out of 10, and Airbnb shows only the total for the stay. To compare them, normalize every result into the same fields.
This script searches one city and set of dates on all three sources, converts each result to a total price with taxes, a nightly price, and a rating out of 5, and saves everything to one CSV file.
import csv
import os
from datetime import date
import serpapi
client = serpapi.Client(api_key=os.getenv("SERPAPI_API_KEY"))
CITY = "Lisbon"
CHECK_IN = "2027-03-12"
CHECK_OUT = "2027-03-15"
ADULTS = 2
CURRENCY = "USD"
NIGHTS = (date.fromisoformat(CHECK_OUT) - date.fromisoformat(CHECK_IN)).days
shared = {
"check_in_date": CHECK_IN,
"check_out_date": CHECK_OUT,
"adults": ADULTS,
"currency": CURRENCY,
}
def google_hotels():
results = client.search({"engine": "google_hotels", "q": f"hotels in {CITY}", **shared})
for hotel in results.get("properties", []):
yield {
"source": "Google Hotels",
"name": hotel.get("name"),
"total_price": hotel.get("total_rate", {}).get("extracted_lowest"),
"rating": hotel.get("overall_rating"), # out of 5
"link": hotel.get("link"),
}
def booking():
results = client.search({"engine": "booking", "q": CITY, **shared})
for prop in results.get("properties", []):
rating = prop.get("rating")
price = prop.get("extracted_price")
taxes = prop.get("extracted_taxes_and_fees", 0)
yield {
"source": "Booking.com",
"name": prop.get("name"),
"total_price": round(price + taxes, 2) if price else None, # price excludes taxes
"rating": round(rating / 2, 2) if rating else None, # out of 10 -> out of 5
"link": prop.get("link"),
}
def airbnb():
results = client.search({"engine": "airbnb", "q": CITY, **shared})
for listing in results.get("organic_results", []):
yield {
"source": "Airbnb",
"name": listing.get("name") or listing.get("title"),
"total_price": listing.get("extracted_price"), # stay total
"rating": listing.get("rating"), # out of 5
"link": listing.get("link"),
}
rows = []
for fetch in (google_hotels, booking, airbnb):
for row in fetch():
if row["total_price"]:
row["price_per_night"] = round(row["total_price"] / NIGHTS, 2)
rows.append(row)
rows.sort(key=lambda row: row["total_price"])
print(f"{len(rows)} stays in {CITY}, {CHECK_IN} to {CHECK_OUT} ({NIGHTS} nights)\n")
for row in rows[:10]:
print(f'{row["source"]:<14} {CURRENCY} {row["price_per_night"]:>8}/night {row["name"]}')
with open("travel_prices.csv", "w", newline="", encoding="utf-8") as f:
fields = ["source", "name", "total_price", "price_per_night", "rating", "link"]
writer = csv.DictWriter(f, fieldnames=fields)
writer.writeheader()
writer.writerows(rows)
print("\nSaved to travel_prices.csv")The results:


This script uses three searches, one per source. To check more listings, add pagination to each function (next_page_token for Google Hotels, offset for Booking.com, page for Airbnb) and cap it with a max_pages value so a run can't use more searches than you planned. Run it on a schedule and you have a basic hotel price tracker.
Build travel apps and AI agents
Once you can pull travel data, you can use it into a product. These tutorials build complete projects on top of the APIs above:
- Build an AI travel agent with OpenAI and SerpApi that plans searches for flights, hotels, and places and returns an itinerary with sources
- Build an AI travel agent with n8n, no code needed
- Make a flight price tracker with Make.com that emails you when fares drop under your budget
- Make a hotel price tracker with n8n that logs daily prices to Google Sheets
- Make a travel guide with SERP data and Python from attractions, restaurants, and hotels
- Build an accessibility search experience with Google Flights, Hotels, and Maps
Frequently asked questions
Is there a free travel API?
SerpApi's free plan includes 250 searches per month, and every travel engine in this guide is available on it. Cached searches don't count toward your quota.
Can I get historical flight prices?
The Google Flights API returns price_insights, which includes a price_history for the route and the typical price range. For your own history, save the results on a schedule, as the price tracker tutorials above do.
How do I get airport codes for a city?
Use the Google Flights Autocomplete API. It returns city names with their airport codes, which you can pass to departure_id and arrival_id.
Why do my results differ from what I see in my browser?
Travel prices depend on currency, country, language, and guest count. Set currency, gl, hl, and adults explicitly so every run uses the same context. For Google Flights, deep_search: True returns results that match the browser.
Wrapping up
Travel data comes from many places. Flight prices live on Google Flights, hotel rates are split across Google Hotels and Booking.com, rentals sit on Airbnb, and reviews come from Tripadvisor. Each site loads its data differently and changes its layout often, which is why scraping them one by one takes so much upkeep. With SerpApi, you scrape all of them the same way with one API key.
The best place to start depends on what you're building. If you need fares, start with the Google Flights API and add the Calendar API to find the cheapest dates. If you need places to stay, start with Google Hotels, then add Booking.com and Airbnb for wider coverage, as the comparison script in this guide does. If you need traveler opinions, use the Tripadvisor APIs. Each section above links to a full tutorial and to the API docs, so you can go deeper on the sources you need.
Once you have the data, you can save it on a schedule to track prices over time, feed it into a dashboard, or give it to an AI agent that plans trips. The project tutorials above show each of these step by step, with and without code.