{
  "openapi": "3.1.1",
  "info": {
    "title": "FileFit API",
    "version": "1.0.0",
    "summary": "Can this app open, edit or convert that file format? Verified facts with sources.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://filefit.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Can this app open, edit or convert that file format? Verified facts with sources.",
        "description": "A compatibility graph of common document, image, video and audio formats against office apps, browsers, operating-system viewers and conversion tools. Every fact links to the vendor or caniuse source it was taken from, with its verification date; conversion paths are found by graph search.\n\nMethodology:\n- Facts come only from the cited vendor documentation or the caniuse dataset, transcribed on the verification date; \"not-listed\" means absent from the vendor list, not proven unsupported.\n- Capabilities = all facts for the chosen format, filtered by application and operation.\n- Conversion: an app that can open/read format A and export/write format B creates an edge A→B; the shortest path is found by breadth-first search; among equally short paths the one with fewer partial-support facts and documented caveats wins.",
        "tags": [
          "developer"
        ],
        "x-mcp-tool": "filefit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilefitInput"
              },
              "examples": {
                "example1": {
                  "summary": "HEIC photos everywhere",
                  "value": {
                    "format": "heic",
                    "target": "any",
                    "operation": "any"
                  }
                },
                "example2": {
                  "summary": "Pages → Word",
                  "value": {
                    "format": "pages",
                    "target": "fmt:docx",
                    "operation": "convert"
                  }
                },
                "example3": {
                  "summary": "ODT in Microsoft Word",
                  "value": {
                    "format": "odt",
                    "target": "app:word",
                    "operation": "any"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilefitResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FilefitInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "format": {
            "title": "File format",
            "type": "string",
            "enum": [
              "docx",
              "doc",
              "odt",
              "rtf",
              "txt",
              "html",
              "pdf",
              "epub",
              "pages",
              "xlsx",
              "xls",
              "heic",
              "avif",
              "webp",
              "jxl",
              "jpeg",
              "png",
              "tiff",
              "gif",
              "mp4-h264",
              "webm",
              "ogv",
              "hevc",
              "av1",
              "mov",
              "mkv",
              "avi",
              "mp3",
              "flac",
              "opus",
              "wav",
              "ogg"
            ],
            "default": "heic"
          },
          "target": {
            "title": "Application, or format to convert to",
            "type": "string",
            "enum": [
              "any",
              "app:word",
              "app:lo-writer",
              "app:lo-calc",
              "app:google-docs",
              "app:pages",
              "app:chrome",
              "app:edge",
              "app:firefox",
              "app:safari",
              "app:windows-photos",
              "app:apple-devices",
              "app:imagemagick",
              "app:ffmpeg",
              "fmt:docx",
              "fmt:doc",
              "fmt:odt",
              "fmt:rtf",
              "fmt:txt",
              "fmt:html",
              "fmt:pdf",
              "fmt:epub",
              "fmt:pages",
              "fmt:xlsx",
              "fmt:xls",
              "fmt:heic",
              "fmt:avif",
              "fmt:webp",
              "fmt:jxl",
              "fmt:jpeg",
              "fmt:png",
              "fmt:tiff",
              "fmt:gif",
              "fmt:mp4-h264",
              "fmt:webm",
              "fmt:ogv",
              "fmt:hevc",
              "fmt:av1",
              "fmt:mov",
              "fmt:mkv",
              "fmt:avi",
              "fmt:mp3",
              "fmt:flac",
              "fmt:opus",
              "fmt:wav",
              "fmt:ogg"
            ],
            "default": "any"
          },
          "operation": {
            "title": "What do you want to do?",
            "type": "string",
            "enum": [
              "any",
              "open",
              "edit",
              "export",
              "display",
              "play",
              "convert"
            ],
            "default": "any"
          }
        },
        "required": []
      },
      "FilefitResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "format",
              "capabilities",
              "conversion",
              "factsVerifiedOn"
            ],
            "properties": {
              "format": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "name",
                  "extensions"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "extensions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "factsVerifiedOn": {
                "type": "string"
              },
              "capabilities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "factId",
                    "app",
                    "appName",
                    "operation",
                    "support",
                    "caveat",
                    "since",
                    "source"
                  ],
                  "properties": {
                    "factId": {
                      "type": "string"
                    },
                    "app": {
                      "type": "string"
                    },
                    "appName": {
                      "type": "string"
                    },
                    "operation": {
                      "type": "string"
                    },
                    "support": {
                      "type": "string",
                      "enum": [
                        "yes",
                        "partial",
                        "requires-extension",
                        "no",
                        "not-listed"
                      ]
                    },
                    "caveat": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "since": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "title",
                        "url",
                        "retrievedAt"
                      ],
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "retrievedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "conversion": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "to",
                  "found",
                  "steps",
                  "directAlternatives"
                ],
                "properties": {
                  "to": {
                    "type": "string"
                  },
                  "found": {
                    "type": "boolean"
                  },
                  "directAlternatives": {
                    "type": "array",
                    "description": "Every single-app conversion, best fidelity first",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "app",
                        "facts",
                        "cost"
                      ],
                      "properties": {
                        "app": {
                          "type": "string"
                        },
                        "facts": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "cost": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "from",
                        "to",
                        "app",
                        "facts"
                      ],
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "app": {
                          "type": "string"
                        },
                        "facts": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}