REST API
File Signature API Documentation
Retrieve magic bytes, MIME types, byte offsets, risk levels, and generated validation code from the same data that powers the HTML reference pages.
https://filesignature.org/api/v1
Example request
curl https://filesignature.org/api/v1/pdf
Quick Start
1. Request an extension
Use a lowercase extension such as pdf or docx.
2. Read the primary signature
The response includes the primary hex bytes, offset, MIME types, related formats, and code snippets.
3. Use autocomplete when needed
Call /suggest to power search boxes and extension lookup flows.
Endpoints
/{extension}
Retrieve signature data for a specific file extension.
Parameters
extension(string, required) - The file extension, for examplepdforpng.
Response
{
"success": true,
"data": {
"ext": "pdf",
"name": "Adobe Portable Document Format",
"mime": "application/pdf",
"hex": "25 50 44 46 2D",
"offset": 0,
"usage": {
"python": "...",
"node": "..."
}
}
}
/suggest
Return autocomplete suggestions for extension prefixes.
Parameters
q(string, required) - Search query with at least 2 characters.
Response
{
"suggestions": [
"tar",
"targa"
]
}
Errors
API errors return success: false with a short message describing what to fix next.
{
"success": false,
"error": "Extension not found"
}
Try It
Start with common extensions, then move into the full directory when you need something less common.