About this endpoint
What it does
Maps a filename or extension to its MIME type, or performs the reverse lookup when requested. The request body accepts the input value as filename and an optional mode to choose forward or reverse mapping.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| mode | String | No | forward (default) or reverse. |
| filename | String | Yes | A filename, extension, or, in reverse mode, a MIME type. |
Response
Returns a JSON object with the resolved MIME type and extension, whether the type is recognized, and its text, charset, and encoding characteristics.
| Field | Type | Description |
|---|---|---|
mode | String | The lookup mode used to process the request. |
input | String | The value provided in the request, such as a filename, file extension, or MIME type. |
extension | String | The file extension extracted from the input or associated with the lookup result. |
mime_type | String | The MIME type corresponding to the provided file extension or filename. |
known | Boolean | Indicates whether the extension or MIME type is recognized by the API. |
is_text | Boolean | Indicates whether the resolved MIME type represents a text-based format. |
charset | String | The default character encoding for text-based MIME types, if available. |
encoding | String | The content encoding associated with the resolved file type, if applicable. |
canonical_extension | String | The standard or preferred file extension for the resolved MIME type. |



