Skip to content

HasData/rank-tracker-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Python SEO rank tracker that monitors your website's Google search positions for target keywords over time. Uses HasData SERP API to collect ranking data, generates visual charts and Excel reports. Track keyword rankings, analyze position changes, and export results automatically.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages