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

# Graph Proxy Analytics

> This endpoint analyzes proxy usage for a given customer within a specified time range
and groups them by one of four discrete intervals: `minute`, `hour`, `day`, or `month`.

You can either

1. Provide a `preset` parameter, which automatically sets period and interval
   (e.g. `last_day`, `last_hour`, etc.)
2. OR, manually specify your own time range (`period_start`, `period_end`) plus `interval`

You can also filter by `hostname`, `network`, `proxy_user_id`, and `service_id`.
Service ID can only be filtered if period is within 7 days and interval is hour or less.
Hostname filters are disallowed if searching older than 90 days.




## OpenAPI

````yaml get /public/user/analytics/graph
openapi: 3.0.1
info:
  title: Byteful Public User API
  description: Public API used for third-party usage.
  termsOfService: https://byteful.com
  contact:
    url: https://byteful.com
    email: developer@byteful.com
  version: '1.0'
  x-logo:
    altText: Byteful
    backgroundColor: '#6354eb'
    url: >-
      https://pbs.twimg.com/profile_banners/1038803520605118464/1729783007/1500x500
servers:
  - url: https://api.byteful.com/1.0/
security: []
paths:
  /public/user/analytics/graph:
    get:
      tags:
        - Proxy Analytics
      summary: Graph Proxy Analytics
      description: >
        This endpoint analyzes proxy usage for a given customer within a
        specified time range

        and groups them by one of four discrete intervals: `minute`, `hour`,
        `day`, or `month`.


        You can either


        1. Provide a `preset` parameter, which automatically sets period and
        interval
           (e.g. `last_day`, `last_hour`, etc.)
        2. OR, manually specify your own time range (`period_start`,
        `period_end`) plus `interval`


        You can also filter by `hostname`, `network`, `proxy_user_id`, and
        `service_id`.

        Service ID can only be filtered if period is within 7 days and interval
        is hour or less.

        Hostname filters are disallowed if searching older than 90 days.
      parameters:
        - name: preset
          in: query
          description: >
            If provided, overrides period_start, period_end, and interval. Must
            be one of ["last_hour", "last_day", "last_week", "last_30_days",
            "last_60_days", "last_90_days", "last_year"].
          schema:
            type: string
        - name: period_start
          in: query
          schema:
            type: string
            format: datetime
        - name: period_end
          in: query
          schema:
            type: string
            format: datetime
        - name: interval
          in: query
          schema:
            type: string
            enum:
              - minute
              - hour
              - day
              - month
        - name: hostname
          in: query
          schema:
            type: string
        - name: network
          in: query
          schema:
            type: string
            enum:
              - datacenter
              - isp
              - residential
              - mobile
        - name: proxy_user_id
          in: query
          schema:
            type: string
        - name: service_id
          in: query
          schema:
            type: string
        - name: show_log_concurrency
          in: query
          description: >
            If true, includes avg_log_concurrency and max_log_concurrency per
            interval bucket and total_avg_log_concurrency and
            total_max_log_concurrency for the period. Only valid when interval
            is minute or hour (raw log data). Returns 422 for day or month
            intervals.
          schema:
            type: boolean
      responses:
        '200':
          description: Analytics graphing successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      intervals:
                        type: array
                        description: >-
                          An array of usage data grouped by the specified
                          interval.
                        items:
                          type: object
                          properties:
                            bytes:
                              type: integer
                              description: Total bytes transferred in this interval.
                              example: 1102393
                            error:
                              type: integer
                              description: Number of failed requests in this interval.
                              example: 0
                            interval:
                              type: string
                              description: >-
                                Exact timestamp (or date, if day/month)
                                representing the interval start.
                              example: '2025-02-27 13:02:00'
                            interval_name:
                              type: string
                              description: Human-friendly label for the interval.
                              example: '2025-02-27 13:02:00'
                            requests:
                              type: integer
                              description: Number of total requests in this interval.
                              example: 266
                            smartpath_money_saved:
                              type: integer
                              description: >-
                                Total money in cents saved by Smartpath routing
                                in this interval.
                              example: 0
                            smartpath_routed_bytes:
                              type: integer
                              description: >-
                                Total bytes optimized by Smartpath in this
                                interval.
                              example: 0
                            smartpath_routed_requests:
                              type: integer
                              description: >-
                                Total requests optimized by Smartpath in this
                                interval.
                              example: 0
                            successful:
                              type: integer
                              description: Number of successful requests in this interval.
                              example: 266
                      total_bytes:
                        type: integer
                        description: The sum of all data bytes transferred.
                        example: 1102393
                      total_error:
                        type: integer
                        description: The total number of failed requests.
                        example: 0
                      total_requests:
                        type: integer
                        description: The total number of requests made.
                        example: 266
                      total_smartpath_money_saved:
                        type: integer
                        description: Total money in cents saved by Smartpath routing.
                        example: 0
                      total_smartpath_routed_bytes:
                        type: integer
                        description: Total bytes optimized by Smartpath.
                        example: 0
                      total_smartpath_routed_requests:
                        type: integer
                        description: Total requests optimized by Smartpath.
                        example: 0
                      total_successful:
                        type: integer
                        description: The total number of successful requests.
                        example: 266
                  message:
                    type: string
                    description: A success message.
                    example: Analytics graphing successful.
      security:
        - APIPrivateKey: []
          APIPublicKey: []
components:
  securitySchemes:
    APIPrivateKey:
      type: apiKey
      description: ' Private API key for user-level authentication.'
      name: X-API-Private-Key
      in: header
    APIPublicKey:
      type: apiKey
      description: ' Public API key for user-level authentication.'
      name: X-API-Public-Key
      in: header

````