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

# Competitor Attribute Metrics

> Returns attribute metrics per tracked competitor: for each competitor and each attribute, how many AI responses mentioned that keyword for that competitor. Pair with POST /api/v1/attributes/cumulative to compare the brand against competitors. `total_responses` is per-competitor: responses in the date range that mention THAT competitor and had attribute extraction run on them. Each competitor therefore has its own denominator, and none of them is the website's total response count. `positive` describes the keyword itself, not the individual mention. Returns one row per competitor per attribute, so responses can be large — narrow with filters.competitor_ids. Competitors with no responses in the date range are omitted entirely rather than returned with zeros.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/attributes/competitors
openapi: 3.1.0
info:
  title: AthenaHQ API
  description: >-
    AthenaHQ API provides programmatic access to manage your websites and
    prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
  - url: https://api.athenahq.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Basics
    description: Core API operations for managing websites and prompts
  - name: Metrics
    description: Metrics and analytics endpoints for tracking AI visibility
  - name: Billing
    description: Billing and credits endpoints for managing usage
  - name: Team Management
    description: Endpoints for managing team members and invitations
  - name: Groups
    description: Endpoints for managing groups of websites
  - name: Content
    description: >-
      Endpoints for accessing Content Hub data — tabs, tracked URLs, and per-URL
      prompt breakdowns.
  - name: Pitch Workspace
    description: >-
      Endpoints for accessing pitch workspace reports — org-scoped pitch runs
      with competitors, prompts, attributes, and aggregate metrics.
  - name: Knowledge Base
    description: >-
      Endpoints for reading the brand Knowledge Base — approved brand facts and
      the pillars that organize them.
paths:
  /api/v1/attributes/competitors:
    post:
      tags:
        - Attributes
      summary: Competitor Attribute Metrics
      description: >-
        Returns attribute metrics per tracked competitor: for each competitor
        and each attribute, how many AI responses mentioned that keyword for
        that competitor. Pair with POST /api/v1/attributes/cumulative to compare
        the brand against competitors. `total_responses` is per-competitor:
        responses in the date range that mention THAT competitor and had
        attribute extraction run on them. Each competitor therefore has its own
        denominator, and none of them is the website's total response count.
        `positive` describes the keyword itself, not the individual mention.
        Returns one row per competitor per attribute, so responses can be large
        — narrow with filters.competitor_ids. Competitors with no responses in
        the date range are omitted entirely rather than returned with zeros.
      operationId: getCompetitorAttributeMetrics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttributeMetricsRequest'
      responses:
        '200':
          description: Successful response with per-competitor attribute metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CompetitorAttributeMetric'
                required:
                  - data
              example:
                data:
                  - competitor_id: 1f2e3d4c-5b6a-4798-8a9b-0c1d2e3f4a5b
                    competitor_name: Globex
                    attribute_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    attribute_name: Affordable
                    positive: true
                    response_count: 5
                    total_responses: 20
                    percentage: 25
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - API key cannot access this website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found - Website or attribute does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    AttributeMetricsRequest:
      type: object
      properties:
        website_id:
          type: string
          format: uuid
        filters:
          $ref: '#/components/schemas/ApiFilters'
      required:
        - website_id
        - filters
    CompetitorAttributeMetric:
      type: object
      properties:
        competitor_id:
          type: string
          format: uuid
        competitor_name:
          type: string
          example: Globex
        attribute_id:
          type: string
          format: uuid
        attribute_name:
          type: string
          example: Affordable
        positive:
          type: boolean
        response_count:
          type: integer
        total_responses:
          type: integer
          description: >-
            Analyzed responses for THIS competitor — each competitor has its own
            denominator.
        percentage:
          type: number
      required:
        - competitor_id
        - competitor_name
        - attribute_id
        - attribute_name
        - positive
        - response_count
        - total_responses
        - percentage
    Error:
      type: object
      description: Error response object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
    ApiFilters:
      type: object
      description: >-
        Filters for querying responses and metrics. Pass location filters in the
        JSON body as `filters.location_ids`.
      required:
        - start_date
      properties:
        start_date:
          type: string
          format: date-time
          description: Filter start date (UTC)
          example: '2024-01-01T00:00:00.000Z'
        end_date:
          type: string
          format: date-time
          description: Filter end date (UTC)
          example: '2024-12-31T23:59:59.999Z'
        models:
          type: array
          description: Filter by AI models
          items:
            type: string
            enum:
              - chatgpt
              - perplexity
              - gemini
              - google_ai_overview
              - copilot
              - claude
              - ai_mode
              - grok
              - deepseek
          example:
            - chatgpt
            - perplexity
        prompt_ids:
          type: array
          description: Filter by specific prompt IDs
          items:
            type: string
            format: uuid
        competitor_ids:
          type: array
          description: Filter by specific competitor IDs
          items:
            type: string
            format: uuid
        location_ids:
          type: array
          description: >-
            Filter by location IDs. Pass this in the JSON body as
            `filters.location_ids`, even when filtering by a single location.
            Use IDs returned by `GET /api/v1/locations`.
          items:
            type: string
            format: uuid
          example:
            - 123e4567-e89b-12d3-a456-426614174111
        prompt_status:
          type: string
          enum:
            - active
            - paused
          description: Filter by prompt status
        prompt_type:
          type: string
          enum:
            - branded
            - non_branded
          description: Filter by prompt type
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can create one
        [here](https://app.athenahq.ai/organization?tab=api).

````