Python For SEO
Practical Python for SEO practitioners - scripts, automation tools, and step-by-step guides for technical SEO work.
Python has become one of the most useful tools in a technical SEO practitioner’s stack. Not because you need to be a developer — but because a little automation goes a long way when you’re managing hundreds of pages, tracking performance across dozens of clients, or trying to do something no existing tool does yet.
This section covers practical Python for SEO work — scripts, workflows, and real tools built for the kinds of problems SEO practitioners actually run into.
Why Python for SEO
Most SEO tools are built for the average use case. Python is for everything else:
- Automating repetitive reporting tasks
- Processing large crawl exports faster than Excel can handle
- Building custom tracking workflows for things no tool tracks yet
- Pulling data from APIs — Google Search Console, GA4, Perplexity, and others
- Cleaning and transforming data before it goes into a dashboard
Tools I’ve Built
These are open-source Python tools I built to solve real GEO and SEO tracking problems. All free on GitHub.
citation_tracker.py
Track whether your brand appears in LLM responses across a set of prompts you define. Queries the Perplexity API, logs citation presence and context snippets to CSV, and appends on each run so you can track trends over time.
prompt_variation_tester.py
Auto-generates prompt variations around any brand and topic, then tests each one against the Perplexity API. Reveals which question phrasings are most likely to surface your brand in LLM responses. Works for any industry.
geo_content_auditor.py
Scrapes any URL and scores it against a GEO readiness checklist — entity signals, structured data, E-E-A-T indicators, citation-friendly formatting, heading structure, and content depth. Outputs a scored report with prioritized recommendations.
View all tools on GitHub: github.com/adthaxton/llm-citation-tracker
Getting Started with Python for SEO
If you’re new to Python, here’s the minimum you need to run the tools above:
- Install Python — download from python.org, version 3.8 or higher
- Install dependencies — open Terminal or Command Prompt and run:
pip install requests beautifulsoup4 python-dotenv - Get a Perplexity API key — free tier available at perplexity.ai/settings/api
- Download the scripts — from github.com/adthaxton/llm-citation-tracker
- Edit the config — open the script in any text editor, set your brand name and prompts at the top
- Run it — in Terminal, navigate to the folder and type
python citation_tracker.py
Coming soon
- GSC data pulls with Python
- Screaming Frog export processing
- Automated Looker Studio data pipelines
- GA4 API reporting scripts