MIME detect
Try it interactively →POST /api/mime-detectIdentify a file by its magic-byte signature. Returns the MIME type and canonical extension. Recognises common image / audio / video / archive / document formats.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| data* | file | — | File bytes (any format). |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the jpeg-fixture example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/image-resize-jpeg/sample.jpg
DATA=$(base64 -w0 < sample.jpg)
curl -X POST https://api.xtract.bot/api/mime-detect \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"data": "'"$DATA"'"
}'