# MIME Type Lookup API

> MIME Type Lookup matches file extensions to MIME types, categories, and default character encodings, or returns matching extensions for any media type. Paid plans add gzip compressibility flags, the registry that defines each type (IANA, Apache or nginx), and every extension sharing that type.

**Endpoint:** `GET https://api.apiverve.com/v1/mimetypelookup`  
**Category:** Reference Data  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/mimetypelookup

## Overview

A MIME type and file extension lookup API, for example the MIME type for JSON or the extensions behind image/png. MIME Type Lookup works by searching the mime-db database, which merges the IANA, Apache and nginx type lists. Returns category and default charset for an extension or MIME type, with the defining source and all associated extensions on paid plans, and accepts a full Content-Type header value such as text/html; charset=utf-8.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/mimetypelookup?extension=pdf" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `extension` | string | Yes | File extension to lookup (without the leading dot) |

## Response fields

- `count` — number · Number of results found
  - `results.0.extension` — string · File extension without the leading dot character
  - `results.0.mimeType` — string · Standard MIME type associated with the file extension
  - `results.0.category` — string · File category classification such as document, image, video, audio, archive, or text
  - `results.0.charset` — object · Default character encoding for the MIME type (e.g., UTF-8) or null
  - `results.0.compressible` — boolean · Whether the content type can be gzip compressed · (premium)
  - `results.0.source` — string · Registry that defines the MIME type: iana, apache or nginx, or null for a custom type · (premium)
  - `results.0.extensions` — array · Every file extension registered for this MIME type, including the one looked up · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "count": 1,
    "results": [
      {
        "extension": "jpg",
        "mimeType": "image/jpeg",
        "category": "image",
        "charset": null,
        "compressible": false,
        "source": "iana",
        "extensions": [
          "jpg",
          "jpeg",
          "jpe"
        ]
      }
    ]
  }
}
```

## Use cases

- **File Upload Handling** — Validate and identify file types during file upload processing in web applications
- **Content-Type Headers** — Set correct Content-Type headers for HTTP responses based on file extensions
- **File Processing** — Determine how to process files based on their MIME type in data pipelines
- **API Development** — Configure proper content type handling in REST APIs and file serving endpoints

## SDKs

- **npm** — `npm install @apiverve/mimetypelookup` (https://www.npmjs.com/package/@apiverve/mimetypelookup)
- **NuGet** — `dotnet add package APIVerve.API.MIMETypeLookup` (https://www.nuget.org/packages/APIVerve.API.MIMETypeLookup)
- **Source** — https://github.com/apiverve/mimetypelookup-api

## More

- Full reference: https://docs.apiverve.com/ref/mimetypelookup
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
