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

# Get Sitemap Page Metrics

> Return time-series performance metrics for a single page: citations, AI referrals, and AI agent traffic. Each metric is reported as a list of buckets keyed by date, with counts broken down by AI platform.

Granularity is chosen automatically based on the requested date range — short ranges return daily buckets, longer ranges return weekly buckets. Date ranges are capped at 366 days.



## OpenAPI

````yaml /api-reference/openapi.json get /{brand_id}/sitemap/pages/{page_id}/metrics
openapi: 3.1.0
info:
  title: Scrunch Data API
  version: 0.1.0
servers:
  - url: https://api.scrunchai.com/v1
security: []
paths:
  /{brand_id}/sitemap/pages/{page_id}/metrics:
    get:
      tags:
        - sitemap
      summary: Get Sitemap Page Metrics
      description: >-
        Return time-series performance metrics for a single page: citations, AI
        referrals, and AI agent traffic. Each metric is reported as a list of
        buckets keyed by date, with counts broken down by AI platform.


        Granularity is chosen automatically based on the requested date range —
        short ranges return daily buckets, longer ranges return weekly buckets.
        Date ranges are capped at 366 days.
      operationId: getSitemapPageMetrics
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: integer
            title: Brand Id
            description: The unique identifier for the brand.
          description: The unique identifier for the brand.
        - name: page_id
          in: path
          required: true
          schema:
            type: integer
            title: Page Id
            description: The unique identifier for the page.
          description: The unique identifier for the page.
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: Start date (YYYY-MM-DD). Defaults to 30 days ago.
            title: Start Date
          description: Start date (YYYY-MM-DD). Defaults to 30 days ago.
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: End date (YYYY-MM-DD). Defaults to today.
            title: End Date
          description: End date (YYYY-MM-DD). Defaults to today.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SitemapPageMetricsResponse'
        '400':
          description: Invalid or out-of-range date parameters.
        '404':
          description: Page not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer:
            - query
components:
  schemas:
    SitemapPageMetricsResponse:
      properties:
        granularity:
          type: string
          enum:
            - daily
            - weekly
          title: Granularity
          description: 'Time-series granularity: `daily` or `weekly`.'
        metrics:
          $ref: '#/components/schemas/SitemapUrlMetrics'
      type: object
      required:
        - granularity
        - metrics
      title: SitemapPageMetricsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SitemapUrlMetrics:
      properties:
        citations:
          type: array
          items:
            $ref: '#/components/schemas/SitemapMetricRow'
          title: Citations
          description: Citation counts over time by AI platform.
        ai_referrals:
          type: array
          items:
            $ref: '#/components/schemas/SitemapMetricRow'
          title: AI Referrals
          description: AI referral counts over time by AI platform.
        agent_traffic:
          type: array
          items:
            $ref: '#/components/schemas/SitemapMetricRow'
          title: Agent Traffic
          description: AI agent traffic counts over time by AI platform.
      type: object
      required:
        - citations
        - ai_referrals
        - agent_traffic
      title: SitemapUrlMetrics
    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
    SitemapMetricRow:
      properties:
        date:
          type: string
          title: Date
          description: Date in ISO 8601 format (YYYY-MM-DD).
        count_by_platform:
          type: object
          title: Count By Platform
          additionalProperties:
            type: integer
          description: >-
            Counts keyed by AI platform name (for example `OpenAI`,
            `Perplexity`, `Gemini`).
      type: object
      required:
        - date
        - count_by_platform
      title: SitemapMetricRow
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````