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

# Get the competitor analysis

> Returns the share of voice of the brand and its competitors, the trends, and the prompts where a competitor is ahead. Use `date_range` to select the period (`7g`, `1a`, `3a`, `6a`, `1y` or `custom` with `since` and `until`). Use `compare` to select the comparison period (`previous`, `previous_year` or `custom` with `compare_since` and `compare_until`). Use `persona` and `llm` to limit the data to one persona and to some AI assistants.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/sites/{site_uuid}/competitors/analysis
openapi: 3.0.3
info:
  title: Perquery API
  version: 1.0.0
  description: Read-only access to the data of your Perquery organization.
servers:
  - url: https://perquery.ai/api
security:
  - apiKey: []
paths:
  /v1/sites/{site_uuid}/competitors/analysis:
    get:
      tags:
        - Competitors
      summary: Get the competitor analysis
      description: >-
        Returns the share of voice of the brand and its competitors, the trends,
        and the prompts where a competitor is ahead. Use `date_range` to select
        the period (`7g`, `1a`, `3a`, `6a`, `1y` or `custom` with `since` and
        `until`). Use `compare` to select the comparison period (`previous`,
        `previous_year` or `custom` with `compare_since` and `compare_until`).
        Use `persona` and `llm` to limit the data to one persona and to some AI
        assistants.
      operationId: competitor_analysis
      parameters:
        - in: query
          name: compare
          schema:
            enum:
              - previous
              - previous_year
              - custom
            type: string
            default: previous
            minLength: 1
          description: |-
            * `previous` - previous
            * `previous_year` - previous_year
            * `custom` - custom
        - in: query
          name: compare_since
          schema:
            type: string
            format: date
          description: The first day of a `custom` comparison.
        - in: query
          name: compare_until
          schema:
            type: string
            format: date
          description: The last day of a `custom` comparison.
        - in: query
          name: date_range
          schema:
            enum:
              - 7g
              - 1a
              - 3a
              - 6a
              - 1y
              - custom
            type: string
            default: 1a
            minLength: 1
          description: |-
            * `7g` - 7g
            * `1a` - 1a
            * `3a` - 3a
            * `6a` - 6a
            * `1y` - 1y
            * `custom` - custom
        - in: query
          name: llm
          schema:
            type: array
            items:
              enum:
                - chatgpt
                - gemini
                - claude
                - perplexity
                - googleai
                - grok
                - deepseek
              type: string
              description: |-
                * `chatgpt` - chatgpt
                * `gemini` - gemini
                * `claude` - claude
                * `perplexity` - perplexity
                * `googleai` - googleai
                * `grok` - grok
                * `deepseek` - deepseek
        - in: query
          name: persona
          schema:
            type: string
            format: uuid
            nullable: true
        - in: query
          name: since
          schema:
            type: string
            format: date
          description: The first day of a `custom` range.
        - in: path
          name: site_uuid
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: until
          schema:
            type: string
            format: date
          description: The last day of a `custom` range.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompetitorAnalysisResponse'
          description: ''
      security:
        - apiKey: []
components:
  schemas:
    CompetitorAnalysisResponse:
      type: object
      properties:
        share_of_voice:
          $ref: '#/components/schemas/ShareOfVoiceDTO'
        trends:
          type: array
          items:
            $ref: '#/components/schemas/CompetitorTrendDTO'
        trend_axis:
          type: array
          items:
            type: string
            format: date-time
            nullable: true
        beats:
          type: array
          items:
            $ref: '#/components/schemas/CompetitorBeatDTO'
        tracked_count:
          type: integer
      required:
        - beats
        - share_of_voice
        - tracked_count
        - trend_axis
        - trends
    ShareOfVoiceDTO:
      type: object
      properties:
        brand:
          allOf:
            - $ref: '#/components/schemas/CompetitorShareDTO'
          nullable: true
        rivals:
          type: array
          items:
            $ref: '#/components/schemas/CompetitorShareDTO'
        other:
          type: array
          items:
            $ref: '#/components/schemas/CompetitorShareDTO'
        other_share:
          type: number
          format: double
        leader:
          allOf:
            - $ref: '#/components/schemas/CompetitorShareDTO'
          nullable: true
        gap:
          type: number
          format: double
          nullable: true
      required:
        - brand
        - gap
        - leader
        - other
        - other_share
        - rivals
    CompetitorTrendDTO:
      type: object
      properties:
        name:
          type: string
        tracked:
          type: boolean
        points:
          type: array
          items:
            type: number
            format: double
            nullable: true
      required:
        - name
        - points
        - tracked
    CompetitorBeatDTO:
      type: object
      properties:
        competitor:
          type: string
        prompt_uuid:
          type: string
          format: uuid
          nullable: true
        prompt_text:
          type: string
        persona_name:
          type: string
        our_visibility:
          type: number
          format: double
        their_visibility:
          type: number
          format: double
        gap:
          type: number
          format: double
        reason_code:
          type: string
        suggested_tool:
          type: string
        score:
          type: integer
      required:
        - competitor
        - gap
        - our_visibility
        - persona_name
        - prompt_text
        - prompt_uuid
        - reason_code
        - score
        - suggested_tool
        - their_visibility
    CompetitorShareDTO:
      type: object
      properties:
        name:
          type: string
        domain:
          type: string
        share:
          type: number
          format: double
        visibility:
          type: number
          format: double
        mentions:
          type: integer
        avg_rank:
          type: number
          format: double
          nullable: true
        tracked:
          type: boolean
        is_brand:
          type: boolean
        delta:
          type: number
          format: double
          nullable: true
      required:
        - avg_rank
        - delta
        - domain
        - is_brand
        - mentions
        - name
        - share
        - tracked
        - visibility
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: '`ApiKey pq_<prefix>_<secret>`. An API key gives read-only access.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.