# File Format Inspector – Magic Bytes Identifier

> File Format Inspector – Magic Bytes Identifier is a paid API for AI agents from file-formats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Identifies a file's type from its first bytes (magic bytes) by matching against 40+ signatures including PNG, JPEG, PDF, ZIP, ELF, EXE, MP4, and SQLite.

## Facts

- Endpoint: GET https://file-formats.x402tookit.com/magic-bytes?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/file-format-inspector-magic-bytes-identifier-e7bdf17d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b2OsqGgrVm6ZfvgMkM6_u

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability file-format-inspector-magic-bytes-identifier-e7bdf17d
```

Example prompt: I have these hex bytes from the start of a file — '89504e470d0a1a0a' — can you identify what file format this is, including the MIME type and typical extensions?

## When to prefer this

Use this endpoint when you need to programmatically determine a file's true format from its raw bytes rather than relying on file extensions or metadata. Ideal for security pipelines (detecting disguised executables), upload validation, forensic file recovery, and content routing. Prefer this over extension-checking when the file extension may be missing, incorrect, or untrusted. The sibling endpoints on this host offer deeper parsing for specific formats (PNG dimensions, JPEG markers, etc.) — use this one first for broad identification across 40+ types.

## Known failure modes

- Too few bytes provided — fewer than the minimum required for any signature match returns null fields or low-confidence result
- Unrecognized format — no matching signature returns null MIME and type with an empty matches array
- Malformed hex input — non-hex characters beyond allowed separators (spaces, colons, hyphens) may cause an error
- Ambiguous header — some formats share early bytes, resulting in multiple matches with no single verdict
- Service unavailable or payment failure — returns HTTP error with no file type data

## How this service works

Identify a file type from the first bytes (hex): PNG, JPEG, PDF, ZIP, ELF, EXE, MP4, SQLite and 40+ more signatures.

## Output

Returns the detected MIME type, human-readable file type name, file category, a list of all matching signatures with their MIME types and categories, usual file extensions, a plain-language verdict and summary, the number of bytes examined, and flags for degraded confidence or unchecked signatures.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "description": "First bytes of the file as hex, up to 512 bytes (1024 hex digits); spaces, colons and hyphens allowed"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "mime": {
       "type": [
        "null",
        "string"
       ]
      },
      "type": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "matches": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "mime": {
          "type": [
           "null",
           "string"
          ]
         },
         "type": {
          "type": [
           "null",
           "string"
          ]
         },
         "category": {
          "type": [
           "null",
           "string"
          ]
         }
        }
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "category": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "bytesExamined": {
       "type": [
        "null",
        "number"
       ]
      },
      "firstBytes
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/file-format-inspector-magic-bytes-identifier-e7bdf17d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from file-formats.x402tookit.com](https://www.zero.xyz/host/file-formats.x402tookit.com/llms.txt)
