OpenSite Analytics provides a RESTful API for managing sites, tracking analytics, and user authentication.
http://localhost:8000
All API endpoints (except login and register) require JWT authentication.
Authorization: Bearer <your_jwt_token>
Content-Type: application/json
Login user and return JWT token.
Register new user account.
Refresh JWT token.
Get all sites for authenticated user.
Create new site.
Get site by ID.
Update site.
Delete site.
Get analytics overview for site.
Get page view analytics.
Get visitor analytics.
Get real-time analytics.
Track custom event.
Get events for site.
Get user profile.
Update user profile.
Get user settings.
Update user settings.
API returns appropriate HTTP status codes and error messages.
200 - Success201 - Created400 - Bad Request401 - Unauthorized403 - Forbidden404 - Not Found429 - Too Many Requests500 - Internal Server Error{
"error": "Error message",
"code": "ERROR_CODE",
"details": {}
}
API endpoints are rate limited to prevent abuse.
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200