Skip to content

A Streamlit-based tool to search and collect business information from Google Maps using Places API. Filter by city, business type, and rating, then export to CSV.

License

Notifications You must be signed in to change notification settings

ty70/google-map-scraper-with-streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Maps Scraper with Streamlit UI

This is a web application that automatically collects store information from Google Maps based on specified conditions (municipality, business type, rating) and outputs the results as a CSV file. It utilizes the Google Places API.


✨ Features

  • Specify a municipality (e.g., "Shinjuku, Tokyo")
  • Input a business type (e.g., "hair salon")
  • Set a minimum rating (e.g., "4.0")
  • Download the result as a CSV file

🚀 How to Run

1. Install Required Libraries

pip install streamlit requests

2. Register Your Google Places API Key

Paste the obtained API Key into the API_KEY field in streamlit_app.py

# streamlit_app.py
# ----------------------------------
# A tool that uses Streamlit to input parameters for the Google Places API via a GUI and outputs results in CSV format
# Input: Region name (municipality), business type (e.g., hair salon), minimum rating
# Output: Display intermediate store info and allow CSV download
# ----------------------------------

import streamlit as st
import requests
import csv
import io
from urllib.parse import urlencode

API_KEY = "Paste your API key here"  # Set your API key here
PLACES_URL = "https://maps.googleapis.com/maps/api/place/textsearch/json"

3. Run the Streamlit App

streamlit run streamlit_app.py

Input

Enter location, business type, and rating, then press the "Start Search" button.


📦 Output

The results of the search will be displayed in a table showing:

  • Store name
  • Rating
  • Number of reviews
  • Phone number
  • Address
  • Google Maps URL

Clicking the CSV download button will export the above table as a CSV file.


🔧 Project Structure

.
├── streamlit_app.py
├── output/
│   └── results.csv
├── README_ja.md
└── README.md      # this file

Notes

  • Using the API may incur charges, so please monitor your API Key usage.
  • For issues or bugs, feel free to open an issue.

🙏 License

MIT License.

About

A Streamlit-based tool to search and collect business information from Google Maps using Places API. Filter by city, business type, and rating, then export to CSV.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages