Pulling Semrush AI Visibility and SEO Metrics with Python A developer published a Python workflow that uses the Semrush All-in-One Scraper on Apify to pull classic SEO metrics and AI Search visibility data in a single request. The actor's domain mode returns authority scores, traffic, backlink profiles, and per-LLM mention and citation counts across ChatGPT, Google AI Overview, AI Mode, and Gemini, with an example script using apify-client and pandas to snapshot competitor domains to CSV. The author notes the actor supports up to 100 domains per run with configurable concurrency, avoiding manual exports for agencies tracking dozens of rivals. Most SEO dashboards still treat Google blue links as the whole picture. Over the past year, though, clients started asking a harder question: how often do ChatGPT, Gemini, and Google AI Overviews actually cite our domain compared to our rivals? You can click through Semrush by hand to check this, domain by domain, or pay for API add-on units on top of a monthly seat. When you track 30 to 100 competitor domains every Monday, manual exports break down fast. One practical alternative is running the Semrush All-in-One Scraper https://apify.com/pro100chok/semrush-scraper?fpr=raven on Apify. It has over 4,600 users and more than 320,000 runs, and it packages four distinct modes domain , keyword , seo audit , and top websites behind one JSON interface. In domain mode, a single request pulls both classic SEO totals and AI Search visibility into one flat-plus-nested JSON object: | Metric group | Example fields returned | |---|---| | Domain authority | authority score , moz domain authority , moz spam score | | Search traffic | organic traffic , total traffic , organic keywords , paid traffic | | Link profile | backlinks , referring domains , backlinks list , referring domains list | | AI Search | ai visibility , ai mentions , ai cited pages , ai search.by llm | The ai search.by llm section breaks down mentions and cited pages across ChatGPT, Google AI Overview, AI Mode, and Gemini. It also includes top cited sources , which lists third-party sites that models frequently cite alongside a domain. For digital PR teams, that list is basically a ready-made outreach target sheet. Row-level lists are opt-in, so you do not have to haul megabytes of nested arrays when you only need headline KPIs. Toggle include organic keywords , include backlinks up to 80 per domain via backlinks limit , or include referring domains up to 60 via referring domains limit whenever you want deeper tables. Here is a small script using apify-client and pandas that checks a batch of SaaS competitors in the US database, grabs their Moz scores and top keywords, and saves a clean CSV snapshot. python import os import pandas as pd from apify client import ApifyClient client = ApifyClient os.environ "APIFY TOKEN" run input = { "mode": "domain", "domains": "backlinko.com", "ahrefs.com", "moz.com", "searchengineland.com" , "database": "us", "include moz": True, "include organic keywords": True, "include backlinks": True, "backlinks limit": 20, "concurrency": 20, } run = client.actor "pro100chok/semrush-scraper" .call run input=run input items = list client.dataset run "defaultDatasetId" .iterate items rows = for item in items: by llm = { entry "llm" : entry.get "mentions", 0 for entry in item.get "ai search", {} .get "by llm", } rows.append { "domain": item.get "domain" , "authority score": item.get "authority score" , "organic traffic": item.get "organic traffic" , "referring domains": item.get "referring domains" , "ai visibility": item.get "ai visibility" , "chatgpt mentions": by llm.get "ChatGPT", 0 , "ai overview mentions": by llm.get "AI Overview", 0 , "moz da": item.get "moz domain authority" , } df = pd.DataFrame rows .sort values "ai visibility", ascending=False df.to csv "weekly seo ai snapshot.csv", index=False print df.to string index=False Notice concurrency: 20 . Because the actor accepts up to 100 domains per run, a 50-domain agency portfolio finishes in one short job instead of looping through single-domain requests. If you already have this actor wired into your pipeline, you can reuse the exact same API call pattern for three adjacent tasks: keyword keywords and pick a regional database 90+ countries or worldwide . You get search volume, CPC, Keyword Difficulty, search intent, 12-month trend data, related questions, and live SERP snapshots. seo audit response time ms , h1 count , word count , images missing alt , canonical , has robots txt , and has sitemap right next to the domain's Semrush organic context. top websites country top websites and industry top websites for market sizing. Instead of paying a recurring monthly subscription just to export a few hundred rows, billing is strictly pay-per-event on each dataset result returned: $4.00 per 1,000 results on paid Apify plans $15.00 per 1,000 on the free tier . For a weekly check of 50 domains 200 results a month , that comes out to roughly $0.80 a month on a paid Apify plan. Even if you run quarterly audits on 1,000 domains, you only spend $4.00 and keep your pipeline completely serverless. If your team needs Semrush domain metrics, backlink samples, and per-LLM AI Search visibility inside Python notebooks, Looker Studio, or automated Slack alerts, give the Semrush All-in-One Scraper https://apify.com/pro100chok/semrush-scraper?fpr=raven a test run on five of your own URLs first. Inspect the nested JSON once, map the columns you care about, and schedule it to run while you sleep.