ApiAnalytics
Get analytics dashboard data
GET
bearerX-API-Version?stringAPI version for header-based versioning
Default
"1"Value in
"1""2"Analytics data fetched successfully
response?unknownapplication/jsoncurl -X GET 'http://localhost:3001/api/v1/analytics/dashboard'Example Response
{ "status": "success", "statusCode": 200, "message": "Analytics fetched successfully", "data": { "overview": { "totalVisitors": 1250, "uniqueVisitors": 850, "todayVisitors": 45, "weekVisitors": 320, "monthVisitors": 1150, "returningVisitors": 400, "newVisitors": 850 }, "topCountries": [ { "country": "United States", "countryCode": "US", "count": 450 }, { "country": "India", "countryCode": "IN", "count": 320 } ], "topCities": [ { "city": "New York", "country": "United States", "count": 120 } ], "topPages": [ { "page": "/", "count": 500 }, { "page": "/about", "count": 250 } ], "browserStats": [ { "browser": "Chrome", "count": 800 }, { "browser": "Safari", "count": 300 } ], "osStats": [ { "os": "Windows", "count": 600 }, { "os": "Mac OS", "count": 400 } ], "deviceStats": [ { "device": "desktop", "count": 800 }, { "device": "mobile", "count": 400 } ] }}