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

# Page Insights

> Returns a page's citations and agent visits per day, the last period against the one before, citations by AI platform and its trend. Counts run through yesterday.



## OpenAPI

````yaml /openapi.json get /v2/library/pages/{page_id}/insights
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
tags:
  - name: Status
    description: Check API availability and validate the calling API key.
  - name: Visibility
    description: >-
      Measure visibility, citations, competitors, and prompt performance across
      answer platforms.
  - name: Prompts
    description: Manage tracked prompts and topics, and inspect their stored runs.
  - name: Opportunities
    description: Review ranked opportunities computed from prompt visibility results.
  - name: Tasks
    description: Manage the persisted action queue and task lifecycle.
  - name: Library
    description: >-
      Track the pages you publish and the redirects you set up: their AI answer
      citations and agent visits per day, and whether each is helping.
  - name: Site Audits
    description: Review website audit results and page-level findings.
  - name: Agent Analytics
    description: >-
      See which coding agents, AI bots, and people visit your tracked sites,
      which pages they read, which pages return errors, and where the visits
      come from.
  - name: Evals
    description: Define eval tasks, judges, subjects, and saved configurations.
  - name: Eval Templates
    description: >-
      Select reusable judges, targets, schedules, metadata, and runtime settings
      with `POST /v2/eval-templates`, then copy only those settings into
      prompt-specific evals with `POST /v2/evals/batch`. Templates never contain
      prompts and remain independent from evals created from them.
  - name: Eval Runs
    description: Start eval runs and inspect their lifecycle state.
  - name: Eval Results
    description: Review completed eval outcomes and diagnostic details.
  - name: Agent Preference
    description: >-
      Compare your company head-to-head with a tracked competitor. Create a
      comparison with `POST /v2/agent-preference/evals`, run it with `POST
      /v2/eval-runs`, then read which company agents recommended.
  - name: Plugin Evals
    description: >-
      Download a day's ChatGPT plugin eval results: every run with and without
      the plugin, plus its insights report.
  - name: Agents
    description: List runnable coding-agent harness and model combinations.
  - name: Repositories
    description: Manage reusable Git repository workspaces.
  - name: Environments
    description: List reusable runtime environments without exposing secret values.
  - name: MCP Servers
    description: List reusable MCP server integrations without exposing credentials.
  - name: CLIs
    description: List reusable command-line interfaces without exposing setup commands.
  - name: Skills
    description: List reusable skills available to workflows and evals.
paths:
  /v2/library/pages/{page_id}/insights:
    get:
      tags:
        - Library
      summary: Page Insights
      description: >-
        Returns a page's citations and agent visits per day, the last period
        against the one before, citations by AI platform and its trend. Counts
        run through yesterday.
      operationId: v2_library_pages_insights
      parameters:
        - name: page_id
          in: path
          required: true
          schema:
            type: string
            title: Page Id
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 180
            minimum: 7
            default: 30
            title: Days
          description: Days in each compared period.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryPageInsights'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LightsageApiKeyAuth: []
components:
  schemas:
    LibraryPageInsights:
      properties:
        id:
          type: string
          title: Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        days:
          type: integer
          title: Days
        data_through:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Data Through
          description: >-
            Last day citations are counted for. Today's answers are counted from
            tomorrow.
        trend:
          type: string
          enum:
            - rising
            - falling
            - steady
            - new
            - no_citations
            - not_comparable
          title: Trend
        summary:
          type: string
          title: Summary
          description: One-sentence reading of the trend.
        current:
          $ref: '#/components/schemas/LibraryPeriodTotals'
        previous:
          $ref: '#/components/schemas/LibraryPeriodTotals'
        citations_change_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Citations Change Percent
        platforms:
          items:
            $ref: '#/components/schemas/LibraryPlatformCitations'
          type: array
          title: Platforms
        daily:
          items:
            $ref: '#/components/schemas/LibraryDay'
          type: array
          title: Daily
        milestones:
          anyOf:
            - $ref: '#/components/schemas/LibraryMilestones'
            - type: 'null'
        agent_visits_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Visits Note
      type: object
      required:
        - id
        - url
        - days
        - trend
        - summary
        - current
        - previous
        - platforms
        - daily
      title: LibraryPageInsights
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LibraryPeriodTotals:
      properties:
        start:
          type: string
          format: date
          title: Start
        end:
          type: string
          format: date
          title: End
        days_counted:
          type: integer
          title: Days Counted
          description: Days in the period with citation data ready.
        citations:
          type: integer
          title: Citations
        agent_visits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Visits
        days_cited:
          type: integer
          title: Days Cited
      type: object
      required:
        - start
        - end
        - days_counted
        - citations
        - days_cited
      title: LibraryPeriodTotals
    LibraryPlatformCitations:
      properties:
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        citations:
          type: integer
          title: Citations
        previous_citations:
          type: integer
          title: Previous Citations
      type: object
      required:
        - platform
        - citations
        - previous_citations
      title: LibraryPlatformCitations
    LibraryDay:
      properties:
        date:
          type: string
          format: date
          title: Date
        citations:
          anyOf:
            - type: integer
            - type: 'null'
          title: Citations
          description: >-
            Null on a day whose citations are not counted yet (it has agent
            visits only).
        cited_prompts:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cited Prompts
          description: >-
            Tracked prompts whose answers cited the address that day. Null when
            not counted yet.
        agent_visits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Visits
          description: Null where agent visits are not tracked for the address.
        coding_agent_visits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Coding Agent Visits
      type: object
      required:
        - date
        - citations
        - cited_prompts
      title: LibraryDay
    LibraryMilestones:
      properties:
        published_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Published On
        first_cited_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: First Cited On
          description: First day an AI answer was seen citing the page.
        first_citation_is_baseline:
          type: boolean
          title: First Citation Is Baseline
          description: >-
            True when the first citing prompt had not run before that day, so
            the page may have been cited earlier.
          default: false
        first_cited_platform:
          anyOf:
            - type: string
            - type: 'null'
          title: First Cited Platform
        first_cited_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: First Cited Prompt
        days_to_citation:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days To Citation
          description: >-
            Days from publishing to the first citation, when it came on or after
            the publish day.
        first_agent_visit_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: First Agent Visit On
      type: object
      title: LibraryMilestones
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    LightsageApiKeyAuth:
      type: apiKey
      in: header
      name: X-Lightsage-Api-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.