API Documentation
Integrate AI content detection into your application in minutes with our simple REST API.
Quick Start
1. API Endpoint
POST https://your-domain.com/api/detect2. Make a Request
JavaScript / TypeScript
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('/api/detect', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log(result);Python
import requests
with open('image.jpg', 'rb') as f:
files = {'file': f}
response = requests.post(
'https://your-domain.com/api/detect',
files=files
)
result = response.json()
print(result)cURL
curl -X POST https://your-domain.com/api/detect \
-F "file=@/path/to/image.jpg"Response Format
{
"success": true,
"data": {
"file": "image.jpg",
"fileType": "image/jpeg",
"c2paStatus": "FOUND",
"verdict": "AI_DETECTED_C2PA",
"confidence": "HIGH",
"platform": "openai",
"company": "OpenAI",
"message": "C2PA metadata found",
"c2paInfo": {
"aiGenerated": true,
"signatureValid": true,
"software": "DALL-E 3",
"organization": "OpenAI",
"detectedMarkers": ["c2pa.ai_generative_training"]
}
}
}Response Fields
successBoolean indicating if the request was successfulverdictDetection result: AI_DETECTED_C2PA, HUMAN_CREATED, or NO_C2PA_DATAconfidenceConfidence level: HIGH, MEDIUM, or LOWplatformDetected platform: openai, google, adobe, microsoftc2paInfoDetailed C2PA metadata including AI generation statusSupported Formats
Images
- PNG (.png)
- JPEG (.jpg, .jpeg)
- WebP (.webp)
- HEIC (.heic)
- AVIF (.avif)
Videos
- MP4 (.mp4)
- MOV (.mov)
- AVI (.avi)
- WebM (.webm)
- MKV (.mkv)
Integration Examples
React / Next.js
import { useState } from 'react';
function AIDetector() {
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
const handleFileUpload = async (e) => {
const file = e.target.files[0];
if (!file) return;
setLoading(true);
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch('/api/detect', {
method: 'POST',
body: formData,
});
const data = await response.json();
setResult(data);
} catch (error) {
console.error('Detection failed:', error);
} finally {
setLoading(false);
}
};
return (
<div>
<input type="file" onChange={handleFileUpload} />
{loading && <p>Analyzing...</p>}
{result && (
<div>
<p>Verdict: {result.data.verdict}</p>
<p>Confidence: {result.data.confidence}</p>
</div>
)}
</div>
);
}Node.js / Express
const express = require('express');
const multer = require('multer');
const FormData = require('form-data');
const axios = require('axios');
const fs = require('fs');
const app = express();
const upload = multer({ dest: 'uploads/' });
app.post('/detect', upload.single('file'), async (req, res) => {
try {
const formData = new FormData();
formData.append('file', fs.createReadStream(req.file.path));
const response = await axios.post(
'https://your-domain.com/api/detect',
formData,
{ headers: formData.getHeaders() }
);
res.json(response.data);
} catch (error) {
res.status(500).json({ error: error.message });
}
});
app.listen(3000);Error Handling
{
"success": false,
"error": "No file uploaded"
}
// Common error messages:
// - "No file uploaded"
// - "Unsupported file type"
// - "File too large (max 100MB)"
// - "Failed to process file"Additional Resources
GitHub Repository
Open source project. View code, contribute, report issues, and star the repo!
Open Source⭐ Star on GitHub
C2PA Specification
Learn more about the C2PA standard for content authenticity and provenance.
Content Authenticity Initiative
Explore the CAI's mission to restore trust in digital content.
Need Help?
Have questions about integration? We're here to help.
Contact SupportOpen Source & Community Driven
Huminify is 100% open source. Star the repo, contribute code, report issues, or suggest features. Help us build the future of content authenticity verification!