Companion code for a YouTube video showing how to find publicly visible email addresses from Google search snippets with the HasData Google SERP API.
Lightweight tutorial project: query Google SERP data, extract emails from snippets, and rank the best match for a person.
This repository includes small Python examples for:
- extracting every email found in search result snippets
- choosing the most likely email for one person
- processing a CSV file with multiple people and companies
pip install -r requirements.txtCreate .env:
HASDATA_API_KEY=your_api_key_hereRun the batch example:
python scraper_file_read.pyThe scripts build a Google-style search query from a person's name, company, and the word email, send that query to the HasData SERP API, and scan returned snippets for email addresses.
For matching mode, the project also compares the discovered email addresses with the target person's name and returns the closest candidate.
Person + Company
|
v
Build Google-style query
|
v
Request SERP data from HasData
|
v
Extract emails from snippets
|
v
Return all matches or best match
extract-emails-from-google-search/
|-- README.md
|-- readme-example.md
|-- requirements.txt
|-- people_info.csv
|-- scraper.py
|-- scraper_email_match.py
|-- scraper_file_read.py
`-- utils.py
- Python 3.10+
- A HasData API key
Install dependencies:
pip install -r requirements.txtCreate a .env file in the project root:
HASDATA_API_KEY=your_api_key_hereThe scripts load this variable automatically with python-dotenv.
Batch mode reads data from people_info.csv.
Expected format:
full_name,company
Roman Milyushkevich,Hasdata
Sergey Ermakovich,HasdataThe simplest example. It:
- builds a search query for one person
- requests Google SERP data from HasData
- extracts every email found in the organic result snippets
- prints the matches
Run:
python scraper.pySingle-person matching mode. It:
- searches for one person and company
- extracts emails from snippets
- scores each email against the target name
- prints the best candidate
Run:
python scraper_email_match.pyBatch mode for multiple people from CSV. It:
- reads
people_info.csv - searches for each person
- finds the best matching email
- prints the result person by person
Run:
python scraper_file_read.pyMatching logic lives in utils.py.
extract_emails()finds valid email patterns in snippet textname_email_similarity()compares the email local part with the target name- the highest similarity score wins
This is intentionally lightweight and easy to explain in a video, not a full identity-resolution system.
The scripts generate a query in this form:
"FirstName" "LastName" CompanyName email
Example:
"Roman" "Milyushkevich" Hasdata email
- Results depend on what Google snippets expose at request time.
- This approach only finds emails that appear publicly in search snippets.
- Accuracy is limited when multiple people share similar names.
- API usage depends on your HasData account and quota.
This project is meant to be extra material for a YouTube tutorial, so the code stays small, readable, and easy to follow. The focus is on demonstrating the core idea clearly rather than building a production-grade enrichment pipeline.
- lead research demos
- enrichment experiments
- tutorial material for scraping and SERP parsing
- lightweight prospecting workflows
This project is licensed under the MIT License. See LICENSE.

