HubSEOhubseoDocs
REST API & Webhooks

Audits API

Read measured audit results and fix directives for audits run in HubSEO. Creating audits through the API is not available yet.

The Audits API lets applications and CI/CD pipelines read audits that were run in HubSEO at /seo-audit. Creating an audit through the API is not implemented yet.

Trigger an Audit (not available)

POST /api/v1/audits

The request body is validated (url required, device one of "mobile" or "desktop"). A body that fails validation returns 422. A valid request returns 501, because no API audit queue exists:

Response (501 Not Implemented)

{
  "error": {
    "code": "not_implemented",
    "message": "Creating audits through the API is not available yet. Run audits at /seo-audit."
  }
}

Get Audit Result

Retrieve a completed audit report you own.

GET /api/v1/audits/{id}

Response (200 OK)

{
  "data": {
    "id": "aud_01j7x4m8p2q9",
    "status": "completed",
    "url": "https://example.com",
    "overall_score": 88,
    "scores": {
      "performance": 82,
      "seo": 95,
      "accessibility": 91,
      "best_practices": 85
    },
    "core_web_vitals": {
      "status": "measured",
      "metrics": {
        "lcp_ms": 1820,
        "cls": 0.04,
        "inp_ms": 120,
        "fcp_ms": 1100,
        "ttfb_ms": 320
      },
      "diagnostics": {
        "lcp_element_selector": "header > h1.hero-title",
        "lcp_asset_url": null,
        "lcp_byte_size": null,
        "render_blocking_count": 0,
        "long_tasks_count": 2
      }
    },
    "findings_summary": {
      "critical": 1,
      "warning": 3,
      "passed": 28
    },
    "created_at": "2026-09-14T16:00:00.000Z"
  }
}

Every score, metric, diagnostic and count is read from the stored report. Anything the audit did not measure is null, never 0. core_web_vitals.status is measured when at least one metric was recorded, otherwise unavailable.


Get AI-Ready Fix Directives

Retrieve dual-sided fix prompts formatted for human reviewers and coding agents (Cursor, Claude Code, Copilot).

GET /api/v1/audits/{id}/fixes

Response (200 OK)

{
  "data": [
    {
      "id": "fix_lcp-image-preload",
      "category": "performance",
      "severity": "high",
      "human_summary": "Hero image is discovered late, delaying LCP.",
      "why_it_matters": null,
      "next_step": "Preload the hero image with fetchpriority=\"high\".",
      "agent_prompt": "Fix the high performance finding \"Hero image is discovered late, delaying LCP.\" on https://example.com. Observed: LCP element img.hero loads 1.4 s after first paint. Do this: Preload the hero image with fetchpriority=\"high\". Then re-run the HubSEO audit and confirm \"lcp-image-preload\" no longer appears.",
      "evidence": {
        "affected_urls": ["https://example.com"],
        "observed": ["LCP element img.hero loads 1.4 s after first paint"],
        "payload": { "consolidatedFindingCount": 1 }
      }
    }
  ]
}

Fixes come from the report's evidence findings. A report with none falls back to its ranked Lighthouse/HTML fixes, whose why_it_matters is the recorded weighting reason. why_it_matters and evidence are null when the engine recorded nothing, never invented.