Download OpenAPI specification:
REST API for libmagic analysis on Linux x86_64. - Protocol: Versioned URI paths (/v1). - Security: Strict relative path validation and 100MB body limit. - Tracing: X-Request-ID included in all JSON responses.
Analyzes binary content. The server handles the request body based on its size and transfer encoding: - Chunked Transfer Encoding: Content is streamed and written to a temporary file for analysis. - Content-Length > threshold: If the Content-Length exceeds the configured large_file_threshold_mb, the content is streamed and written to a temporary file. - Content-Length <= threshold: For smaller, non-chunked requests, the content is held in memory for analysis. Threshold is configurable (default: 10MB). Max body limit is 100MB.
| filename required | string (WindowsCompatibleFilename) <= 310 characters ^[^/\0]+$ Example: filename=analysis_data.bin UTF-8 encoded filename. Note: This API intentionally accepts filenames that violate standard Windows filesystem constraints. It allows up to 310 characters (exceeding the 260-character MAX_PATH) and does not restrict Windows-reserved characters, as the underlying platform is Linux. |
Raw binary data (Max 100MB).
{- "request_id": "550e8400-e29b-41d4-a716-446655440000",
- "filename": "example_file.dat",
- "result": {
- "mime_type": "application/octet-stream",
- "description": "data"
}
}| filename required | string (WindowsCompatibleFilename) <= 310 characters ^[^/\0]+$ UTF-8 encoded filename. Note: This API intentionally accepts filenames that violate standard Windows filesystem constraints. It allows up to 310 characters (exceeding the 260-character MAX_PATH) and does not restrict Windows-reserved characters, as the underlying platform is Linux. |
| path required | string (RelativePath) ^(?!\/)(?!.*(\.\.|\.\/|\/\/))(?!\.$)[^ ].*$ Relative path (no traversal allowed). |
{- "request_id": "550e8400-e29b-41d4-a716-446655440000",
- "filename": "example_file.dat",
- "result": {
- "mime_type": "application/octet-stream",
- "description": "data"
}
}