How to extract data from Google maps using Golang

This post introduces a command-line application that allows you to extract data from Google Maps.

If you want to extract to collect some data for local businesses using Google Maps then this tool is for you.

The tools retrieve and export to a CSV file the following data:

  • Title: the title of the business

  • Category: the category of the business

  • Address: the address of the business

  • OpenHours: the opening hours of the business

  • Website: the website of the business

  • Phone: the phone number of the business

  • PlusCode: the plus code of the business

  • ReviewCount: the number of reviews

  • ReviewRating: the rating of the results

Getting started

  1. create a file with your queries like:

     bars in Athens
     doctor in Berlin
     doctor in Bonn
    
  2. Make sure you have Docker installed

  3.  docker run -v $PWD/example-queries.txt:/example-queries -v $PWD:/results gosom/google-maps-scraper -depth 1 -input /example-queries -results /results/result-file.csv
    
  4. wait for it to finish. The program does not exits automatically. When there are no updates in the console for some time you can hit CTRL-C. Meanwhile you will see that the file result-file.csv will be populated

  5. Results will be to the file result-file.csv

Notes: Please adjust the filenames to the desired ones.

Conclusion

In this blog post, I introduced google-maps-scraper command line tool.

The tool is built using the Go programming language and it uses scrapemate .

All the code is on Github. Feel free to create an Issue or leave a comment here if you run into problems or you have some ideas for extension.