EmberlyEmberly Docs

Analytics API

Retrieve usage analytics, storage stats, and top-content data via the Emberly API.

The Analytics API provides insights into your file uploads, URL clicks, storage usage, and download activity. Most analytics endpoints work with both a bearer token and a session cookie.

Endpoints

MethodPathAuthDescription
GET/api/analytics/overviewOptionalDashboard summary (user or global)
GET/api/analytics/summarySessionCondensed stats for current user
GET/api/analytics/storageSessionStorage breakdown and daily upload trend
GET/api/analytics/top-itemsOptionalTop 10 files and URLs by activity
GET/api/analytics/metrics/activityNone30-day public activity metrics
GET/api/analytics/exportSessionExport analytics as CSV (advanced plans)

Dashboard Overview

GET /api/analytics/overview

Returns a comprehensive summary of activity. When authenticated, returns your stats; when unauthenticated, returns global platform stats.

Auth: Optional (bearer token or session cookie)

Response (200):

{
  "success": true,
  "data": {
    "totals": {
      "files": 1240,
      "urls": 380,
      "storageUsed": 5368709120,
      "views": 98432,
      "downloads": 12054
    },
    "topFiles": [
      {
        "id": "cm7xabc123",
        "name": "demo-video.mp4",
        "url": "https://embrly.ca/user/demo-video.mp4",
        "downloads": 412,
        "mimeType": "video/mp4"
      }
    ],
    "topUrls": [
      {
        "id": "cm8xdef456",
        "shortCode": "abc123",
        "shortUrl": "https://embrly.ca/abc123",
        "originalUrl": "https://example.com",
        "clicks": 980
      }
    ],
    "recentUploads": [ { ... } ],
    "storageByType": {
      "image/png": 1073741824,
      "video/mp4": 2147483648,
      "application/pdf": 536870912
    },
    "dailyUploads": [
      { "date": "2026-04-01", "count": 14 },
      { "date": "2026-04-02", "count": 22 }
    ],
    "domainCounts": {
      "total": 3,
      "active": 2,
      "pending": 1
    }
  }
}

User Summary

GET /api/analytics/summary

A condensed stat card for the currently authenticated user. Used by the dashboard header.

Auth: Session cookie required

Response (200):

{
  "success": true,
  "data": {
    "files": 1240,
    "urls": 380,
    "storageUsed": 5368709120,
    "storageQuota": 26843545600,
    "views": 98432,
    "downloads": 12054,
    "domains": 3,
    "plan": {
      "name": "Flare",
      "slug": "flare"
    }
  }
}

Storage Analytics

GET /api/analytics/storage

Storage usage over time, broken down by file type.

Auth: Session cookie required

Response (200):

{
  "success": true,
  "data": {
    "totalBytes": 5368709120,
    "dailyUploads": [
      { "date": "2026-04-01", "bytes": 524288000 },
      { "date": "2026-04-02", "bytes": 734003200 }
    ],
    "byMimeType": [
      { "mimeType": "image/png", "bytes": 1073741824, "count": 420 },
      { "mimeType": "video/mp4", "bytes": 2147483648, "count": 38 },
      { "mimeType": "application/pdf", "bytes": 536870912, "count": 182 }
    ]
  }
}

Top Items

GET /api/analytics/top-items

Returns the top 10 most downloaded files and top 10 most-clicked URLs. When authenticated, returns your items; when unauthenticated, returns global top items.

Auth: Optional

Response (200):

{
  "success": true,
  "data": {
    "topFiles": [
      {
        "id": "cm7xabc123",
        "name": "presentation.pdf",
        "url": "https://embrly.ca/user/presentation.pdf",
        "downloads": 1230,
        "mimeType": "application/pdf"
      }
    ],
    "topUrls": [
      {
        "id": "cm8xdef456",
        "shortCode": "xyz789",
        "shortUrl": "https://embrly.ca/xyz789",
        "originalUrl": "https://github.com/EmberlyOSS/Emberly",
        "clicks": 4820
      }
    ]
  }
}

Public Activity Feed

GET /api/analytics/metrics/activity

Returns daily upload and URL creation counts for the past 30 days. This endpoint is public and requires no authentication.

Auth: None

Response (200):

{
  "success": true,
  "data": [
    {
      "date": "2026-03-13",
      "fileUploads": 48,
      "urlsCreated": 17
    },
    {
      "date": "2026-03-14",
      "fileUploads": 62,
      "urlsCreated": 24
    }
  ]
}

Export Analytics as CSV

GET /api/analytics/export

Export your analytics data as a CSV file. Requires an advanced analytics plan (Flare or higher).

Auth: Session cookie required

Query Parameters:

ParameterDescription
typefiles or urls
fromISO date — start of range
toISO date — end of range

Response: Content-Type: text/csv with Content-Disposition: attachment header.

Analytics export is available on Flare and above plans. A 403 is returned for lower-tier accounts.

Example:

curl -H "Cookie: YOUR_SESSION_COOKIE" \
  "https://embrly.ca/api/analytics/export?type=files&from=2026-01-01&to=2026-04-01" \
  -o analytics.csv

On this page