Get Statistics
GET /api/user/stats
Retrieve detailed statistics about your files, storage usage, URLs, and activity.
Request
Response
Total number of files uploaded by this user
Number of files marked as favorite
Total views across all files
Average views per file
Total storage used in bytes
Average file size in bytes
Total number of shortened URLs created
Total views across all shortened URLs
Breakdown of files by MIME typeEach key is a MIME type (e.g.,
image/png, video/mp4) and the value is the count of files with that type.Example Response
Statistics Breakdown
File Statistics
- filesUploaded: Every file you’ve uploaded (including deleted files with max views)
- favoriteFiles: Files marked with the favorite flag
- views: Sum of all view counts across files
- avgViews: Mean views per file (views ÷ filesUploaded)
Storage Statistics
- storageUsed: Total bytes used by all your files
- avgStorageUsed: Average file size (storageUsed ÷ filesUploaded)
URL Statistics
- urlsCreated: Total shortened URLs created
- urlViews: Sum of all URL visit counts
File Type Distribution
sortTypeCount provides a breakdown by MIME type, useful for:
- Understanding what types of content you upload most
- Displaying visual charts/graphs
- Analyzing storage usage by file type
Example: Get Top 5 File Types