https://github.com/kaymen99/google-maps-lead-generator
Extract Google Maps business leads and enrich contact details using AI & web scraping
https://github.com/kaymen99/google-maps-lead-generator
ai-agents ai-scraping data-scraping google-maps google-maps-api lead-generation web-scraping
Last synced: 9 months ago
JSON representation
Extract Google Maps business leads and enrich contact details using AI & web scraping
- Host: GitHub
- URL: https://github.com/kaymen99/google-maps-lead-generator
- Owner: kaymen99
- Created: 2025-06-09T12:43:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-24T11:31:47.000Z (about 1 year ago)
- Last Synced: 2025-07-29T03:01:17.547Z (12 months ago)
- Topics: ai-agents, ai-scraping, data-scraping, google-maps, google-maps-api, lead-generation, web-scraping
- Language: Python
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Google Maps Lead Generation: Find Business data Using AI**
## 👉 **[How to Scrape Unlimited Google Maps Leads Using AI!](https://dev.to/kaymen99/how-to-scrape-unlimited-google-maps-leads-using-ai-4kem)**
This **AI lead generation tool** helps you discover and enrich local businesses data from any location. It combines the power of **Serper Maps API** with intelligent **AI web scraping** to build comprehensive business prospect lists that are ready for your sales outreach campaigns!
https://github.com/user-attachments/assets/e65275a6-0369-4f37-bb5d-f81f41f97409
## **Why This Tool?**
- **Cost-Efficient** – Generate lead lists at the fraction of the cost of other scrapers
- **Fully Automated** – Handles the entire process from location search to lead enrichment
- **Contact Detail Extraction** – Automatically finds emails, social media profiles, and more
- **Smart Web Scraping** – Uses AI to navigate websites and extract relevant information
- **Ready-to-Use Output** – Generates Excel files you can immediately use for outreach
- **Multi-LLM Integration** – Choose any AI models like GPT-4.1, Claude or DeepSeek to run your search
## **How It Works**
The tool workflow is simple:
### 1. Data Collection
- Takes a location and search query input (e.g., "Toronto", "Realtors")
- Uses **Serper Maps API** to scrape Google Maps places data
- Returns a list of relevant places with basic information (business name, address, website, phone, etc.)
### 2. Data Enrichment
- For each business found, the tool scrapes their website (landing or contact pages)
- Uses an **AI agent (LLM)** to intelligently identify:
- Email addresses
- Detailed contact information
- Social media links (Facebook, Twitter, Instagram, etc)
- Other relevant data points for outreach
### 3. Data Export
- Saves all collected and enriched data to an Excel file, under the `data` directory
- Organizes information in a clean, ready-to-use format for sales outreach
## **Cost Implications**
While other Google Maps scrapers like [Apify's Google Maps Extractor](https://apify.com/compass/google-maps-extractor) or [Crawler Google Places](https://apify.com/compass/crawler-google-places) charge **$5-10 per 1000 results** (depending on the options you choose), this system leverages the Serper API and efficient web scraping to deliver the same results for approximately **$0.2 per 1000 leads** – that's up to **50x cheaper**!
Even better, Serper API offers **free credits** when you sign up, making your initial lead generation campaigns essentially **free**!
## 🛠️ **Project Structure**
```
.
├── main.py # Main application script
├── process_from_excel.py # Script to process existing Excel files
├── src/
│ ├── places_api.py # Serper Maps API integration
│ ├── web_scraper.py # Web scraping utilities with Playwright
│ ├── business_info.py # Contact extraction and business data enrichment
│ ├── data_export.py # Excel export functions
│ └── utils.py # Utility functions
├── data/ # Output folder for generated Excel files
└── requirements.txt # Python dependencies
```
## **How to Use**
### Prerequisites
- Python 3.8+ installed
- Serper API key ([Get one here](https://serper.dev/))
- [OpenRouter API key](https://openrouter.ai/) (to use any LLM model) or you preferred LLM API key, like OpenAI or Claude
### Setup
Clone the repository and install dependencies:
```bash
# Clone the repository
git clone https://github.com/kaymen99/google-maps-lead-generator
cd google-maps-lead-generator
# Install dependencies
pip install -r requirements.txt
```
### Set up your API keys
Create a `.env` file in the root directory of the project and add your API keys:
```bash
SERPER_API_KEY=your-serper-api-key
OPENROUTER_API_KEY=your-openrouter-api-key
```
### Running the Tool
Edit the parameters directly in `main.py` to customize your search:
```python
# In main.py
location = "Toronto" # Location to search into
search_query = "Realtors" # Local business to search for
num_pages = 1 # Each page contains 20 results
```
Then you can run the tool with:
```bash
# Simply run the main.py file
python main.py
```
### Running from Streamlit App
You can also run the tool from a Streamlit app by running:
```bash
streamlit run app.py
```
### 📊 **Output Files**
The tool automatically generates an Excel file in the `/data` directory at the root of your project:
- `data_[Query]_[Location]_[Date].xlsx`: Complete enriched business data including:
- Business names and addresses
- Phone numbers
- Website URLs
- **Extracted email addresses**
- **Social media profiles** (Facebook, Twitter, Instagram)
- **Contact information**
- Additional business metadata (if you want to add more data like products, services, etc.)
This file is ready to use for your outreach campaigns with all the necessary contact details in one place!
## **Contributing**
Contributions are welcome! Please open an issue or submit a pull request for any changes.
## **Contact**
If you have any questions or suggestions, feel free to reach out!