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

# Get share of voice accumulated over a date range



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/analytics/sov
openapi: 3.1.0
info:
  title: The Prompting Company API
  version: 0.1.0
  description: >-
    Machine-readable contract for The Prompting Company organization-scoped API
    routes.
  contact:
    name: The Prompting Company
    url: https://promptingcompany.com/support
    email: support@promptingcompany.com
  license:
    name: Proprietary
    url: https://promptingcompany.com/terms
  termsOfService: https://promptingcompany.com/terms
servers:
  - url: https://app.promptingco.com
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Visibility & Mentions
  - name: Knowledge
  - name: Content
  - name: Simulations
  - name: Apps & Publishing
  - name: Products
  - name: Service Status
paths:
  /api/v1/analytics/sov:
    get:
      tags:
        - Visibility & Mentions
      summary: Get share of voice accumulated over a date range
      operationId: getAnalyticsSov
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Product ID to use as the share of voice scope.
          required: true
          description: Product ID to use as the share of voice scope.
          name: productId
          in: query
        - schema:
            type: string
            minLength: 1
            description: View ID to restrict the calculation to the view's prompts.
          required: false
          description: View ID to restrict the calculation to the view's prompts.
          name: viewId
          in: query
        - schema:
            type: string
            minLength: 1
            description: Answer engine to include in the calculation.
          required: false
          description: Answer engine to include in the calculation.
          name: engine
          in: query
        - schema:
            type: string
            minLength: 1
            description: Region to include in the calculation.
          required: false
          description: Region to include in the calculation.
          name: regionId
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              First UTC day included in the calculation, formatted as
              YYYY-MM-DD. Must be supplied with end. Defaults to 29 days before
              today.
          required: false
          description: >-
            First UTC day included in the calculation, formatted as YYYY-MM-DD.
            Must be supplied with end. Defaults to 29 days before today.
          name: start
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              Last UTC day included in the calculation, formatted as YYYY-MM-DD.
              Must be supplied with start. Defaults to today.
          required: false
          description: >-
            Last UTC day included in the calculation, formatted as YYYY-MM-DD.
            Must be supplied with start. Defaults to today.
          name: end
          in: query
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      scope:
                        type: object
                        properties:
                          product:
                            type: object
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              slug:
                                type: string
                            required:
                              - id
                              - name
                              - slug
                        required:
                          - product
                      period:
                        type: object
                        properties:
                          start:
                            type: string
                            description: >-
                              First included UTC calendar day, formatted as
                              YYYY-MM-DD.
                          end:
                            type: string
                            description: >-
                              Last included UTC calendar day, formatted as
                              YYYY-MM-DD.
                          days:
                            type: integer
                            minimum: 1
                            description: Number of included calendar days.
                        required:
                          - start
                          - end
                          - days
                      calculation:
                        type: string
                        enum:
                          - date_range
                        description: >-
                          Confirms that counts were accumulated over the period
                          before the ratio was calculated.
                      sov:
                        type: number
                        description: >-
                          Share of voice percentage for the whole period. This
                          is mentions divided by runs, multiplied by 100.
                      mentions:
                        type: integer
                        description: >-
                          Completed runs in the period that mentioned the
                          product.
                      runs:
                        type: integer
                        description: Completed runs in the period.
                    required:
                      - scope
                      - period
                      - calculation
                      - sov
                      - mentions
                      - runs
                required:
                  - ok
                  - data
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
      security:
        - apiKeyAuth: []
        - bearerAuth: []
        - cookieAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Organization-scoped API key. Available scopes:

        - content:read: Read site pages, markdown content, and llms.txt files

        - content:write: Create, update, and delete site pages and content

        - prompts:read: Read prompts, topics, prompt suggestions, and prompt
        analysis results

        - prompts:write: Create, update, archive prompts and generate, edit, or
        review prompt suggestions

        - simulations:read: Read agent-simulation tasks, runs, environments, and
        analytics

        - simulations:write: Create and trigger simulation runs

        - logs:read: Read AI-traffic logs and request-level audit events

        - analytics:read: Read analytics aggregates (rankings, mentions,
        sources, SOV)

        - analytics:write: Write events to analytics

        - products:read: Read product metadata and competitor data

        - products:write: Update product settings and competitor lists
      x-scopes:
        content:read: Read site pages, markdown content, and llms.txt files
        content:write: Create, update, and delete site pages and content
        prompts:read: Read prompts, topics, prompt suggestions, and prompt analysis results
        prompts:write: >-
          Create, update, archive prompts and generate, edit, or review prompt
          suggestions
        simulations:read: Read agent-simulation tasks, runs, environments, and analytics
        simulations:write: Create and trigger simulation runs
        logs:read: Read AI-traffic logs and request-level audit events
        analytics:read: Read analytics aggregates (rankings, mentions, sources, SOV)
        analytics:write: Write events to analytics
        products:read: Read product metadata and competitor data
        products:write: Update product settings and competitor lists
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer session or OAuth access token. Available OAuth scopes:

        - content:read: Read site pages, markdown content, and llms.txt files

        - content:write: Create, update, and delete site pages and content

        - prompts:read: Read prompts, topics, prompt suggestions, and prompt
        analysis results

        - prompts:write: Create, update, archive prompts and generate, edit, or
        review prompt suggestions

        - simulations:read: Read agent-simulation tasks, runs, environments, and
        analytics

        - simulations:write: Create and trigger simulation runs

        - logs:read: Read AI-traffic logs and request-level audit events

        - analytics:read: Read analytics aggregates (rankings, mentions,
        sources, SOV)

        - analytics:write: Write events to analytics

        - products:read: Read product metadata and competitor data

        - products:write: Update product settings and competitor lists
      x-scopes:
        content:read: Read site pages, markdown content, and llms.txt files
        content:write: Create, update, and delete site pages and content
        prompts:read: Read prompts, topics, prompt suggestions, and prompt analysis results
        prompts:write: >-
          Create, update, archive prompts and generate, edit, or review prompt
          suggestions
        simulations:read: Read agent-simulation tasks, runs, environments, and analytics
        simulations:write: Create and trigger simulation runs
        logs:read: Read AI-traffic logs and request-level audit events
        analytics:read: Read analytics aggregates (rankings, mentions, sources, SOV)
        analytics:write: Write events to analytics
        products:read: Read product metadata and competitor data
        products:write: Update product settings and competitor lists
    cookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: First-party browser session cookie.

````