---
title: Detect File type API
slug: detect-file-type
url: https://apyhub.com/dosvak/service/detect-file-type
provider: Dosvak LLC
categories: [Data Validation, Developer Tools, File Security]
tags: [file-type, mime-detection, magic-bytes, upload-validation, file-classification]
auth: api_key
---

# Detect File type API

Inspect a binary file's magic bytes to return filename, extension, MIME type, and description. Useful for validating uploads and classifying files reliably.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `` | What it does Detects the true file type of an uploaded file by inspecting its binary contents and r… | 10 |

## About

## What it does
File Type Detection checks the true MIME type of a file by inspecting its magic bytes, rather than trusting the filename or extension. Send a binary file in the `file` field and get back the detected `filename`, `extension`, `mime_type`, and a short `description` of the file type.

Use it when uploaded files may have misleading names, missing extensions, or incorrect client-side metadata. It helps you validate user uploads before storage, route files into the right processing pipeline, or reject unsupported formats early in your workflow.

The response is simple and predictable: you get the original filename when available, the inferred extension when one can be determined, the MIME type, and a human-readable description. That makes it easy to compare what a client claims a file is versus what it actually contains.

File Type Detection is a good fit for upload forms, document ingestion systems, security checks, and any backend that needs to classify files reliably without opening them in a full parser.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/detect-file-type
