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

# Viewer graph



## OpenAPI

````yaml https://statistics.1up.vision/openapi.json get /v1/streamer/{name}/viewer-graph
openapi: 3.1.0
info:
  title: Vision Stats API
  version: 1.0.0
  description: >-
    REST API for accessing Twitch streamer analytics, stream summaries, partner
    data, and events. All endpoints are read-only and powered by Cloudflare
    Workers + Hyperdrive.
  contact:
    name: Vision Stats
    url: https://1up.vision
servers:
  - url: http://localhost:8787
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Meta
    description: Operational endpoints
  - name: Streamer
    description: Streamer level information
  - name: Streams
    description: Individual stream analytics
  - name: Leaderboard
    description: Aggregated leaderboards
  - name: Partners
    description: Sponsor and partner information
  - name: Events
    description: Public events
paths:
  /v1/streamer/{name}/viewer-graph:
    get:
      tags:
        - Streamer
      summary: Viewer graph
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: Streamer username/login (lowercase) or numeric Twitch channel id.
        - name: days
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 90
            default: 30
          description: How many days of history to include.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ViewerPoint'
        '401':
          description: Missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to fetch viewer graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ViewerPoint:
      type: object
      properties:
        viewers:
          type: integer
        created_at:
          type: string
          format: date-time
        game_name:
          type: string
          nullable: true
      required:
        - viewers
        - created_at
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >-
        Optional bearer token enforced when the Worker is configured with an API
        token.

````