> ## 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.

# Analytics Breakdown

> This endpoint analyzes proxy usage for a given customer within a specified time range
and provides breakdowns by proxy users, hostnames, and network types.

You can either:

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

You can also filter by hostname, network, and proxy_user_id.
Hostname filters are disallowed if searching older than 90 days.




## OpenAPI

````yaml get /public/user/analytics/breakdown
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/breakdown:
    get:
      tags:
        - Proxy Analytics
      summary: Analytics Breakdown
      description: >
        This endpoint analyzes proxy usage for a given customer within a
        specified time range

        and provides breakdowns by proxy users, hostnames, and network types.


        You can either:


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


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

        Hostname filters are disallowed if searching older than 90 days.
      parameters:
        - name: preset
          in: query
          description: >
            If provided, overrides period_start and period_end. 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
          description: >-
            Start date for the analytics period. If not provided, defaults to 7
            days ago.
          schema:
            type: string
            format: datetime
        - name: period_end
          in: query
          description: >-
            End date for the analytics period. If not provided, defaults to
            current time.
          schema:
            type: string
            format: datetime
        - name: hostname
          in: query
          description: >-
            Filter results by specific hostname. Cannot be used for data older
            than 90 days.
          schema:
            type: string
        - name: network
          in: query
          description: Filter results by network type.
          schema:
            type: string
            enum:
              - datacenter
              - isp
              - residential
              - mobile
        - name: proxy_user_id
          in: query
          description: >-
            Filter results by proxy user ID. Must belong to the current
            customer.
          schema:
            type: string
        - name: return_proxy_users
          in: query
          description: Whether to include proxy user data in response. Defaults to true.
          schema:
            type: boolean
        - name: return_hostnames
          in: query
          description: Whether to include hostname data in response. Defaults to true.
          schema:
            type: boolean
        - name: return_networks
          in: query
          description: Whether to include network data in response. Defaults to true.
          schema:
            type: boolean
        - name: sort_by
          in: query
          description: >-
            Field to sort results by, with optional _asc or _desc suffix to
            specify direction.
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of results to return.
          schema:
            type: string
      responses:
        '200':
          description: Analytics breakdown successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      hostnames:
                        type: array
                        description: Breakdown by hostnames (if return_hostnames=true)
                        items:
                          type: object
                          properties:
                            bytes:
                              type: integer
                              description: Total bytes transferred for this hostname
                            hostname:
                              type: string
                              description: The hostname requested
                            requests:
                              type: integer
                              description: Total number of requests to this hostname
                      networks:
                        type: array
                        description: Breakdown by network types (if return_networks=true)
                        items:
                          type: object
                          properties:
                            bytes:
                              type: integer
                              description: Total bytes transferred through this network
                            network:
                              type: string
                              description: Type of network
                              enum:
                                - datacenter
                                - isp
                                - residential
                                - mobile
                            requests:
                              type: integer
                              description: >-
                                Total number of requests made through this
                                network
                      proxy_user_ids:
                        type: array
                        description: Breakdown by proxy users (if return_proxy_users=true)
                        items:
                          type: object
                          properties:
                            bytes:
                              type: integer
                              description: Total bytes transferred by this proxy user
                            proxy_user_id:
                              type: string
                              description: ID of the proxy user
                            requests:
                              type: integer
                              description: Total number of requests made by this proxy user
                      total_bytes:
                        type: integer
                        description: Total number of requests in time period
                      total_requests:
                        type: integer
                        description: Total number of requests in time period
                  message:
                    type: string
                    example: Analytics breakdown 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

````