Skip to content

    Website visibility audit with the AEO API

    An audit returns findings for public pages you specify. Each finding has a severity, the page it applies to, the evidence, and a recommendation. Start the audit with POST /v2/runs, then poll and read the findings with GET /v2/runs/{run_id}.

    This guide covers how to start, poll and cancel an audit, and what to do with the findings. Field names and limits are in the v2 OpenAPI contract and the v2 API reference.

    Before you start

    • An API key sent as a Bearer token. Starting an audit requires audits:write and an editor, owner or service role. Reading an audit requires audits:read.
    • The Analyzer (starter) or Optimizer (growth) plan. The contract lists both plan ids for both audit operations.
    • A brand_id. Create a brand with POST /v2/brands if you do not have one.
    • Public URLs. The audit does not verify that you own the domain, and the contract states that competitor URLs are accepted.

    Set AEO_API_BASE_URL to your API origin without a version suffix, and send the key from your server.

    What the audit checks

    • You can audit public pages without installing anything on the site.
    • It is read-only. It gives you no ownership, private-data or CMS access.
    • The audit respects robots rules and other access restrictions. Read pages_skipped and skipped_reasons for the pages the audit could not check.

    Select readiness checks

    Set checks to the checks you need. crawler_access checks blocking by robots.txt or a firewall. schema_consistency compares structured data with visible page content and your business profile. business_facts checks the name, address, phone number, and opening hours on public listings.

    Use location_ids to select saved business locations. To include specific listing pages, pass their URLs in listing_urls and select business_facts. Read the selected checks under result.crawler_access, result.schema_consistency, and result.business_facts when present.

    Run the audit

    1. Choose a profile. `instant` checks up to 5 pages and has a 60-second work budget. `detailed` is the default. It requires an explicit `max_pages`, which can be up to 25 on Analyzer and up to 100 on Optimizer. 2. Set `max_units` to cap the cost in credits. 3. Start the audit with `POST /v2/runs` and `"workflow": "audit"`. 4. Poll the run with `GET /v2/runs/{run_id}`. 5. Read `result.findings`, page through them with `next_cursor`, and act on the recommendations. 6. Run the audit again to confirm the fix.

    Set a credit limit

    Send the audit request with estimate: true first. HTTP 200 returns the estimated cost without reserving credits. Read data.page_breakdown to see how many site and listing pages fit under the cap. Set estimate to false when you start the audit.

    Starting an audit is billable. The response to the start request reports estimated_units, reserved_units and billed_units. Set max_units to an integer that covers at least one page. If the cap covers fewer pages than requested, the API can lower the effective page limit. Check meta.warnings for limits applied to the request. If the balance cannot cover the request, the contract lists a 402 with code quota_exceeded. Reading a run with GET /v2/runs/{run_id} is not billable.

    Start an audit

    Send Idempotency-Key with every start request. It must be 8 to 128 characters. Sending the same body with the same key returns the original response. A different body with the same key returns 409. Keys are kept for 7 days.

    Before starting an audit, run AUDIT_KEY=$(uuidgen) once and save the key for this operation. Retry with the saved key and the same request body. Generate a new key for each new operation.

    curl --fail-with-body -X POST "$AEO_API_BASE_URL/v2/runs" \
      -H "Authorization: Bearer $AEO_API_KEY" \
      -H "Idempotency-Key: ${AUDIT_KEY:?Set AUDIT_KEY before sending}" \
      -H "Content-Type: application/json" \
      -d '{
        "workflow": "audit",
        "brand_id": "'"$BRAND_ID"'",
        "profile": "instant",
        "urls": ["https://example.com/"],
        "types": ["technical", "content"],
        "max_pages": 5,
        "max_units": 100
      }'

    The values come from the audit example in the contract. Replace them with your own.

    Field Required Notes
    workflow yes Must be audit.
    brand_id yes UUID of a brand in your account.
    urls yes 1 to 100 URLs. At most 5 when profile is instant.
    types yes One or more of technical, content, agent. No duplicates.
    max_pages yes Integer from 1 to 100. At most 5 when profile is instant.
    max_units yes Integer credit cap. It must cover at least one page.
    profile no instant or detailed. Default detailed.

    Finding codes start with the audit type that produced them, for example technical.title_long and agent.robots_absent.

    The 202 response

    Both profiles return 202 Accepted. The body has data and meta. These data fields describe the run:

    Field Meaning
    id, v2_run_id The same run ID in both fields, in the form audit:<uuid>.
    kind audit.
    state queued when accepted.
    progress Number from 0 to 1.
    poll_url Poll URL with the path /v2/runs/audit:<uuid>.
    estimated_units, reserved_units, billed_units Integers.
    result null until the audit has a result.
    error null, or an error object with code, message, request_id and retryable.
    revision, created_at, updated_at Present on every run.

    Check state before you use the result. Poll again after a delay while it is queued, running or in_progress. Read the final findings when it is completed or partial. Stop polling if it is cancelled.

    Poll the run

    Follow data.poll_url, or set RUN_ID to data.id and call GET /v2/runs/{run_id}. The poll response returns the same ID in data.id and data.v2_run_id. GET also accepts the UUID without the audit: prefix.

    curl --fail-with-body --get "$AEO_API_BASE_URL/v2/runs/$RUN_ID" \
      -H "Authorization: Bearer $AEO_API_KEY" \
      --data-urlencode "limit=50"

    limit is the number of findings per page. The default is 50 and the maximum is 100. cursor takes the next_cursor value from the previous page. While the audit runs, result.completeness can be preliminary and the API returns only the first page, without a cursor. Continue polling while the run is in progress.

    Cancel an audit

    To stop an audit that’s still running, send DELETE /v2/runs/{run_id} with the full audit:{id} value. Use a key with audits:write, send an Idempotency-Key, and optionally pass reason in the query. A successful cancellation returns HTTP 202 with data.state set to cancelled. The cancellation response has a bare UUID in data.id and the prefixed ID in data.v2_run_id. You can still read the run at data.poll_url. A completed run returns HTTP 409 if you try to cancel it.

    Read the findings

    result has kind: "audit" and these fields:

    Field Meaning
    profile instant or detailed.
    completeness preliminary, partial, complete or blocked.
    pages_discovered, pages_checked, pages_skipped Integers.
    skipped_reasons List of strings.
    budget_exhausted Boolean.
    content_coverage_note A string describing what content was covered.
    first_result_at Timestamp, or null.
    next_cursor Cursor for the next page of findings, or null.
    findings List of findings.

    When result.crawler_access is present, each crawler can report robots_access as allowed or blocked according to the site’s robots.txt rules. The value is null when those rules could not be read. Older reports can omit the field. If a live check could not run, the crawler access score can be null and note explains why.

    Each finding has:

    Field Meaning
    id UUID of the finding.
    code Check identifier, for example technical.title_long.
    severity critical, high, medium, low or info.
    url The page the finding applies to.
    evidence A string. In the test fixtures it is JSON text, for example {"characters": <integer>, "excerpt": "<string>", ...}. Parse it before use.
    confidence Number from 0 to 1.
    recommendation What to change.
    verification How to confirm the change.

    Example response, not live data. The site, run ID and technical.title_long finding come from test fixtures and the audit check. Placeholders are in angle brackets.

    {
      "data": {
        "id": "audit:00000000-0000-4000-8000-00000000a0d1",
        "v2_run_id": "audit:00000000-0000-4000-8000-00000000a0d1",
        "kind": "audit",
        "state": "completed",
        "progress": 1,
        "result": {
          "kind": "audit",
          "profile": "detailed",
          "completeness": "complete",
          "pages_discovered": "<integer>",
          "pages_checked": "<integer>",
          "pages_skipped": "<integer>",
          "skipped_reasons": [],
          "budget_exhausted": false,
          "next_cursor": null,
          "findings": [
            {
              "id": "<uuid>",
              "code": "technical.title_long",
              "severity": "low",
              "url": "https://dental.example/",
              "evidence": "<JSON string with characters and excerpt>",
              "confidence": 0.6,
              "recommendation": "Consider a shorter title that states the page topic first; long titles are often shortened when displayed.",
              "verification": "Re-run the audit: the title is at most 65 characters."
            }
          ]
        },
        "error": null
      }
    }

    What to do with the findings

    1. Group findings by code, then by url. One code on many pages usually points to a template.
    2. Fix critical and high findings first. Use confidence to decide which low-confidence findings to check by hand before you change a page.
    3. Make the change the recommendation describes.
    4. Read verification for each finding. It states how to confirm the fix, and for the example above it says to re-run the audit.
    5. Check pages_skipped, skipped_reasons and budget_exhausted. If pages were skipped or the budget ran out, the findings do not cover the whole site. Raise max_pages within your plan limit, or list the missing URLs in urls, and run again.

    Errors

    Error bodies have code, message, request_id and retryable. A validation error can also include field_errors, each with field and message.

    Status code What it means What to do
    401 unauthenticated The request has no valid credentials. Check the Authorization header and the key.
    403 forbidden The credentials do not allow this operation. Check your plan, the key’s scope and, for a start request, the editor, owner or service role.
    422 validation_error The body failed validation. Read field_errors.
    429 rate_limited Too many requests. retryable is true. Wait the number of seconds in the Retry-After header.

    The contract also lists 400, 402 (quota_exceeded), 404, 409, 412, 500 and 503 for these operations. Read message for details about an error.

    Next step

    Request API access