{"id":28998695,"url":"https://github.com/luminati-io/google-maps-scraper","last_synced_at":"2025-10-29T07:11:25.115Z","repository":{"id":283783988,"uuid":"891016261","full_name":"luminati-io/Google-Maps-Scraper","owner":"luminati-io","description":"Extract Google Maps data, including reviews, ratings, photos, and more, with the top Google Maps Scraper API. Start your free trial today!","archived":false,"fork":false,"pushed_at":"2024-11-19T15:30:37.000Z","size":1399,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-22T07:02:01.499Z","etag":null,"topics":["data-collection","datasets","google-maps","google-maps-api","google-maps-reviews","google-maps-scraper","google-maps-scraping","reviews-scraper","reviews-scraper-api","web-scraping"],"latest_commit_sha":null,"homepage":"https://brightdata.com/products/serp-api/google-search/maps","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luminati-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-11-19T15:25:05.000Z","updated_at":"2025-02-13T04:58:05.000Z","dependencies_parsed_at":"2025-03-22T07:02:05.119Z","dependency_job_id":"72b2e416-cc93-415e-b5b0-dd6dde272188","html_url":"https://github.com/luminati-io/Google-Maps-Scraper","commit_stats":null,"previous_names":["luminati-io/google-maps-scraper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luminati-io/Google-Maps-Scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2FGoogle-Maps-Scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2FGoogle-Maps-Scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2FGoogle-Maps-Scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2FGoogle-Maps-Scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luminati-io","download_url":"https://codeload.github.com/luminati-io/Google-Maps-Scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luminati-io%2FGoogle-Maps-Scraper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261823775,"owners_count":23215150,"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","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":["data-collection","datasets","google-maps","google-maps-api","google-maps-reviews","google-maps-scraper","google-maps-scraping","reviews-scraper","reviews-scraper-api","web-scraping"],"created_at":"2025-06-25T07:09:32.637Z","updated_at":"2025-10-29T07:11:20.078Z","avatar_url":"https://github.com/luminati-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Maps Scraper\n\n## Table of Contents\n- [Free Google Maps Scraper](#free-google-maps-scraper)\n  - [Setup and Installation](#setup-and-installation)\n  - [How to Use the Scraper](#how-to-use-the-scraper)\n  - [Output](#output)\n- [Common Scraping Challenges](#common-scraping-challenges)\n- [Solution: Bright Data Google Maps Scraper API](#solution-bright-data-google-maps-scraper-api)\n  - [Using Google Maps Scraper API](#using-google-maps-scraper-api)\n  - [Customizing Data Collection with API Parameters](#customizing-data-collection-with-api-parameters)\n\n## Free Google Maps Scraper\nUse this free scraper to extract business reviews from Google Maps. You can retrieve details about reviewers, ratings, review text, photos, and more in just a few steps.\n\n### Setup and Installation\nBefore diving in, make sure you have these prerequisites installed:\n- Python 3.9+\n- Playwright (for browser automation)\n\nFollow these steps to get everything set up:\n1. Clone the repository to your local machine\n2. Navigate to the `free-scraper` directory\n3. Install the required dependencies:\n\n    ```bash\n    pip install playwright\n    playwright install\n    ```\n### How to Use the Scraper\nLet's walk through how to use the scraper:\n\n1. Open `main.py` and add your target Google Maps URLs:\n\n    ```python\n    urls = [\n            \"https://www.google.com/maps/place/Joe's+Pizza+Broadway/@40.7546835,-73.989604,17z/data=!3m1!5s0x89c259ab3e91ed73:0x4074c4cfa25e210b!4m8!3m7!1s0x89c259ab3c1ef289:0x3b67a41175949f55!8m2!3d40.7546795!4d-73.9870291!9m1!1b1!16s%2Fg%2F11bw4ws2mt?entry=ttu\",\n            \"https://www.google.com/maps/place/Googleplex/@37.4220583,-122.0878991,17z/data=!4m8!3m7!1s0x808fba02425dad8f:0x6c296c66619367e0!8m2!3d37.4220541!4d-122.0853242!9m1!1b1!16zL20vMDNiYnkx?hl=en\u0026entry=ttu\",\n            # Add as many URLs as you need\n        ]\n    ```\n2. Run the script using:\n\n    ```bash\n    python main.py\n    ```\n### Output\nThe scraper will save the results in [free_scraper_output.json](https://github.com/luminati-io/Google-Maps-Scraper/blob/main/sample_data/free_scraper_output.json), containing:\n```json\n{\n    \"reviewer_name\": \"Jacqueline\",\n    \"reviewer_link\": \"https://www.google.com/maps/contrib/108281841745817069467/reviews?hl=en-GB\",\n    \"reviewer_image\": \"https://lh3.googleusercontent.com/a-/ALV-UjUzl62rTNZOxsKGxvlnjM3leUg7DZostYzDJvG_8DUSNEtC7p-X=w36-h36-p-rp-mo-ba4-br100\",\n    \"rating\": 5,\n    \"date\": \"a week ago\",\n    \"text\": \"Went for lunch on a Tuesday at around 12:45pm. As usual, there was a line, but it moved really quickly and I was able to get my pizza 10 minutes later. Don't let the line deter you from trying Joe's! The pizza is great as always and the staff are nice. Never disappointed. I tried the caprese pizza and it was great!\\n\\nThere are a lot of people inside and outside so it can get hectic, but turnover for seats is quite quick and I got a seat on the bench outside almost right away.\",\n    \"photos\": [\n        \"https://lh5.googleusercontent.com/p/AF1QipMChGwUdQgWF9NAqdvss36KeuBZw_DAiuZy5yJj=w300-h225-p-k-no\",\n        \"https://lh5.googleusercontent.com/p/AF1QipNvachPq2HyJU0_3hs0DsRDRChaHZrQDDKOc3hz=w300-h225-p-k-no\"\n    ],\n    \"likes_count\": \"1\"\n}\n```\n\nEach review entry contains:\n- **Reviewer Details**: Name, profile link, and avatar image\n- **Review Content**: Star rating, date posted, and full review text\n- **Media**: URLs of any attached photos\n- **Engagement**: Number of likes the review received\n\n## Common Scraping Challenges\nScraping data from Google Maps can be quite challenging. Here are some common issues you may encounter:\n1. **Dynamic Content Loading:** Google Maps uses a dynamic loading mechanism where reviews are fetched via XHR/API calls as the user scrolls. Without proper handling of these dynamic requests and waiting for content to load, scrapers may only capture partial data.\n2. **DOM Structure Changes:** Google frequently updates their DOM structure, class names, and data attributes. This requires regular maintenance of scraping logic to adapt to structural changes.\n3. **Rate Limiting and Detection:** Scraping Google Maps can trigger anti-bot defenses, which may result in rate limiting or IP bans. \n\n## Solution: Bright Data Google Maps Scraper API\nIf you need reliable, large-scale data extraction, use [Bright Data Google Maps Scraper API](https://brightdata.com/products/serp-api/google-search/maps). Here's why it works better:\n- No proxy management is needed\n- Scrape from any location worldwide\n- Access to 72M+ real IPs across 195 countries\n- Multiple data delivery options (S3, Cloud Storage, etc.)\n- GDPR and CCPA compliant\n- 24/7 technical support\n\nPlus, you get **20 free API calls** to test it out.\n\n## Using Google Maps Scraper API\nYou can collect detailed Google Maps reviews by simply providing a URL.\n\n\u003cimg width=\"700\" alt=\"bright-data-web-scraper-api-google-maps-reviews\" src=\"https://github.com/luminati-io/Google-Maps-Scraper/blob/main/google-maps-review-example.PNG\"\u003e\n\n\u003e For a detailed guide on setting up the Google Maps Scraper API, check our [Step-by-Step Setup Guide](https://github.com/luminati-io/Google-Maps-Scraper/blob/main/scraper_api_setup.md#setting-up-google-maps-scraper-api).\n\n**Key Input Parameters:**\n\n| **Parameter** | **Type** | **Description**                         | **Required** |\n|---------------|----------|-----------------------------------------|--------------|\n| `url`         | string   | Google Maps business URL               | Yes          |\n| `days_limit`  | number   | Number of days to retrieve reviews from | No           |\n\n**Sample Output Data:**\n\n```json\n{\n    \"url\": \"https://www.google.com/maps/place/Apple+Apple+Park+Visitor+Center/@37.3327772,-122.0079593,17z/data=!4m18!1m9!3m8!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!2sApple+Apple+Park+Visitor+Center!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg!3m7!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg?entry=ttu\",\n    \"place_id\": \"ChIJ0aPn18W1j4ARgC9zTSPeQRc\",\n    \"place_name\": \"Apple Apple Park Visitor Center\",\n    \"country\": \"US\",\n    \"address\": \"10600 N Tantau Ave, Cupertino, CA 95014\",\n    \"review_id\": \"ChdDSUhNMG9nS0VJQ0FnSUMzcDdqMHJRRRAB\",\n    \"reviewer_name\": \"Krzysztof Wojtczak\",\n    \"reviews_by_reviewer\": 32,\n    \"photos_by_reviewer\": \"12\",\n    \"reviewer_url\": \"https://www.google.com/maps/contrib/110797405132582450368/reviews?hl=en\",\n    \"local_guide\": true,\n    \"review_rating\": 5,\n    \"review\": \"Fajnie można spędzić czas, czilując na tarasie z kawką 🤙\",\n    \"review_date\": \"2024-11-09T22:18:01.713Z\",\n    \"number_of_likes\": 0,\n    \"response_of_owner\": null,\n    \"response_date\": null,\n    \"photos\": [\n      \"https://lh5.googleusercontent.com/p/AF1QipOtSDFfVpLL5GopXJzoFbTapha0G91nmEx5aSus\",\n      \"https://lh5.googleusercontent.com/p/AF1QipPcr5_TU6MWhAu1_K54DbxywZ4O88Q_qT7NSnhv\",\n      \"https://lh5.googleusercontent.com/p/AF1QipNLM5jHD0iDozGHsax9ydGAWUI_pn_fujQ3Q4Wr\",\n      \"https://lh5.googleusercontent.com/p/AF1QipPcKPwXyHDawuClpTpfV3zE7vMFO0UabmdjX9IG\"\n    ],\n    \"timestamp\": \"2024-11-10T07:37:58.326Z\",\n    \"input\": {\n      \"url\": \"https://www.google.com/maps/place/Apple+Apple+Park+Visitor+Center/@37.3327772,-122.0079593,17z/data=!4m18!1m9!3m8!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!2sApple+Apple+Park+Visitor+Center!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg!3m7!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg?entry=ttu\",\n      \"days_limit\": 30\n    }\n  }\n```\nYou can view the full output by downloading [this sample JSON file](https://github.com/luminati-io/Google-Maps-Scraper/blob/main/sample_data/api_scraper_output.json).\n\n**Code Example:**\n\nHere’s a Python script to collect Google Maps reviews and store results in a JSON file:\n\n```python\nimport requests\nimport json\nimport time\n\n\nclass BrightData:\n    def __init__(self, api_token):\n        self.api_token = api_token\n        self.headers = {\n            \"Authorization\": f\"Bearer {api_token}\",\n            \"Content-Type\": \"application/json\",\n        }\n\n    def collect_reviews(self, urls_data):\n        \"\"\"\n        Collect Google Maps reviews using BrightData API\n        \"\"\"\n        # 1. Trigger data collection\n        print(\"Starting data collection...\")\n        trigger_response = self._trigger_collection(urls_data)\n        snapshot_id = trigger_response.get(\"snapshot_id\")\n        print(f\"Snapshot ID: {snapshot_id}\")\n\n        # 2. Wait for data to be ready\n        print(\"Waiting for data...\")\n        while True:\n            status = self._check_status(snapshot_id)\n            print(f\"Status: {status}\")\n\n            if status == \"ready\":\n                # Check if data is actually available\n                data = self._get_data(snapshot_id)\n                if data and len(data) \u003e 0:\n                    break\n            time.sleep(10)  # Wait 10 seconds before next check\n\n        # 3. Get and save the data\n        print(\"Saving data...\")\n        filename = f\"api_scraper_output.json\"\n        with open(filename, \"w\", encoding=\"utf-8\") as f:\n            json.dump(data, f, indent=2, ensure_ascii=False)\n        print(f\"✓ Data saved to {filename}\")\n        print(f\"✓ Collected {len(data)} reviews\")\n        return data\n\n    def _trigger_collection(self, urls_data):\n        \"\"\"Trigger data collection\"\"\"\n        response = requests.post(\n            \"https://api.brightdata.com/datasets/v3/trigger\",\n            headers=self.headers,\n            params={\"dataset_id\": \"gd_luzfs1dn2oa0teb81\",\n                    \"include_errors\": \"true\"},\n            json=urls_data,\n        )\n        return response.json()\n\n    def _check_status(self, snapshot_id):\n        \"\"\"Check collection status\"\"\"\n        response = requests.get(\n            f\"https://api.brightdata.com/datasets/v3/progress/{snapshot_id}\",\n            headers=self.headers,\n        )\n        return response.json().get(\"status\")\n\n    def _get_data(self, snapshot_id):\n        \"\"\"Get collected data\"\"\"\n        response = requests.get(\n            f\"https://api.brightdata.com/datasets/v3/snapshot/{snapshot_id}\",\n            headers=self.headers,\n            params={\"format\": \"json\"},\n        )\n        return response.json()\n\n\nif __name__ == \"__main__\":\n    # Initialize with your API token\n    brightdata = BrightData(\"\u003cYOUR_API_TOKEN\u003e\")\n\n    # Define URLs to collect reviews from\n    urls_to_collect = [\n        {\n            \"url\": \"https://www.google.com/maps/place/Apple+Apple+Park+Visitor+Center/@37.3327772,-122.0079593,17z/data=!4m18!1m9!3m8!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!2sApple+Apple+Park+Visitor+Center!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg!3m7!1s0x808fb5c5d7e7a3d1:0x1741de234d732f80!8m2!3d37.332773!4d-122.0053844!9m1!1b1!16s%2Fg%2F11rjtz4vtg?entry=ttu\",\n            \"days_limit\": 30,\n        },\n        {\n            \"url\": \"https://www.google.com/maps/place/Joe's+Pizza+Broadway/@40.7546835,-73.989604,17z/data=!3m1!5s0x89c259ab3e91ed73:0x4074c4cfa25e210b!4m8!3m7!1s0x89c259ab3c1ef289:0x3b67a41175949f55!8m2!3d40.7546795!4d-73.9870291!9m1!1b1!16s%2Fg%2F11bw4ws2mt?entry=ttu\",\n            \"days_limit\": 25,\n        },\n    ]\n\n    # Collect reviews\n    reviews = brightdata.collect_reviews(urls_to_collect)\n```\n\n**How the Code Works:**\n1. **API Token Required:** First, you'll need an API token. If you don't have one yet, follow our [Google Maps Scraper API setup guide](https://github.com/luminati-io/Google-Maps-Scraper/blob/main/scraper_api_setup.md#setting-up-google-maps-scraper-api).\n2. **Start Data Collection:** Pass your API token to the code, and it will initiate data collection with your specified parameters. This returns a `snapshot_id` that you'll use to track your request.\n3. **Wait for Results:** The data collection takes a few minutes to complete. During this time, our code continuously checks the `snapshot_id` status:\n    - Status \"running\" = Data is still being collected\n    - Status \"ready\" = Data collection is complete and saved to your JSON file\n4. **Additional Parameters:** You can customize your data collection by adding more parameters to the `_trigger_collection` function. Check the [next section](https://github.com/luminati-io/Google-Maps-Scraper?tab=readme-ov-file#customizing-data-collection-with-api-parameters) to see what parameters are available and learn about different data delivery methods.\n\n### Customizing Data Collection with API Parameters\nUse the following API parameters to customize your data collection:\n\n| **Parameter**       | **Type**   | **Description**                                                                                   | **Example**                                           |\n|---------------------|------------|---------------------------------------------------------------------------------------------------|-------------------------------------------------------|\n| `limit`             | `integer`  | Limit the number of results returned for each input.                                            | `limit=10`                                           |\n| `include_errors`    | `boolean`   | Include an error report in the output for troubleshooting.                                      | `include_errors=true`                                |\n| `notify`            | `url`      | URL where a notification is sent once the collection completes.                                  | `notify=https://notify-me.com/`                      |\n| `format`            | `enum`     | Format for data delivery. Supported formats: JSON, NDJSON, JSONL, CSV.                          | `format=json`|\n\n💡**Additional delivery methods:** You can choose to deliver the data via [webhook](https://docs.brightdata.com/scraping-automation/web-data-apis/web-scraper-api/overview#via-webhook) or through the [API](https://docs.brightdata.com/scraping-automation/web-data-apis/web-scraper-api/overview#via-api).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluminati-io%2Fgoogle-maps-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluminati-io%2Fgoogle-maps-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluminati-io%2Fgoogle-maps-scraper/lists"}