Skip to content

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.

Base URL No key required
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

GET /{extension}

Retrieve signature data for a specific file extension.

Parameters

  • extension (string, required) - The file extension, for example pdf or png.

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": "..."
    }
  }
}
GET /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.

Browse all extensions →