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

# Visibility scores for the latest usable run

> Default returns an array of `VisibilityScore` (one per brand). Use `type=topics` for a per-topic summary, `type=attributes&topicId=…` for a per-attribute breakdown, or `topicId=…` alone for a single topic's scores.



## OpenAPI

````yaml /api-reference/openapi.json get /visibility
openapi: 3.1.0
info:
  title: OpenLens API
  version: 1.4.0
  description: >-
    Public REST API for OpenLens. Onboard clients, run scans across the major AI
    platforms, read visibility metrics, and download client-ready reports. Beta
    — endpoints may evolve before GA.
  contact:
    name: OpenLens support
    email: contact@aibread.com
servers:
  - url: https://openlens.com/api
security:
  - bearerAuth: []
tags:
  - name: Onboarding
  - name: Runs
  - name: Metrics
  - name: Citations
  - name: Deliverables
  - name: Resources
  - name: Account
  - name: Workstreams
paths:
  /visibility:
    get:
      tags:
        - Metrics
      summary: Visibility scores for the latest usable run
      description: >-
        Default returns an array of `VisibilityScore` (one per brand). Use
        `type=topics` for a per-topic summary, `type=attributes&topicId=…` for a
        per-attribute breakdown, or `topicId=…` alone for a single topic's
        scores.
      parameters:
        - name: projectId
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: Project id. Required on all data endpoints.
        - name: topicId
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - overview
              - topics
              - attributes
            default: overview
        - name: promptAttributes
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated list of attribute filters. Accepts both built-in
            attributes (e.g. `pricing`, `comparisons`) and project-specific
            custom attributes.
      responses:
        '200':
          description: >-
            One of: array of VisibilityScore, array of TopicVisibilitySummary,
            TopicVisibility, or array of AttributeBreakdown depending on `type`.
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/VisibilityScore'
                  - type: array
                    items:
                      $ref: '#/components/schemas/TopicVisibilitySummary'
                  - $ref: '#/components/schemas/TopicVisibility'
                  - type: array
                    items:
                      $ref: '#/components/schemas/AttributeBreakdown'
        '400':
          description: Missing or invalid request parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Monthly included API calls for your tier are used up (code
            `USAGE_LIMIT`). Body includes a `limit` object — `{ limitHit,
            currentTier, targetTier, feature, cap, used, resetAt }` — describing
            the cap and the upgrade that lifts it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found or not owned by your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit, project cap, or daily quota hit. Body includes a `code`
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error. Retry; if persistent, contact support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VisibilityScore:
      type: object
      properties:
        brandId:
          type: string
          format: uuid
        brandName:
          type: string
        isOwn:
          type: boolean
        overall:
          type: number
          description: Mention rate as a percentage (0–100).
        byPlatform:
          type: object
          additionalProperties:
            type: number
          description: Per-platform mention rate, keyed by platform id.
        avgPosition:
          type: number
        mentionCount:
          type: integer
        totalPlatformResponses:
          type: integer
        dominantSentiment:
          type: string
          enum:
            - positive
            - neutral
            - negative
        sentimentBreakdown:
          type: object
          properties:
            positive:
              type: integer
            neutral:
              type: integer
            negative:
              type: integer
          required:
            - positive
            - neutral
            - negative
      required:
        - brandId
        - brandName
        - isOwn
        - overall
        - byPlatform
        - avgPosition
        - mentionCount
        - totalPlatformResponses
        - dominantSentiment
        - sentimentBreakdown
    TopicVisibilitySummary:
      type: object
      properties:
        topicId:
          type: string
          format: uuid
        topicName:
          type: string
        ownVisibility:
          type: number
        topCompetitor:
          type: string
        topCompetitorVisibility:
          type: number
      required:
        - topicId
        - topicName
        - ownVisibility
        - topCompetitor
        - topCompetitorVisibility
    TopicVisibility:
      type: object
      properties:
        topicId:
          type: string
          format: uuid
        topicName:
          type: string
        scores:
          type: array
          items:
            $ref: '#/components/schemas/VisibilityScore'
      required:
        - topicId
        - topicName
        - scores
    AttributeBreakdown:
      type: object
      properties:
        attributeName:
          type: string
        scores:
          type: array
          items:
            type: object
            properties:
              brandId:
                type: string
                format: uuid
              brandName:
                type: string
              isOwn:
                type: boolean
              avgSentiment:
                type: number
              byPlatform:
                type: object
                additionalProperties:
                  type: number
              count:
                type: integer
              contexts:
                type: array
                items:
                  type: object
                  properties:
                    platform:
                      type: string
                    context:
                      type: string
                  required:
                    - platform
                    - context
            required:
              - brandId
              - brandName
              - isOwn
              - avgSentiment
              - byPlatform
              - count
              - contexts
      required:
        - attributeName
        - scores
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code for programmatic handling, when applicable.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk API key. Create one from your account settings under API Keys.

````