mirror of
https://github.com/Significant-Gravitas/AutoModerate.git
synced 2026-11-08 17:50:32 -10:00
2.4 KiB
2.4 KiB
Project Statistics API
Get basic statistics about your project's moderation activity.
Get Project Statistics
Retrieve basic statistics for your project's content moderation activity.
Endpoint
GET /api/stats
Headers
X-API-Key: your-api-key
Response
{
"success": true,
"stats": {
"total_content": 1542,
"approved": 1293,
"rejected": 218,
"flagged": 31,
"pending": 0,
"approval_rate": 83.9
}
}
Statistics Fields
- total_content: Total number of content items moderated
- approved: Number of approved content items
- rejected: Number of rejected content items
- flagged: Number of items flagged for manual review
- pending: Number of items still being processed
- approval_rate: Percentage of content approved (calculated as
approved / total_content * 100)
Example Request
curl -H "X-API-Key: your-api-key" \
http://localhost:6217/api/stats
Example Response
{
"success": true,
"stats": {
"total_content": 2847,
"approved": 2456,
"rejected": 315,
"flagged": 76,
"pending": 0,
"approval_rate": 86.3
}
}
Status Definitions
- approved: Content passed all moderation rules and was approved
- rejected: Content violated one or more moderation rules and was rejected
- flagged: Content was flagged for manual review
- pending: Content is currently being processed (should typically be 0)
Error Responses
Missing API Key
{
"error": "API key required"
}
HTTP Status: 401
Invalid API Key
{
"error": "Invalid API key"
}
HTTP Status: 401
Internal Server Error
{
"error": "Internal server error"
}
HTTP Status: 500
Usage Notes
- Statistics are calculated in real-time from your project's content database
- Only content belonging to your project (identified by API key) is included in the statistics
- The approval rate is calculated as
(approved_count / total_content_count) * 100 - If there is no content in the project,
total_contentwill be 0 andapproval_ratewill be 0
Next Steps
- Content Moderation API - Submit content for moderation
- Content Listing API - List moderated content
- WebSocket Events - Real-time updates
- API Overview - General API information