Logs & TrendsGet trends
Logs & Trends

Get trends

Retrieve aggregated trend data for a client tenant over a specified time period. Returns metrics such as total page views, unique visitors, average session duration, and bounce rate.

curl -X GET "https://api.mythic-analytics.com/api/v1/clients/example_string/trends?period=24h&granularity=hour" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "total_page_views": 42600,
    "total_unique_visitors": 26700,
    "avg_session_duration": 175.3,
    "bounce_rate": 0.38,
    "data_points": [
      {
        "date": "2024-06-15",
        "page_views": 1420,
        "unique_visitors": 890,
        "sessions": 1050,
        "avg_session_duration": 182.5,
        "bounce_rate": 0.42
      }
    ]
  }
}
GET
/clients/{id}/trends
GET
Security Scheme
Bearer Tokenstring
Required

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY
path
idstring
Required

Client identifier.

Pattern: ^[a-zA-Z0-9_-]{1,255}$
query
periodstring

Time period for trend aggregation. Default: 30d.

Options: 24h, 7d, 30d, 90d
query
granularitystring

Data point granularity. Default: day.

Options: hour, day, week
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Path Parameters

idstring
Required

Client identifier.

Query Parameters

periodstring

Time period for trend aggregation. Default: 30d.

Allowed values:24h7d30d90d
granularitystring

Data point granularity. Default: day.

Allowed values:hourdayweek

Responses

successboolean
dataobject