{"id":29196097,"url":"https://github.com/jongan69/hotels","last_synced_at":"2026-05-17T06:36:21.528Z","repository":{"id":300871908,"uuid":"1007438541","full_name":"jongan69/hotels","owner":"jongan69","description":"A python package for scraping google hotel data","archived":false,"fork":false,"pushed_at":"2025-06-26T01:19:02.000Z","size":483,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T06:01:49.726Z","etag":null,"topics":["hotels","playwright","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fast-hotels/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jongan69.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-24T02:14:39.000Z","updated_at":"2025-06-27T15:55:59.000Z","dependencies_parsed_at":"2025-06-24T03:36:32.944Z","dependency_job_id":null,"html_url":"https://github.com/jongan69/hotels","commit_stats":null,"previous_names":["jongan69/hotels"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jongan69/hotels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fhotels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fhotels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fhotels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fhotels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jongan69","download_url":"https://codeload.github.com/jongan69/hotels/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fhotels/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281870522,"owners_count":26576245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hotels","playwright","python"],"created_at":"2025-07-02T06:00:33.125Z","updated_at":"2025-10-30T19:39:13.406Z","avatar_url":"https://github.com/jongan69.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fast-hotels\n\nA fast, simple hotel scraper for Google Hotels, inspired by fast-flights. Fetches hotel data (name, price, rating, amenities, etc.) using a fast HTTP-based approach with protobuf encoding.\n\n## Features\n- Scrape Google Hotels for hotel data using fast HTTP requests\n- Simple, synchronous API with protobuf-based filtering\n- Returns structured hotel data (name, price, rating, amenities, URL)\n- **Sort results by price, rating, or best value (rating/price ratio)**\n- **Limit the number of results returned**\n- **Support for IATA airport codes as locations (e.g., 'HND' → 'Tokyo')**\n- **Multiple fetch modes: common, fallback, force-fallback, local**\n- **Automatic location conversion from airport codes to city names**\n\n## Installation\n\n```sh\npip install fast-hotels\n```\n\n## Usage\n\n```python\nfrom fast_hotels.hotels_impl import HotelData, Guests\nfrom fast_hotels import get_hotels\n\nhotel_data = [\n    HotelData(\n        checkin_date=\"2025-06-23\",\n        checkout_date=\"2025-06-25\",\n        location=\"Tokyo\",  # or use an IATA code like \"HND\"\n        room_type=\"standard\",\n        amenities=[\"wifi\", \"breakfast\"]\n    )\n]\nguests = Guests(adults=2, children=1, infants=0)\n\n# Basic usage\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"],\n    fetch_mode=\"common\"\n)\n\nfor hotel in result.hotels:\n    print(f\"Name: {hotel.name}\")\n    print(f\"Price: ${hotel.price}\")\n    print(f\"Rating: {hotel.rating}\")\n    print(f\"Amenities: {hotel.amenities}\")\n    print(f\"URL: {hotel.url}\")\n    print(\"---\")\n\n# Limit results to 5 hotels\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"],\n    limit=5\n)\n\n# Sort by price (descending)\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"],\n    sort_by=\"price\"\n)\n\n# Sort by rating (descending)\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"],\n    sort_by=\"rating\"\n)\n\n# Default sort is by best value (highest rating/price ratio)\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"]\n)\n\n# Use an IATA airport code as location\nhotel_data = [HotelData(\n    checkin_date=\"2025-06-23\", \n    checkout_date=\"2025-06-25\", \n    location=\"HND\",  # Haneda Airport\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"]\n)]\nresult = get_hotels(\n    hotel_data=hotel_data,\n    guests=guests,\n    room_type=\"standard\",\n    amenities=[\"wifi\", \"breakfast\"]\n)\n```\n\n## API\n\n### get_hotels(hotel_data, guests, room_type=\"standard\", amenities=None, fetch_mode=\"common\", limit=None, sort_by=None)\n- `hotel_data`: List of `HotelData` objects\n- `guests`: `Guests` object (adults, children, infants)\n- `room_type`: \"standard\", \"deluxe\", or \"suite\"\n- `amenities`: List of preferred amenities (e.g., [\"wifi\", \"breakfast\"])\n- `fetch_mode`: \"common\", \"fallback\", \"force-fallback\", or \"local\"\n- `limit`: Maximum number of hotels to return (default: all)\n- `sort_by`: 'price', 'rating', or None (default: best value, i.e., highest rating/price ratio)\n- Returns: `Result` with `.hotels` (list of `Hotel`), `.lowest_price`, and `.current_price`\n\n### Models\n- `HotelData`: checkin_date, checkout_date, location (city name or IATA airport code), room_type, amenities\n- `Guests`: adults, children, infants\n- `Hotel`: name, price, rating, amenities, url\n- `Result`: hotels (list of Hotel), lowest_price, current_price\n\n### Fetch Modes\n- `\"common\"`: Use fast HTTP requests (default)\n- `\"fallback\"`: Use HTTP requests, fallback to Playwright if needed\n- `\"force-fallback\"`: Use Playwright directly\n- `\"local\"`: Use local Playwright instance\n\n## Location Support\nThe library automatically converts IATA airport codes to city names using a comprehensive airport database:\n- `\"HND\"` → `\"Tokyo\"`\n- `\"CDG\"` → `\"Paris\"`\n- `\"JFK\"` → `\"New York\"`\n- And many more...\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Fhotels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjongan69%2Fhotels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Fhotels/lists"}