# Get duration distribution Get a histogram of session durations. Returns a histogram showing the distribution of Meeting Buddy session durations across predefined time buckets (e.g., 0-5 min, 5-15 min, 15-30 min, etc.). Useful for understanding typical meeting lengths. Defaults to the last 30 days. #### Query Parameters **`start_date`** string optional Start of date range (UTC, ISO 8601 format). Defaults to 30 days before `end_date`. **`end_date`** string optional End of date range (UTC, ISO 8601 format). Defaults to current time. ## Returns Returns a distribution object: | Field | Type | Description | | --- | --- | --- | | `total` | integer | Total sessions included in the distribution | | `buckets` | array | Duration buckets with counts | Each bucket contains: | Field | Type | Description | | --- | --- | --- | | `label` | string | Human-readable label (e.g., `"0-5 min"`, `"30-60 min"`) | | `min_seconds` | number | Minimum duration in seconds for this bucket | | `max_seconds` | number | Maximum duration in seconds for this bucket | | `count` | integer | Number of sessions in this bucket | | `percentage` | number | Percentage of total sessions | Request ```bash cURL curl -s -X GET "https://api.aitronos.com/v1/meeting-buddy/analytics/duration-distribution" \ -H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") dist = client.meeting_buddy.get_duration_distribution() print(f"Total sessions: {dist.total}") for bucket in dist.buckets: bar = "#" * (bucket.count // 2) print(f" {bucket.label:>12}: {bucket.count:3d} ({bucket.percentage:.1f}%) {bar}") ``` ```python Python import os import requests access_token = os.environ["ACCESS_TOKEN"] url = "https://api.aitronos.com/v1/meeting-buddy/analytics/duration-distribution" headers = {"Authorization": f"Bearer {access_token}"} response = requests.get(url, headers=headers) data = response.json() for bucket in data["buckets"]: print(f"{bucket['label']}: {bucket['count']} ({bucket['percentage']:.1f}%)") ``` ```javascript JavaScript const accessToken = process.env.ACCESS_TOKEN; const response = await fetch( 'https://api.aitronos.com/v1/meeting-buddy/analytics/duration-distribution', { headers: { 'Authorization': `Bearer ${accessToken}`, }, } ); const data = await response.json(); data.buckets.forEach(bucket => { console.log(`${bucket.label}: ${bucket.count} (${bucket.percentage.toFixed(1)}%)`); }); ``` Response ```json 200 OK { "total": 156, "buckets": [ { "label": "0-5 min", "min_seconds": 0, "max_seconds": 300, "count": 12, "percentage": 7.7 }, { "label": "5-15 min", "min_seconds": 300, "max_seconds": 900, "count": 28, "percentage": 17.9 }, { "label": "15-30 min", "min_seconds": 900, "max_seconds": 1800, "count": 45, "percentage": 28.8 }, { "label": "30-60 min", "min_seconds": 1800, "max_seconds": 3600, "count": 52, "percentage": 33.3 }, { "label": "60+ min", "min_seconds": 3600, "max_seconds": 86400, "count": 19, "percentage": 12.2 } ] } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication is required to access this resource.", "type": "client_error", "status": 401, "details": {}, "trace_id": "abc-123-def", "timestamp": "2025-12-11T10:00:00Z" } } ``` ## Related Resources - [Analytics Summary](/docs/api-reference/meeting-buddy/analytics-summary) - [Session Trends](/docs/api-reference/meeting-buddy/analytics-trends) - [Platform Breakdown](/docs/api-reference/meeting-buddy/analytics-platform-breakdown) - [Status Breakdown](/docs/api-reference/meeting-buddy/analytics-status-breakdown)