Companion code for a YouTube video showing how to track your website SEO rank with HasData Google SERP API.
Lightweight tutorial project: query Google SERP data, extract LinkedIn profiles, emails, location etc. From search results, and rank the best match for a person.
This repository runs main.py to do the following:
- Read the settings files, where user inputs desired queries and domain to target
- Uses HasData Google SERP API to find the rank for the specified domain and queries.
- Saves the results in the repo output folder with these formats: JSON, EXCEL, Graph Image PNG
- Repeats this process every 4h to update the data.
pip install -r requirements.txtCreate .env
HASDATA_API_KEY=your_api_key_hereRun the batch example:
python src/main.pyRead Input from Settings folder
|
v
Scrape the rank of the domain for specified queries
|
v
Save results in output/
|
v
Repeat every 4h
extract-emails-from-google-search/
|-- assets/
|-- banner.png
|-- youtube-preview.png
|-- output/
|-- example.com.json
|-- example.com.png
|-- example.com.xlsx
|-- settings/
|-- search_queries.txt
|-- target_domain.txt
|-- src/
|-- __init__.py
|-- api.py
|-- main.py
|-- utils.py
|-- visualization.py
|-- .env
|-- .gitignore
|-- LICENSE
|-- README.md
|-- requirements.txt
- Python 3.10+
- A HasData API key
Install dependencies:
pip install -r requirements.txtCreate .env in the project root,
HASDATA_API_KEY=your_api_key_hereThe scripts load this variable automatically with python-dotenv.
- Results depend on what Google snippets expose at request time.
- This approach only finds domains that appear publicly in search results.
- Google tends to not give the same results for the same search query everytime.
- 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 pipeline.
- PR research
- Market research
- tutorial material for scraping and SERP parsing
- Business performance tracking
This project is licensed under the MIT License. See LICENSE.