AxioAPI

SEO report API: build a domain ranking report

By the AxioAPI team · Published

A domain ranking report answers three questions: how visible the site is, who links to it and what queries it ranks for. With an SEO report API you can build it with three calls and a short script instead of exporting from a dashboard.

SEO report API: build a domain ranking report

The three calls

  • GET /api/v1/seo/domains/{domain} returns the domain overview with the figures from each data source, plus the detected CMS, web server and MX records.
  • GET /api/v1/seo/domains/{domain}/backlinks returns the backlink summary.
  • GET /api/v1/seo/keywords/suggestions returns keyword suggestions and related search queries.

The report script

The script calls the three endpoints for one domain and merges them into a single dictionary. It also sets an incomplete flag and lists the missing sources, so a report with a gap is never mistaken for a full one.

import os
import requests

API = "https://axioapi.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['AXIOAPI_KEY']}", "Accept": "application/json"}


def get(path, **params):
    res = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=60)
    res.raise_for_status()
    return res.json()["data"]


def domain_report(domain):
    overview = get(f"/seo/domains/{domain}", country="US")
    backlinks = get(f"/seo/domains/{domain}/backlinks")
    suggestions = get("/seo/keywords/suggestions", keyword=domain)
    return {
        "domain": domain,
        "overview_sources": overview["sources"],
        "cms": overview.get("cms"),
        "backlink_sources": backlinks["sources"],
        "keyword_suggestions": suggestions.get("suggestions", []),
        "incomplete": overview["partial"] or backlinks["partial"],
        "missing_sources": sorted(set(overview["missing"]) | set(backlinks["missing"])),
    }


print(domain_report("example.com"))

Turn it into a recurring report

Run the script on a schedule, store the output with the date and compare it with the previous run. Answers can be cached for several days, so running it more than once a day shows no new data and only costs requests.

Audit the pages behind the numbers

A report shows where a site stands but not why. Run the on-page audit endpoint on the pages that matter to check the title, meta description, headings, canonical and structured data in one call.

The audit checks the page itself. Whether Google has indexed it is a separate question that you answer in Search Console.