NSFW Detection API Usage & Content Analysis
Analyze images for NSFW content using Voyantβs AI models. Supports single and batch image processing via secure signed requests.
Base URL: https://api.voyantnetworks.com
Endpoints:
β’ /v1/nsfw/analyze
β’ /v1/nsfw/analyze/batch
Endpoints:
β’ /v1/nsfw/analyze
β’ /v1/nsfw/analyze/batch
Request Flow (Pseudo)
1. payload = { accountId, apiKey, projectId, nonce, timestamp }
nonce β random 10 digit string
timestamp β milliseconds (Date.now())
2. stable = JSON.stringify(sorted(payload))
β οΈ keys MUST be sorted alphabetically
3. signature = HMAC_SHA256(stable, apiSecret)
4. form-data:
add apiKey, projectId, nonce, timestamp, signature
β οΈ append these BEFORE file
5. attach file:
single β "image"
batch β "images" (max 5)
6. POST β /v1/nsfw/analyze or /batch
Official SDKs & Libraries
Use official SDKs for faster integration across platforms.
Node.js
Backend / Server-side
JavaScript (Browser)
Frontend / Web
Flutter
Mobile / Web Apps
Python
Backend / ML / Scripts
SDK Usage (Recommended)
// nodejs usage below // read sdk readme from above links
const creds = {
apiKey: "YOUR_API_KEY",
accountId: "YOUR_ACCOUNT_ID", // π₯ REQUIRED
apiSecret: "YOUR_API_SECRET"
};
const nsfw = new VoyantClient.NsfwApiClient({
credentials: creds,
projectId: "YOUR_PROJECT_ID"
});
// single
await nsfw.analyze(file);
// batch
await nsfw.analyzeBatch([file1, file2]);
Signature (All Languages)
payload = { accountId, apiKey, projectId, nonce, timestamp }
stable = JSON.stringify(sorted(payload))
signature = HMAC_SHA256(stable, apiSecret)
Single Image
curl -X POST https://api.voyantnetworks.com/v1/nsfw/analyze \ -F "accountId=..." \ -F "projectId=..." \ -F "apiKey=..." \ -F "nonce=..." \ -F "timestamp=..." \ -F "signature=..." \ -F "[email protected]"
Batch
curl -X POST https://api.voyantnetworks.com/v1/nsfw/analyze/batch \ -F "projectId=..." -F "apiKey=..." -F "nonce=..." \ -F "timestamp=..." -F "signature=..." \ -F "[email protected]" -F "[email protected]"
Response
{ "success": true, "nsfw": false }
Next Steps
Manage and optimize your NSFW API usage: