MIME Type
GET/v0/mime-type
Validates a MIME type (media type) string against the IANA media type registry. Input is case-insensitive and optional parameters (e.g. ;charset=utf-8) are stripped before lookup. When valid, returns the type, subtype, associated file extensions, compressibility, and charset.
Try it
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | MIME type string, case-insensitive (e.g. application/json, image/png, text/html;charset=utf-8) |
Example Requests
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/mime-type?value=application/json"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the value is a registered MIME type |
| mime | string | Canonical MIME type string |
| type | string | Top-level type (e.g. application, image, text) |
| subtype | string | Subtype (e.g. json, png, html) |
| extensions | string[] | Associated file extensions (without dot) |
| compressible | boolean | null | Whether the content is compressible |
| charset | string | null | Default charset (e.g. UTF-8) |
| source | string | null | Registration source (iana, apache, nginx) |
Example Response
{
"valid": true,
"mime": "application/json",
"type": "application",
"subtype": "json",
"extensions": ["json", "map"],
"compressible": true,
"charset": "UTF-8",
"source": "iana"
}Example Response — invalid
{
"valid": false
}GET/v0/mime-type/ext
Looks up MIME types by file extension. The leading dot is optional (both .json and json are accepted). Some extensions map to multiple MIME types (e.g. js maps to both application/javascript and text/javascript).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | File extension, with or without leading dot (e.g. json, .png, html) |
Example Requests
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/mime-type/ext?value=json"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether any MIME type is associated with this extension |
| extension | string | Normalized extension (without dot) |
| mimeTypes | object[] | Array of matching MIME types with full details |
Example Response
{
"valid": true,
"extension": "json",
"mimeTypes": [
{
"mime": "application/json",
"type": "application",
"subtype": "json",
"extensions": ["json", "map"],
"compressible": true,
"charset": "UTF-8",
"source": "iana"
}
]
}Example Response — not found
{
"valid": false,
"extension": "xyz123"
}GET/v0/mime-type/list
Returns the complete list of all 2,500+ registered MIME types with their type, subtype, and associated file extensions. Optionally filter by top-level type.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | No | Filter by top-level type, case-insensitive (e.g. image, application, text) |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/mime-type/list?type=image"
Object Fields
| Field | Type | Description |
|---|---|---|
| mime | string | MIME type string |
| type | string | Top-level type |
| subtype | string | Subtype |
| extensions | string[] | Associated file extensions |
Example Response
[
{ "mime": "application/json", "type": "application", "subtype": "json", "extensions": ["json", "map"] },
{ "mime": "image/png", "type": "image", "subtype": "png", "extensions": ["png"] },
{ "mime": "text/html", "type": "text", "subtype": "html", "extensions": ["html", "htm", "shtml"] },
...
]