Skip to content

Latest commit

 

History

History
129 lines (94 loc) · 3.02 KB

File metadata and controls

129 lines (94 loc) · 3.02 KB

Python Requests dotenv

SEO Rank Tracker

HasData_bannner

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.

Watch the video

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.

Quick Start

pip install -r requirements.txt

Create .env

HASDATA_API_KEY=your_api_key_here

Run the batch example:

python src/main.py

Workflow

Read Input from Settings folder
       |
       v
Scrape the rank of the domain for specified queries
       |
       v
Save results in output/
       |
       v
Repeat every 4h

Project Structure

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

Requirements

  • Python 3.10+
  • A HasData API key

Install dependencies:

pip install -r requirements.txt

Configuration

Create .env in the project root,

HASDATA_API_KEY=your_api_key_here

The scripts load this variable automatically with python-dotenv.

Scripts

Run

src/main.py

Notes

  • 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.

Why This Repo Exists

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.

Use Cases

  • PR research
  • Market research
  • tutorial material for scraping and SERP parsing
  • Business performance tracking

License

This project is licensed under the MIT License. See LICENSE.