🔧 API Documentation
Integrate Comprimir-Video's powerful compression technology into your applications with our comprehensive REST API.
Quick Start
Get Your API Key
Access your dashboard and generate API keys for free or upgrade to Pro+ for higher limits.
API Overview
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Security Note
Keep your API keys secure. Never expose them in client-side code or public repositories. Use environment variables or secure key management.
API Endpoints
/v1/compress
Compress a video file by providing a URL or direct upload.
Request Parameters
video_url
(optional)URL of the video to compress
video_file
(optional)Base64 encoded video file
quality
(required)high, medium, low
format
(required)mp4, avi, mov, etc.
target_size
(optional)Desired output file size
callback_url
(optional)Webhook URL for completion notification
Response
/v1/status/{id}
Check the compression status and download the compressed file when ready.
Code Examples
cURL Request
curl -X POST 'https://api.comprimir-video.com/v1/compress' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "video_url": "https://example.com/video.mp4", "quality": "high", "format": "mp4", "target_size": "10MB" }'
JavaScript
// Compress a video using our API const response = await fetch('https://api.comprimir-video.com/v1/compress', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ video_url: 'https://example.com/video.mp4', quality: 'high', format: 'mp4', target_size: '10MB', callback_url: 'https://yourapp.com/webhook' }) }); const result = await response.json(); console.log('Compression ID:', result.id);
Python
import requests # Compress a video url = 'https://api.comprimir-video.com/v1/compress' headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } data = { 'video_url': 'https://example.com/video.mp4', 'quality': 'high', 'format': 'mp4', 'target_size': '10MB' } response = requests.post(url, headers=headers, json=data) result = response.json() print(f"Compression ID: {result['id']}")
Rate Limits
Rate Limit Headers
API responses include rate limit information in headers:
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
Webhooks
Receive real-time notifications when your video compression is complete. Configure webhook URLs in your compression requests.
Webhook Payload
Security
- • Verify webhook signatures using HMAC
- • Use HTTPS endpoints for webhooks
- • Implement idempotent processing
- • Set up retry mechanisms for failed delivery
Error Handling
HTTP Status Codes
200
Success400
Bad Request401
Unauthorized429
Rate Limited202
Processing422
Validation Error500
Server Error503
Service UnavailableError Response Format
Need Help with Integration?
Our technical team is ready to help you integrate Comprimir-Video's API into your application.
Email us at: api-support@comprimir-video.com