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

# Get brand rankings

> Returns how your brands rank over a recent window of days, including mentions, sentiment, visibility, and growth.



## OpenAPI

````yaml /api/openapi.json get /rankings
openapi: 3.1.0
info:
  title: ZeroRank REST API
  version: 1.0.0
  description: >-
    The public ZeroRank REST API. Every request uses a workspace API key (Bearer
    `zr_live_…`) and only ever sees that one workspace. Use it to read your
    results and manage your prompts, brands, tags, and topics from your own
    scripts and tools.
servers:
  - url: https://api.zerorank.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspace
    description: The workspace, plan, and key behind your request.
  - name: Prompts
    description: The questions ZeroRank asks AI engines for you.
  - name: Brands
    description: The brands you track, including competitors.
  - name: Tags
    description: Labels you put on prompts.
  - name: Topics
    description: Groups you sort prompts into.
  - name: Analytics
    description: 'Read-only results: sources, chats, and rankings.'
paths:
  /rankings:
    get:
      tags:
        - Analytics
      summary: Get brand rankings
      description: >-
        Returns how your brands rank over a recent window of days, including
        mentions, sentiment, visibility, and growth.
      operationId: getRankings
      parameters:
        - name: days
          in: query
          description: >-
            How many days back to look (1–90). Defaults to 7 when left out or
            invalid.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 90
            default: 7
      responses:
        '200':
          description: Brand rankings.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BrandRanking'
                  message:
                    type: string
                    example: Rankings retrieved successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    BrandRanking:
      type: object
      properties:
        id:
          type: integer
          example: 12
        rank:
          type: integer
          example: 1
        name:
          type: string
          example: Acme
        type:
          type: string
          example: own
        mentions:
          type: integer
          example: 240
        sentiment:
          type: number
          description: Average sentiment score.
          example: 0.62
        visibilityPercentage:
          type: number
          description: Share of answers that mention this brand.
          example: 38.5
        growth:
          type: number
          description: Change versus the period before.
          example: 4.2
        color:
          type: string
          example: '#FF4D00'
        domain:
          type:
            - string
            - 'null'
          example: acme.com
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: A human-readable explanation.
        code:
          type: string
          description: A short error code, when one applies.
        errors:
          description: Field-level details, on validation errors.
  responses:
    Unauthorized:
      description: The API key is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Invalid, revoked, or expired API key
            code: API_KEY_INVALID
    RateLimited:
      description: >-
        Too many requests. Slow down and retry after the time in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Your per-minute limit.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests left in this window.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix time when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: API rate limit exceeded. Please slow down.
            code: RATE_LIMIT_EXCEEDED
            retryAfter: 30
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your workspace API key as `Authorization: Bearer zr_live_…`.'

````