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

# Get Stats

> Revenue analytics for a Xenarch publisher site — top pages, top paying agents, and time-bucketed USDC earnings from x402 pay-per-crawl.

<RequestExample>
  ```bash theme={null}
  # Overview stats
  curl https://xenarch.dev/v1/sites/b2c3d4e5.../stats \
    -H "Authorization: Bearer xk_pub_abc123..."

  # Time-bucketed stats
  curl "https://xenarch.dev/v1/sites/b2c3d4e5.../stats?bucketed=true" \
    -H "Authorization: Bearer xk_pub_abc123..."
  ```
</RequestExample>

## Notes

* Default view returns top pages and top agents by revenue
* Add `?bucketed=true` for time-bucketed stats (today, this month, all time)


## OpenAPI

````yaml GET /v1/sites/{site_id}/stats
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/sites/{site_id}/stats:
    get:
      tags:
        - sites
      summary: Get Stats
      operationId: get_stats_v1_sites__site_id__stats_get
      parameters:
        - name: site_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Site Id
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteStatsBucketedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SiteStatsBucketedResponse:
      properties:
        today:
          $ref: '#/components/schemas/StatsBucket'
        month:
          $ref: '#/components/schemas/StatsBucket'
        all_time:
          $ref: '#/components/schemas/StatsBucket'
      type: object
      required:
        - today
        - month
        - all_time
      title: SiteStatsBucketedResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StatsBucket:
      properties:
        earned_usd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Earned Usd
        requests:
          type: integer
          title: Requests
        paid:
          type: integer
          title: Paid
      type: object
      required:
        - earned_usd
        - requests
        - paid
      title: StatsBucket
    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

````