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

# Traffic breakdown

> Retrieve traffic (in GB) grouped by a dimension (`package`, `proxy_type`, `tier`, `country`, `domain`, or `ingress_ip`), as a series of interval buckets. When `group_by=package`, keys are package names. The date range may span at most 365 days. If `interval` is omitted it is chosen automatically from the range (< 24 h → `hour`, < 60 days → `day`, otherwise `month`). Explicit intervals are validated: `hour` needs a range of at most 24 hours, `day` between 24 hours and 180 days, `month` at least 60 days.

If the API key is restricted to specific packages, results (and any `package_ids` filter) are limited to those packages.

Requires the `proxy:analytics:read` scope.



## OpenAPI

````yaml api/openapi.json POST /v1/proxy/analytics/traffic
openapi: 3.1.0
info:
  title: SOAX API
  version: v1
  description: >-
    Programmatic access to your SOAX account: manage proxy packages, generate
    connection strings, browse available locations, pull usage analytics, and
    manage API keys. All endpoints are served over HTTPS and return JSON.
servers:
  - url: https://api.platform.soax.com
security:
  - bearerAuth: []
tags:
  - name: API Keys
    description: >-
      Self-service management of the API keys used to authenticate with this
      API.
  - name: Packages
    description: >-
      Read proxy packages, build proxy connection strings, and rotate package
      passwords.
  - name: Locations
    description: >-
      Location reference data: tiers, countries, regions, cities, ISPs, ASNs,
      and ZIP codes.
  - name: Account
    description: Read-only account, credit, and subscription information.
  - name: Analytics
    description: Usage analytics for your proxy packages.
paths:
  /v1/proxy/analytics/traffic:
    post:
      tags:
        - Analytics
      summary: Get traffic breakdown for proxy usage
      description: >-
        Retrieve traffic (in GB) grouped by a dimension (`package`,
        `proxy_type`, `tier`, `country`, `domain`, or `ingress_ip`), as a series
        of interval buckets. When `group_by=package`, keys are package names.
        The date range may span at most 365 days. If `interval` is omitted it is
        chosen automatically from the range (< 24 h → `hour`, < 60 days → `day`,
        otherwise `month`). Explicit intervals are validated: `hour` needs a
        range of at most 24 hours, `day` between 24 hours and 180 days, `month`
        at least 60 days.


        If the API key is restricted to specific packages, results (and any
        `package_ids` filter) are limited to those packages.


        Requires the `proxy:analytics:read` scope.
      operationId: get_traffic_breakdown_v1_proxy_analytics_traffic_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrafficRequest'
            example:
              from_date: '2026-08-01T00:00:00Z'
              to_date: '2026-08-07T23:59:59Z'
              group_by: country
              interval: day
              countries:
                - us
                - de
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TrafficResponseItem'
                type: array
                title: Response Get Traffic Breakdown V1 Proxy Analytics Traffic Post
              example:
                - data:
                    - key: us
                      value: 12.41
                    - key: de
                      value: 3.17
                - data:
                    - key: us
                      value: 9.83
                    - key: de
                      value: 4.02
        '400':
          description: >-
            A parameter value or combination is invalid. Service-level
            validation errors use the `error` key; endpoint-level checks use
            `detail`. Read `detail ?? error`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error:
                    type: string
              example:
                error: hour interval requires a date range less than 24 hours
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    TrafficRequest:
      properties:
        from_date:
          type: string
          format: date-time
          title: From Date
          description: Start of the query range (ISO 8601).
        to_date:
          type: string
          format: date-time
          title: To Date
          description: >-
            End of the query range (ISO 8601). At most 365 days after
            `from_date`.
        group_by:
          $ref: '#/components/schemas/GroupBy'
          default: package
        interval:
          anyOf:
            - $ref: '#/components/schemas/Interval'
            - type: 'null'
          description: >-
            Bucket size for the series. Auto-selected from the range when
            omitted (< 24 h → hour, < 60 days → day, otherwise month).
        package_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Package Ids
          description: Restrict results to these package IDs.
        network_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Network Types
          description: 'Restrict results to network types: `residential` and/or `mobile`.'
        tiers:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Tiers
          description: Restrict results to tiers (1, 2, or 3).
        countries:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Countries
          description: Restrict results to these ISO country codes.
        target_addresses:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Target Addresses
          description: Restrict results to traffic sent to these domains.
      type: object
      required:
        - from_date
        - to_date
      title: TrafficRequest
      description: Request model for traffic breakdown analysis.
    TrafficResponseItem:
      properties:
        data:
          items:
            $ref: '#/components/schemas/TrafficDataPoint'
          type: array
          title: Data
      type: object
      required:
        - data
      title: TrafficResponseItem
      description: Response item for traffic breakdown analysis.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GroupBy:
      type: string
      enum:
        - package
        - proxy_type
        - tier
        - country
        - domain
        - ingress_ip
      title: GroupBy
      description: Allowed grouping dimensions for analytics queries.
    Interval:
      type: string
      enum:
        - hour
        - day
        - month
      title: Interval
      description: Allowed time intervals for analytics aggregation.
    TrafficDataPoint:
      properties:
        key:
          type: string
          title: Key
        value:
          type: number
          title: Value
      type: object
      required:
        - key
        - value
      title: TrafficDataPoint
      description: Single data point in traffic breakdown.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: Invalid API key
    ForbiddenScope:
      description: The API key does not carry the scope this endpoint requires.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: 'Missing required scope: proxy:packages:read'
    RateLimited:
      description: >-
        Rate limit exceeded (5 requests/second per API key, 500 requests/minute
        per IP). The response includes `Retry-After` (seconds),
        `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (Unix
        time) headers — wait `Retry-After` seconds and retry.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
          example:
            error: 'Rate limit exceeded: 5 per 1 second'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key secret (starts with `s_live_`). Create keys in the dashboard
        under **Settings → API keys**, or via `POST /v1/api-keys/`. Send it as
        `Authorization: Bearer <secret>`.

````