HTTP wrapper for google/magika, multi-arch support and periodic rebuilds
2.9K
HTTP wrapper for Google Magika — AI-powered file-type detection.
Send any file to this service over HTTP and get back accurate content-type information powered by Magika's deep-learning model (~99% accuracy across 200+ content types).
Source: github.com/jjaniec/magika-http
| Tag | Description |
|---|---|
latest | Most recent build |
<magika-version> (e.g. 1.0.2) | Build pinned to that Magika release |
Images are rebuilt automatically every Sunday at midnight UTC to pick up OS and dependency updates.
docker run -p 8080:8080 jjaniec/magika-http
curl -X POST http://localhost:8080/scan \
-F "file=@/path/to/your/file"
{
"ok": true,
"label": "python",
"mime_type": "text/x-python",
"group": "code",
"description": "Python source",
"extensions": ["py", "pyi"],
"is_text": true,
"score": 0.997,
"scan_duration_ms": 3.142
}
curl http://localhost:8080/healthz
{
"status": "ok",
"model_ready": true,
"model_version": "standard_v3_3",
"magika_version": "1.0.2"
}
| Method | Path | Description |
|---|---|---|
GET | /healthz | Health check — confirms the model is loaded and ready |
POST | /scan | Identify the content type of an uploaded file |
GET | /docs | Interactive Swagger UI |
GET | /redoc | ReDoc API documentation |
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Port the server listens on |
HOST | 0.0.0.0 | Host the server binds to |
OTEL_SERVICE_NAME | magika-http | OpenTelemetry service name |
OTEL_EXPORTER_OTLP_ENDPOINT | (empty) | OTLP gRPC collector endpoint. When unset, spans are printed to stdout |
OTEL_SDK_DISABLED | false | Set to true to disable all OpenTelemetry tracing (suppresses console output when no collector is configured) |
docker run -p 8080:8080 \
-e OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 \
-e OTEL_SERVICE_NAME=magika-http \
jjaniec/magika-http
magika.scan span — emitted on every /scan call with attributes:
file.name, file.size_bytesmagika.scan_duration_ms — inference time in millisecondsmagika.result.label, magika.result.mime_type, magika.result.scoreContent type
Image
Digest
sha256:daefa82fd…
Size
138.5 MB
Last updated
about 1 month ago
docker pull jjaniec/magika-http