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

ParameterTypeRequiredDescription
valuestringYesMIME 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

FieldTypeDescription
validbooleanWhether the value is a registered MIME type
mimestringCanonical MIME type string
typestringTop-level type (e.g. application, image, text)
subtypestringSubtype (e.g. json, png, html)
extensionsstring[]Associated file extensions (without dot)
compressibleboolean | nullWhether the content is compressible
charsetstring | nullDefault charset (e.g. UTF-8)
sourcestring | nullRegistration 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

ParameterTypeRequiredDescription
valuestringYesFile 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

FieldTypeDescription
validbooleanWhether any MIME type is associated with this extension
extensionstringNormalized extension (without dot)
mimeTypesobject[]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

ParameterTypeRequiredDescription
typestringNoFilter 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

FieldTypeDescription
mimestringMIME type string
typestringTop-level type
subtypestringSubtype
extensionsstring[]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"] },
  ...
]