Getting Started
Get up and running with the Discuse API in minutes. This guide will walk you through authentication, making your first request, and understanding the response format.
Quick Start
Get Your API Key
Sign up for a free account to get your API key. The Basic tier includes 500 image scans and 1,000 sentiment analyses per month.
Configure Authentication
Include your API key in the X-API-Key header with every request.
X-API-Key: dsc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMake Your First Request
Send a POST request to the /api/v2/check endpoint with your content.
curl -X POST https://api.discuse.com/api/v2/check \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"content": {
"text": "Hello, this is a test message!"
}
}'Handle the Response
The API returns a JSON response with moderation results. Check has_violations to determine if action is needed.
{
"has_violations": false,
"message": "Content appears safe",
"results": {
"hits": false,
"sentiment": {
"hit": false,
"toxic": 0.02,
"profanity": 0.01,
"threat": 0.00,
"insult": 0.03
}
},
"processing_time_ms": 45
}API Key Security
Your API key grants access to your account and usage quota. Keep it secure by following these best practices:
- Never expose your API key in client-side code or public repositories
- Use environment variables to store your API key
- Rotate your API key periodically for enhanced security
- Use server-side proxies to keep your API key hidden from users
Rate Limits
Rate limits help ensure fair usage and protect the API from abuse. Limits vary by feature type.
| Plan | Price | Image Scans | Sentiment Analyses |
|---|---|---|---|
| Basic | Free | 500/month | 1,000/month |
| Gold | $4.99/mo | 2,000/month | 5,000/month |
| Platinum | $9.99/mo | 5,000/month | 15,000/month |
| Ultimate | $49.99/mo | 10,000/month | 30,000/month |
When you exceed rate limits, the API returns a 429 Too Many Requests response. Paid plans (Gold, Platinum, Ultimate) support overage at published rates.
Error Handling
The API uses standard HTTP status codes to indicate success or failure.
| Status Code | Description |
|---|---|
200 | Success - Request processed successfully |
400 | Bad Request - Invalid request body or parameters |
401 | Unauthorized - Invalid or missing API key |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error - Internal server error |
Next Steps
Now that you're set up, explore the specific features of the API: