> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surnex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare two site audits

> Compare two site audit runs to identify resolved issues, new regressions, score change, and per-category breakdowns. Pass audit_id_1 (older) and audit_id_2 (newer) as query parameters.



## OpenAPI

````yaml https://api.surnex.io/openapi.json get /v1/projects/{project_id}/audits/compare
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/audits/compare:
    get:
      tags:
        - Site Audit
      summary: Compare two site audits
      description: >-
        Compare two site audit runs to identify resolved issues, new
        regressions, score change, and per-category breakdowns. Pass audit_id_1
        (older) and audit_id_2 (newer) as query parameters.
      operationId: compare_audits_v1_projects__project_id__audits_compare_get
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: audit_id_1
          in: query
          required: true
          schema:
            type: string
            format: uuid
            description: UUID of the first (older) audit
            title: Audit Id 1
          description: UUID of the first (older) audit
        - name: audit_id_2
          in: query
          required: true
          schema:
            type: string
            format: uuid
            description: UUID of the second (newer) audit
            title: Audit Id 2
          description: UUID of the second (newer) audit
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_AuditComparisonResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    APIResponse_AuditComparisonResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/AuditComparisonResponse'
            - type: 'null'
      type: object
      title: APIResponse[AuditComparisonResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AuditComparisonResponse:
      properties:
        audit_id_1:
          type: string
          format: uuid
          title: Audit Id 1
        audit_id_2:
          type: string
          format: uuid
          title: Audit Id 2
        score_old:
          anyOf:
            - type: number
            - type: 'null'
          title: Score Old
        score_new:
          anyOf:
            - type: number
            - type: 'null'
          title: Score New
        score_change:
          anyOf:
            - type: number
            - type: 'null'
          title: Score Change
        pages_crawled_old:
          type: integer
          title: Pages Crawled Old
        pages_crawled_new:
          type: integer
          title: Pages Crawled New
        pages_crawled_change:
          type: integer
          title: Pages Crawled Change
        issues_resolved:
          type: integer
          title: Issues Resolved
          description: Issues present in audit_1 but absent in audit_2 (fixed).
        new_issues:
          type: integer
          title: New Issues
          description: Issues present in audit_2 but absent in audit_1 (regressions).
        category_breakdown:
          items:
            $ref: '#/components/schemas/IssueCategorySummary'
          type: array
          title: Category Breakdown
      type: object
      required:
        - audit_id_1
        - audit_id_2
        - pages_crawled_old
        - pages_crawled_new
        - pages_crawled_change
        - issues_resolved
        - new_issues
      title: AuditComparisonResponse
      description: Comparison between two audit runs for the same project.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    IssueCategorySummary:
      properties:
        category:
          type: string
          title: Category
        old_count:
          type: integer
          title: Old Count
          default: 0
        new_count:
          type: integer
          title: New Count
          default: 0
        delta:
          type: integer
          title: Delta
          default: 0
      type: object
      required:
        - category
      title: IssueCategorySummary
      description: Count of issues in a single category for comparison view.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````