API Documentation

SAG Tool API Guide

Updated April 2026 · Business plan only

The SAG Tool API lets you run programmatic SEO, AEO and GEO audits against any URL and receive full JSON results including scores, all 26 rule results, line numbers, and replacement HTML. Available on the Business plan.

Base URL: https://sagtool.com/api/v1  ·  Format: JSON  ·  Auth: Bearer token

Getting Your API Key

Your API key is in your Business dashboard under API Access. It looks like sk-sag-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. You can regenerate it at any time — regenerating immediately invalidates the old key.

Authentication

Include your API key in every request as a Bearer token in the Authorization header:

# All requests require this header Authorization: Bearer sk-sag-your-api-key-here Content-Type: application/json

Endpoints

POST /api/v1/audit

Audit a single URL. Returns full scores, all 26 rules, line numbers, and replacement HTML.

Request body

Field Type Required Description
url string required The URL to audit

Example request

curl -X POST https://sagtool.com/api/v1/audit \ -H "Authorization: Bearer sk-sag-your-key" \ -H "Content-Type: application/json" \ -d '{"url": "https://yoursite.com/page"}'

Example response

{ "url": "https://yoursite.com/page", "campaign_id": "yoursite_com_20260428_123456", "grade": "B", "scores": { "seo": 84, "aeo": 53, "geo": 100, "composite": 77 }, "rules": [ { "id": "question_h2s", "discipline": "AEO", "label": "H2s phrased as questions", "status": "failing", "why_failed": "Statement H2s found — rephrase as questions", "line_number": 403, "current_html": "<h2>How It Works</h2>", "replace_with": "<h2>How Does It Work?</h2>" } ], "audited_at": "2026-04-28T12:00:00" }
POST /api/v1/bulk

Audit multiple URLs in a single request. Returns summary scores for each URL. Maximum 50 URLs per request.

Request body

Field Type Required Description
urls array required Array of URLs to audit (max 50)

Example request

curl -X POST https://sagtool.com/api/v1/bulk \ -H "Authorization: Bearer sk-sag-your-key" \ -H "Content-Type: application/json" \ -d '{"urls": ["https://site.com/p1", "https://site.com/p2"]}'

Example response

{ "count": 2, "results": [ { "url": "https://site.com/p1", "grade": "A", "composite": 94, "seo": 96, "aeo": 92, "geo": 100, "campaign_id": "site_com_p1_20260428_123456" } ] }

Error Responses

# 401 — Missing or invalid API key {"error": "Invalid API key"} # 403 — Not on Business plan {"error": "API access requires Business tier"} # 400 — Missing required field {"error": "url required"} # 500 — Audit failed {"error": "Could not fetch URL"}
← BACK TO DASHBOARD
By Updated April 2026