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

# Get Companies Stats

> This endpoint returns aggregated data showing which companies appear in query results. For each company, you'll receive:

Count: How many queries this company was mentioned in
Percentage: What percent of total queries this company was mentioned in

Use either queryGroupID with a date range for historical analysis, or executionID to get statistics from a specific scan.

Results include executions from all supported AI platforms (e.g. ChatGPT, Google AI Overview) by default.

<Accordion title="AI Platforms (`aiPlatform`)">
  Stats are aggregated across all supported AI platforms by default — each company appears once with combined `count` and `percentage` across platforms. Response rows do not include an `ai_platform` field.

  Use the optional `aiPlatform` request parameter to scope stats to a single platform. Current values:

  * `chatgpt` — ChatGPT
  * `aioverview` — Google AI Overview

  Additional platforms may be added in the future.

  When `aiPlatform` is set, `count` and `percentage` are recomputed relative to that platform only (i.e. `percentage` is over the filtered platform's queries, not the total across all platforms).

  When `executionID` is provided, `aiPlatform` is not needed because an execution already belongs to a single platform.
</Accordion>


## OpenAPI

````yaml POST /get-companies-stats
openapi: 3.1.0
info:
  title: Mindshare API
  description: >-
    The Mindshare API provides comprehensive access to brand visibility
    analytics, customer intelligence, and growth tracking. Use this API to
    retrieve customer data, query groups, execution results, domain insights,
    and actionable recommendations for improving your brand's AI visibility.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.mindshare.so/customer/v1
security:
  - apiKeyHeader: []
paths:
  /get-companies-stats:
    post:
      description: >-
        This endpoint returns aggregated data showing which companies appear in
        query results. For each company, you'll receive:


        Count: How many queries this company was mentioned in

        Percentage: What percent of total queries this company was mentioned in


        Use either queryGroupID with a date range for historical analysis, or
        executionID to get statistics from a specific scan.


        Results include executions from all supported AI platforms (e.g.
        ChatGPT, Google AI Overview) by default.
      requestBody:
        description: Get companies stats parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                customerID:
                  type: number
                  description: The ID of the customer
                queryGroupID:
                  type: number
                  description: The ID of the query group
                startDate:
                  type: string
                  format: date
                  description: Start date in yyyy-mm-dd format
                endDate:
                  type: string
                  format: date
                  description: End date in yyyy-mm-dd format
                executionID:
                  type: number
                  description: The ID of the execution
                aiPlatform:
                  type: string
                  description: >-
                    Optional. Filter stats to a single AI platform. Current
                    values: 'chatgpt' (ChatGPT), 'aioverview' (Google AI
                    Overview). Additional platforms may be added in the future.
                    If omitted, stats are aggregated across all platforms. Not
                    needed when 'executionID' is provided, since an execution
                    already belongs to a single platform.
              required:
                - customerID
        required: true
      responses:
        '200':
          description: List of company statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompaniesStatsResponse'
components:
  schemas:
    CompaniesStatsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CompanyStat'
          description: List of company statistics
        version:
          type: string
          description: API version
        env:
          type: string
          description: Environment name
      required:
        - data
        - version
        - env
    CompanyStat:
      type: object
      properties:
        company:
          type: string
          description: Company name
        count:
          type: number
          description: Number of occurrences
        percentage:
          type: number
          description: Percentage of occurrences
      required:
        - company
        - count
        - percentage
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````