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

# Get a brand's metrics

> AI-visibility metrics for the brand over a trailing window: how often it is named, the leaderboard against competitors, citation share, per-prompt detail and a trend series.



## OpenAPI

````yaml https://agentled.co/api/v1/openapi.json get /brands/{id}/metrics
openapi: 3.1.0
info:
  title: agentled API
  version: 1.0.0
  description: >-
    Programmatic access to the agentled AI Search monitor: manage brands and
    prompts, set a brand's measurement location, and read scan results — the
    same data behind the dashboard.


    All requests are authenticated with an API key you mint in the Account tab,
    sent as `Authorization: Bearer agl_live_...`. Every key is scoped to your
    account: you only ever see brands your account belongs to.


    **Base URL:** `https://agentled.co/api/v1`
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    name: agentled
    url: https://agentled.co
servers:
  - url: https://agentled.co/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Plan
    description: The account's plan and its limits.
  - name: Brands
    description: Brands the account monitors.
  - name: Prompts
    description: The questions asked about a brand each scan.
  - name: Answers
    description: Per-scan answer history for a prompt.
  - name: Metrics
    description: A brand's AI-visibility metrics.
  - name: Scans
    description: Scan runs.
  - name: Geo
    description: Valid country/city values for a brand's location.
paths:
  /brands/{id}/metrics:
    get:
      tags:
        - Metrics
      summary: Get a brand's metrics
      description: >-
        AI-visibility metrics for the brand over a trailing window: how often it
        is named, the leaderboard against competitors, citation share,
        per-prompt detail and a trend series.
      operationId: getBrandMetrics
      parameters:
        - name: id
          in: path
          required: true
          description: Brand id (UUID). A value that is not a UUID returns 404.
          schema:
            type: string
            format: uuid
        - name: days
          in: query
          required: false
          description: >-
            Trailing window in days, 1–365. Defaults to 30. Invalid values fall
            back to 30.
          schema:
            type: integer
            minimum: 1
            maximum: 365
            default: 30
      responses:
        '200':
          description: The metrics and the window they cover.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    MetricsEnvelope:
      type: object
      required:
        - days
        - metrics
      properties:
        days:
          type: integer
          description: The effective window used.
        metrics:
          $ref: '#/components/schemas/BrandMetrics'
    BrandMetrics:
      type: object
      description: >-
        A brand's AI-visibility metrics. Zero state (no completed scans) has
        `scanned:false`, numeric fields 0, arrays empty and deltas null.
      properties:
        platform:
          type: string
          enum:
            - chatgpt
        scanned:
          type: boolean
          description: True once at least one scan has completed.
        answers:
          type: integer
          description: Count of usable answers in the window.
        visibility:
          type: number
          description: Share of answers naming the brand, 0–1.
        visibilityNamed:
          type: integer
          description: Count of answers naming the brand.
        rankValue:
          type: integer
          description: 1-based standing on the leaderboard (0 if absent).
        leaderboard:
          type: array
          items:
            $ref: '#/components/schemas/LeaderRow'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupMetric'
        citationShare:
          type: number
          description: Own citations / all citations, 0–1.
        citationOwn:
          type: number
        citationTotal:
          type: number
        citationRankValue:
          type: integer
          description: >-
            1-based rank of the brand's own domain among cited domains (0 if
            absent).
        citationDomains:
          type: array
          items:
            $ref: '#/components/schemas/DomainMetric'
        trend:
          type: array
          items:
            $ref: '#/components/schemas/TrendPoint'
        visibilityDelta:
          type:
            - number
            - 'null'
          description: Latest vs previous run.
        citationDelta:
          type:
            - number
            - 'null'
        rankDelta:
          type:
            - number
            - 'null'
          description: Positive = moved up (rank got smaller).
    Error:
      type: object
      description: Every error has this shape. Branch on the stable `error.code`.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code.
              enum:
                - unauthorized
                - not_found
                - bad_request
                - limit_reached
                - server_error
            message:
              type: string
              description: Human-readable explanation.
            upgradeUrl:
              type: string
              description: >-
                Present only when `code` is `limit_reached`: where to upgrade
                the plan.
    LeaderRow:
      type: object
      properties:
        name:
          type: string
        visibility:
          type: number
          description: 0–1.
        isSelf:
          type: boolean
    GroupMetric:
      type: object
      properties:
        topicId:
          type:
            - string
            - 'null'
        name:
          type: string
        promptCount:
          type: integer
        score:
          type: number
        rank:
          type: integer
        pos:
          type:
            - number
            - 'null'
        cite:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/PromptMetric'
    DomainMetric:
      type: object
      properties:
        domain:
          type: string
        share:
          type: number
          description: 0–1.
        owned:
          type: boolean
          description: True if this is the brand's own domain.
        pages:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              share:
                type: number
              title:
                type:
                  - string
                  - 'null'
    TrendPoint:
      type: object
      properties:
        at:
          type: string
          format: date-time
        visibility:
          type: number
          description: 0–1.
        citationShare:
          type: number
          description: 0–1.
    PromptMetric:
      type: object
      properties:
        promptId:
          type: string
          format: uuid
        q:
          type: string
          description: The prompt text.
        score:
          type: number
          description: 1 if named in the latest answer, else 0.
        pos:
          type:
            - number
            - 'null'
        cite:
          type: number
        answer:
          type:
            - string
            - 'null'
        brands:
          type: array
          items:
            type: string
        cites:
          type: array
          items:
            type: string
        highlight:
          type:
            - string
            - 'null'
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist, or your account cannot see it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Something went wrong. Retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from the Account tab, sent as `Authorization: Bearer
        agl_live_...`. Keys are secret; store them server-side.

````