
MIME Lookup API
Development
Quickly find MIME types and content types for any file extension. Essential tool for developers, webmasters, and system administrators.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
120 requests per minute
Endpoints
2 endpoints available
Overview
Looks up the MIME type and the Content-Type header value for a file extension, file name or path, using the mime-types database. Nothing is read from a file; only the extension in the text you send is used.
Behavior
- Accepts an extension with or without the dot (
png,.png) or a name or path (report.final.pdf). - Matching is case-insensitive.
- An unknown extension is not an error: you get
found: falseand null values. contentTypeadds a charset for text types, for exampletext/html; charset=utf-8.
Endpoints
GET
https://opentools.ca/api/v1/tools/mime-lookupLook up a MIME type
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | string | Required | File extension, file name or path, 1 to 500 characters. |
Response Example
{
"success": true,
"filename": "index.html",
"found": true,
"mimeType": "text/html",
"contentType": "text/html; charset=utf-8"
}Error Codes
400
Bad Request - Missing or too long filename401
Unauthorized - Invalid or missing API key403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorPOST
https://opentools.ca/api/v1/tools/mime-lookupLook up a MIME type (JSON body)
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | string | Required | File extension, file name or path, 1 to 500 characters. |
Response Example
{
"success": true,
"filename": "archive.xyz123",
"found": false,
"mimeType": null,
"contentType": null
}Error Codes
400
Bad Request - Missing or too long filename401
Unauthorized - Invalid or missing API key403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl "https://opentools.ca/api/v1/tools/mime-lookup?filename=index.html" -H "Authorization: Bearer YOUR_API_KEY"
curl -X POST https://opentools.ca/api/v1/tools/mime-lookup -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"filename": "photo.webp"}'Rather use it in your browser? Open the MIME Lookup