# Integrate HasData Google Hotels API
## Task
Add the requested hotel-search or property-data workflow to this project using HasData Google Hotels API.
Inspect project instructions, the server-side runtime, existing HTTP client, and tests first.
Follow the project's conventions and preserve unrelated code. No new SDK is required.
Implement only the requested workflow. If it is unclear, ask whether the user needs destination searches, a specific property's details, or both.
Do not replace the REST integration with an MCP connection or a custom Google Hotels scraper.
## References
Read the endpoint documentation before implementing:
- Hotel search, property details, parameters, and response: https://docs.hasdata.com/apis/google-travel/hotels.md
- Error handling: https://docs.hasdata.com/api-codes.md
- Documentation index: https://docs.hasdata.com/llms.txt
- Full documentation (fallback): https://docs.hasdata.com/llms-full.txt
Start with the endpoint reference. Use `llms.txt` to find additional pages.
Use `llms-full.txt` only when needed; extract relevant sections instead of loading everything into context.
If a `.md` reference is unavailable, try its HTML URL without `.md`.
If it is still unavailable, ask for the missing documentation rather than guessing.
## Optional agent skill
If the official `hasdata` skill is already available, use its relevant guidance.
Otherwise, if this agent supports skills, ask before installing it in this project:
```sh
npx skills add hasdata/agent-skills --skill hasdata
```
Run from the project directory and select the coding agent in use.
The `hasdata-cli` skill is not required. If installation is declined or unsupported, continue with the docs.
Flag conflicts between skill guidance and current API docs rather than guessing.
## Implementation
- Use `GET https://api.hasdata.com/scrape/google/hotels` with required `q`, `checkInDate`, and `checkOutDate`.
- Accept a destination or hotel query and future `YYYY-MM-DD` dates, with checkout after check-in. Do not hardcode the documentation's sample dates.
- Keep `currency`, `adults`, `children`, and `childrenAges` explicit when the workflow requires them. Validate guest counts and one documented age per child against current docs. Do not silently choose dates or guest counts for the user.
- Add only the filters the task needs. Use the documented names and serialization, including `amenity[]` and `propertyType[]` if applicable. Hotel and vacation-rental filter values use different catalogs; do not mix them.
- Encode query parameters correctly. Preserve `properties`, `ads`, and `pagination` separately when present. Do not merge sponsored properties into organic search results without a label.
- For a requested property-details workflow, reuse the returned `propertyToken` with the same endpoint and applicable search context. Read the documented detail response shape; do not assume it is identical to the search list.
- If pagination is needed, expose `nextPageToken` from the response. Do not automatically fetch every page or every property detail.
- Preserve nightly prices separately from full-stay totals, including before-tax values and selected currency. Do not multiply rounded nightly prices to replace returned totals.
- Keep hotel star class separate from guest rating. Missing amenities or review topics are unknown, not verified absences. Review-topic counts are mentions, not percentages of all guests.
- Save query, dates, currency, guest context, and observation time alongside data used for comparisons. Search prices are observations, not reservations or guaranteed availability.
- Handle timeouts, documented errors, empty results, and missing optional fields. Keep requests server-side. If no suitable runtime exists, discuss options before changing the architecture.
## Credentials
- Implement the integration and mocked tests without requiring a live API key.
- Read `HASDATA_API_KEY` from the project's existing environment or secret store and send it as `x-api-key`.
- If the key is missing before live verification, ask the user to configure it from https://app.hasdata.com/api-keys.
- Never ask the user to paste the key into chat. Check only that it is configured, without printing its value.
- Never put the key in browser code, logs, or version control. Add only a placeholder to the project's example configuration.
- If using a local `.env` file, make sure it is gitignored.
- Send the key only to `https://api.hasdata.com`. Never forward it to documentation, hotel links, or redirects to another origin.
## Verification
- Add mocked tests for dates and guest validation, query encoding, success, empty results, missing fields, and errors. Cover tax/total distinctions and the chosen search or detail response shape. Include a usage example and run local checks.
- Only after explicit user approval and with a configured key, make one live verification request with agreed inputs and valid dates. A successful Google Hotels request consumes 10 credits.
- Validate the HTTP status, documented API status, and response structure. An empty result set can be valid.
- Do not automatically repeat paid requests to obtain a nonempty response.
- Report changed files, setup commands, and test results. State separately whether live verification passed, failed, or was skipped.
- Ask before deploying.Google Hotels API
with rates, ratings, and review breakdowns
Search Google Hotels and get every property as clean JSON. One request returns nightly and total rates, ratings, a review sentiment breakdown, and nearby places, for any destination and dates, with proxies handled for you.
of requests succeed
median response
95% finish faster
per 1k hotel searches at volume
Google reshuffles Hotels constantly. Your parser shouldn't care.
- Rates split into nightly and total, before and after fees
- Review sentiment buried in the layout
- Filters and property types shifting
- Proxy rotation and retries per search
- Re-parse the results after each redesign
One GET Request. That's the whole integration.
Start with just a query. Add more parameters when your use case needs them.
Google Hotels API
curl -G 'https://api.hasdata.com/scrape/google/hotels' \
--data-urlencode 'q=Hotels in New York' \
--data-urlencode 'checkInDate=2026-10-19' \
--data-urlencode 'checkOutDate=2026-10-23' \
--header 'x-api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json'q * Search QuerycheckInDate * Check-in DatecheckOutDate * Check-out Dategl Countryhl Languagecurrency Currencyadults Adultschildren ChildrenchildrenAges Children AgessortBy Sort ByminPrice Minimum PricemaxPrice Maximum PricepropertyType[] Property Typeamenity[] Amenityrating Minimum Ratingbrands BrandshotelClass Hotel ClassfreeCancellation Free CancellationspecialOffers Special OffersecoCertified Eco-certifiedvacationRentals Vacation Rentalsbedrooms Bedroomsbathrooms BathroomsnextPageToken Next Page TokenpropertyToken Property TokenAdd Google Hotels API with your AI agent
Paste a ready-to-use integration prompt into your coding agent. It includes API references, setup requirements, and testing instructions.
What you can build with Google Hotels API
Build hotel price comparisons, travel shortlists, and hospitality research tools with structured rates, amenities, reviews, and location data.
Compare hotel rates for the same stay
Compare nightly and full-stay prices from Google Hotels to build accommodation search tools with clear tax and fee distinctions.
- Hotels in New York
- September 20–24, 2026
- USD
| Property | Per night | Stay before taxes and fees | Full stay |
|---|---|---|---|
| The One Boutique Hotel | $151 | $515 | $605 |
| Hotel Executive Suites | $97 | $341 | $390 |
| Hilton Garden Inn New York/Staten Island | $144 | $496 | $578 |
- API data
properties[].nameproperties[].ratePerNightproperties[].totalRate- Your app
- Compare matching dates, guest counts, and currency; preserve returned totals instead of multiplying rounded nightly prices.
Match hotels to guest requirements
Use hotel amenities to shortlist stays with Wi-Fi, parking, or airport shuttles for business travelers and family trips.
- Hilton Garden Inn New York/Staten Island
| Service | Listing label |
|---|---|
| Wi-Fi | Free Wi-Fi |
| Breakfast | Breakfast ($) |
| Airport transfer | Airport shuttle |
| Parking | Parking |
- API data
properties[].nameproperties[].amenities[]- Your app
- Apply your amenity requirements to each property and keep free, paid, and unspecified services distinct.
Analyze hotel reviews by topic
Turn Google Hotels review breakdowns into topic-level comparisons of service, dining, and breakfast for hospitality research dashboards.
- Hilton Garden Inn New York/Staten Island
| Topic | Positive | Negative | Neutral |
|---|---|---|---|
| Service | 470 | 116 | 27 |
| Dining | 154 | 38 | 9 |
| Breakfast | 95 | 33 | 14 |
- API data
properties[].reviewsBreakdown[].nameproperties[].reviewsBreakdown[].positiveproperties[].reviewsBreakdown[].negativeproperties[].reviewsBreakdown[].neutral- Your app
- Compare the reported sentiment counts by topic, retaining mention totals instead of treating them as percentages of all guests.
Compare hotels by airport access
Combine nearby places and transport times with hotel results to build location-aware shortlists for airport transfers and travel itineraries.
- John F. Kennedy International Airport
- New York area
| Property | Taxi | Public transport |
|---|---|---|
| The One Boutique Hotel | 25 min | 53 min |
| Hotel Executive Suites | 48 min | 1 hr 52 min |
| Hilton Garden Inn New York/Staten Island | 41 min | 2 hr 2 min |
- API data
properties[].nearbyPlaces[].nameproperties[].nearbyPlaces[].transportations[].typeproperties[].nearbyPlaces[].transportations[].duration- Your app
- Match the same airport across properties, then compare each transport mode separately in your travel planner.
Track sponsored hotel visibility
Record sponsored Google Hotels placements by destination and stay dates to see which properties appear in your market.
- Hotels in New York
- September 20–24, 2026
- USD
| Property | Source |
|---|---|
| The New York EDITION | The New York EDITION |
| Hotel NH Collection New York Madison Avenue | NH Collection New York Madison Avenue |
| Best Western Plus Soho Hotel | Best Western Plus Soho Hotel |
- API data
ads[].nameads[].sourceads[].propertyToken- Your app
- Save dated ads observations for your selected searches; calculate appearance frequency across those snapshots.
Every property, one predictable schema
Compare room rates, review breakdowns, and nearby transport, then continue through the hotel results.
properties
[
{
"name": "The Manhattan at Times Square Hotel",
"type": "hotel",
"link": "https://www.ihg.com/spnd/hotels/us/en/new-york/nycat/",
"gpsCoordinates": { "latitude": 40.7622856, "longitude": -73.9826404 },
"checkInTime": "4:00 PM",
"checkOutTime": "12:00 PM",
"ratePerNight": { "lowest": "$168", "extractedLowest": 168, "beforeTaxesFees": "$144", "extractedBeforeTaxesFees": 144 },
"totalRate": { "lowest": "$839", "extractedLowest": 839 },
"overallRating": 4.1,
"reviews": 10163,
"locationRating": "4.9",
"reviewsBreakdown": [
{ "name": "Bathroom", "totalMentioned": 1407, "positive": 1180, "negative": 160, "neutral": 67 }
]
}
]name / type stringProperty name and hotel | vacation rental
ratePerNight objectNightly price, before and after taxes and fees
totalRate objectFull-stay price, display and numeric
overallRating / reviews numberStar rating and total review count
locationRating stringHow guests rate the location
reviewsBreakdown[] object[]Per-topic sentiment: positive, negative, neutral counts
gpsCoordinates / checkInTime / checkOutTime object / stringLocation and stay times
amenities
Each property's amenity labels are returned under properties[].amenities. Paid services retain their labels; an omitted amenity is unknown.
{
"name": "Hilton Garden Inn New York/Staten Island",
"amenities": [
"Breakfast ($)",
"Free Wi-Fi",
"Parking",
"Air conditioning",
"Pet-friendly",
"Fitness center",
"Bar",
"Restaurant",
"Airport shuttle",
"Accessible",
"Kid-friendly",
"Smoke-free property"
]
}properties[].name stringProperty associated with these amenity labels
properties[].amenities[] string[]Reported amenities, including free or paid-service labels when shown
ads
Sponsored properties, kept in their own array so you can drop them in code.
[
{
"name": "The Manhattan at Times Square Hotel",
"propertyToken": "CgsIooCAqvyy0fDgARAB",
"source": "IHG Hotels & Resorts",
"link": "https://www.google.com/aclk?sa=l&ai=DChsSEwi17...",
"gpsCoordinates": { "latitude": 40.7622856, "longitude": -73.9826404 }
}
]name stringAdvertised property name
propertyToken stringToken to pull the property's detail
source stringAdvertiser behind the placement
link stringTracked click-through URL
gpsCoordinates objectlatitude and longitude
brands
The brand tree you can filter a search by.
[
{
"id": 33,
"name": "Accor Live Limitless",
"children": [
{ "id": 8, "name": "Fairmont Hotels and Resorts" }
]
}
]id / name number / stringBrand group ID and name
children[] object[]Sub-brands, each with its own id and name
nearbyPlaces
Found under properties[].nearbyPlaces.
[
{
"name": "Roosevelt Ave at Post Blvd",
"transportations": [
{
"type": "Walking",
"duration": "6 min"
}
]
},
{
"name": "John F. Kennedy International Airport",
"transportations": [
{
"type": "Taxi",
"duration": "47 min"
},
{
"type": "Public transport",
"duration": "1 hr 52 min"
}
]
}
]name stringNearby stop, airport, or landmark
transportations[].type stringTransport mode from the property
transportations[].duration stringTravel time shown for that mode
pagination
{
"nextPageToken": "CBI=",
"currentFrom": 1,
"currentTo": 20,
"next": "https://api.hasdata.com/scrape/google/hotels?q=Hotels+in+New+York&checkInDate=2026-09-20&checkOutDate=2026-09-24&nextPageToken=CBI%3D"
}nextPageToken stringToken for the next page of properties
currentFrom numberFirst result index on this page
currentTo numberLast result index on this page
next stringAPI URL for the next page
An all-in-one scraping service
Every feature you need to collect data from thousands to millions of requests.
Discover similar
scrapers and APIs
to expand your projects.
Google Flights API
Travel Data • $1.25 / 1k Request
Booking.com Scraper
Travel Data • $0.08 / 1k Rows
Fits right into your stack.
Works with the tools you already use.
View Documentation ->Teams that deleted their scraper
Now it's the part of the pipeline they don't think about
HasData delivers exactly what we need: speed and comprehensive search features. It's the fastest API we've used in this space. Plus, their customer support is fantastic.
We rely on HasData for search performance data and broader scraping needs. Their APIs deliver highly structured data that integrates directly into our platforms.
Great web scraping API which is incredibly easy to use. It requires minimal effort to get up and running, and the documentation is very clear and helpful.
I needed to scrape some information they didn't already support, and they wrote the code for me right away, which was super nice of them.
We were particularly impressed with how easily we could integrate HasData into our existing workflow.
Plans that get cheaper at scale
Fixed price, fixed volume, no surprises at the end of the month. Upgrade when you need more.
Free
Startup
Basic
RecommendedGrowth
Monthly hotel search volume
Custom price based on required volume
Past 20M credits a month, or terms the self-serve plans do not cover. We shape the contract around your workload. Past 20M credits a month, or need terms the self-serve plans do not cover? We shape the contract, concurrency, and support around your workload.
HasData accesses publicly available data only. Google Hotels' terms may restrict automated access; you are responsible for compliance. Where data includes personal information, ensure a lawful basis under GDPR/CCPA.
Questions, answered
Each property with nightly and total rates before and after taxes, overall and location ratings, a per-topic review sentiment breakdown, amenities, check-in and check-out times, coordinates, images, and nearby places with travel times.
Yes. The request supports minimum and maximum price, property type, amenities, minimum rating, brand, hotel class, free cancellation, special offers, and eco-certified properties.
Yes. Set vacationRentals to true to switch from hotels to rentals. In that mode you also get the bedrooms and bathrooms parameters and the rental property-type and amenity filters.
Per successful request. One request is one hotel search and returns the whole results page. A failed request costs nothing.
Yes. The free plan renews 1,000 credits every month, enough for 100 hotel searches. No credit card required. When you outgrow it, pick a plan that fits your volume.
One hotel search costs 10 credits. With monthly billing in USD, the unit price drops with volume from $2.95 to $0.83 per 1,000 searches. Need more than the top plan covers? We'll set a custom rate.
No. Requests run on HasData's infrastructure, so there's nothing to provision or maintain. You're responsible for using the results in line with each target site's terms and applicable law.
Yes, you can cancel your subscription at any time from your dashboard in a few seconds. Once cancelled, there are no recurring payments.
Your first hotel search
is minutes away
100 hotel searches free · no credit card