Docs/Image Utils/GET /v1/format-detect

GET /v1/format-detectDetect image format

Image Utils lf-image-utils

Tells you what kind of file something really is, even when the file name lies. Detects image/video/document format from magic bytes. Supports JPEG, PNG, GIF, WebP, BMP, TIFF, SVG, ICO, HEIC, AVIF, and PDF.

Query Parameters

ParameterTypeRequiredDescription
datastringYesBase64 data, hex bytes, or URL

Response Schema

success (boolean): Operation success
source (string): Source type
formats (array): Detected formats
image_size (integer): Size in bytes
content_type (string): Detected MIME type

cURL Example

curl 'https://lf-image-utils.laminarforge.dev/v1/format-detect?data=<data>' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-image-utils.laminarforge.dev/v1/format-detect'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'data': '<data>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())