{
  "openapi": "3.1.1",
  "info": {
    "title": "EXIF Inspector & Cleaner API",
    "version": "1.0.0",
    "summary": "See all photo metadata (EXIF, GPS, XMP, IPTC, MakerNotes) and download a cleaned copy.",
    "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://exifinspectorcleaner.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "See all photo metadata (EXIF, GPS, XMP, IPTC, MakerNotes) and download a cleaned copy.",
        "description": "Lists every metadata tag in a photo, grouped into EXIF, GPS, XMP, IPTC, MakerNotes and colour profile, and warns when the picture reveals where it was taken. Creates a cleaned copy without re-compressing the image: remove everything, only the GPS location, or everything except orientation and colour profile, then checks the cleaned file to prove it.\n\nMethodology:\n- exiftool reads every metadata block (-a -G0:1). Tags are grouped by where they live: EXIF (IFD0/ExifIFD), GPS (the GPS IFD plus XMP GPS tags), XMP, IPTC, MakerNotes (manufacturer data such as serial numbers), the ICC colour profile and file structure. Server-side file system entries (temporary names, dates) are not shown.\n- GPS coordinates are shown as decimal degrees so you can see what others could see. No map service is contacted.\n- Cleaning edits the metadata only; the compressed image data is copied unchanged (no re-encoding, no quality loss). \"Remove all\" deletes every writable tag (including the colour profile); \"Only GPS\" deletes the GPS IFD and all GPS* tags; \"Keep orientation and colour profile\" deletes everything, then copies back Orientation and the colour-space tags (ICC profile, ColorSpace).\n- Verification re-reads the cleaned file with exiftool and counts remaining tags per group; for JPG, PNG, WebP, GIF and TIFF ImageMagick also compares a hash of the decoded pixels before and after.\n- RAW files are inspect-only: deleting their metadata can make them undecodable.\n\nMetadata is only one way photos leak information: faces, street signs and reflections in the picture itself are not removed.",
        "tags": [
          "media"
        ],
        "x-mcp-tool": "exif_inspector_cleaner",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExifInspectorCleanerInput"
              },
              "examples": {
                "example1": {
                  "summary": "JPEG with camera and GPS tags → remove all",
                  "value": {
                    "file": {
                      "filename": "holiday.jpg",
                      "contentType": "image/jpeg",
                      "contentBase64": "/9j/4AAQSkZJRgABAQAAAAAAAAD/4QFgRXhpZgAATU0AKgAAAAgACAEPAAIAAAALAAAAbgEQAAIAAAAFAAAAegEaAAUAAAABAAAAgAEbAAUAAAABAAAAiAEoAAMAAAABAAEAAAITAAMAAAABAAEAAIdpAAQAAAABAAAAkIglAAQAAAABAAAA5gAAAABFeGFtcGxlQ2FtAABYMTAwAAAAAAAAAAAAAQAAAAAAAAABAAWQAAAHAAAABDAyMzKQAwACAAAAFAAAANKRAQAHAAAABAECAwCgAAAHAAAABDAxMDCgAQADAAAAAf//AAAAAAAAMjAyNDowNTowMSAxMjowMDowMAAABQAAAAEAAAAEAgMAAAABAAIAAAACTgAAAAACAAUAAAADAAABKAADAAIAAAACRQAAAAAEAAUAAAADAAABQAAAAAAAAAAwAAAAAQAAAAgAAAABAAAAQgAAAAUAAAALAAAAAQAAACIAAAABAAAAHgAAAAH/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAABf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKoBga//2Q=="
                    },
                    "action": "all"
                  }
                },
                "example2": {
                  "summary": "Remove only the GPS location",
                  "value": {
                    "file": {
                      "filename": "holiday.jpg",
                      "contentType": "image/jpeg",
                      "contentBase64": "/9j/4AAQSkZJRgABAQAAAAAAAAD/4QFgRXhpZgAATU0AKgAAAAgACAEPAAIAAAALAAAAbgEQAAIAAAAFAAAAegEaAAUAAAABAAAAgAEbAAUAAAABAAAAiAEoAAMAAAABAAEAAAITAAMAAAABAAEAAIdpAAQAAAABAAAAkIglAAQAAAABAAAA5gAAAABFeGFtcGxlQ2FtAABYMTAwAAAAAAAAAAAAAQAAAAAAAAABAAWQAAAHAAAABDAyMzKQAwACAAAAFAAAANKRAQAHAAAABAECAwCgAAAHAAAABDAxMDCgAQADAAAAAf//AAAAAAAAMjAyNDowNTowMSAxMjowMDowMAAABQAAAAEAAAAEAgMAAAABAAIAAAACTgAAAAACAAUAAAADAAABKAADAAIAAAACRQAAAAAEAAUAAAADAAABQAAAAAAAAAAwAAAAAQAAAAgAAAABAAAAQgAAAAUAAAALAAAAAQAAACIAAAABAAAAHgAAAAH/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAABf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKoBga//2Q=="
                    },
                    "action": "gps"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExifInspectorCleanerResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "ExifInspectorCleanerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "file": {
            "title": "Photo",
            "description": "JPG, PNG, WebP, TIFF, HEIC, AVIF or GIF (RAW files can be inspected but not cleaned), max 50 MB. Upload as {filename, contentType?, contentBase64}. Max 51200 KiB. Accepts .jpg,.jpeg,.png,.webp,.tif,.tiff,.heic,.heif,.avif,.gif,.dng,.cr2,.cr3,.nef,.arw,.orf,.rw2,.raf,image/*.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "action": {
            "title": "What to do",
            "type": "string",
            "enum": [
              "all",
              "gps",
              "keep-essential",
              "inspect"
            ],
            "default": "all"
          }
        },
        "required": [
          "file"
        ]
      },
      "ExifInspectorCleanerResult": {
        "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": [
              "fileType",
              "tagCount",
              "groups",
              "tags",
              "tagsTruncated",
              "gps",
              "privacyTags",
              "action",
              "cleaned"
            ],
            "properties": {
              "fileType": {
                "type": "string"
              },
              "tagCount": {
                "type": "integer",
                "description": "Metadata tags in EXIF, GPS, XMP, IPTC and MakerNotes."
              },
              "groups": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "group",
                    "source",
                    "tag",
                    "value"
                  ],
                  "properties": {
                    "group": {
                      "type": "string",
                      "enum": [
                        "GPS",
                        "EXIF",
                        "XMP",
                        "IPTC",
                        "MakerNotes",
                        "ICC_Profile",
                        "File",
                        "Other"
                      ]
                    },
                    "source": {
                      "type": "string"
                    },
                    "tag": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              },
              "tagsTruncated": {
                "type": "boolean"
              },
              "gps": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "latitude",
                  "longitude",
                  "altitude"
                ],
                "properties": {
                  "latitude": {
                    "type": "number"
                  },
                  "longitude": {
                    "type": "number"
                  },
                  "altitude": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                }
              },
              "privacyTags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "action": {
                "type": "string",
                "enum": [
                  "inspect",
                  "all",
                  "gps",
                  "keep-essential"
                ]
              },
              "cleaned": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "artifact",
                  "remainingTags",
                  "remainingGroups",
                  "gpsRemaining",
                  "pixelsUnchanged",
                  "verified"
                ],
                "properties": {
                  "artifact": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  },
                  "remainingTags": {
                    "type": "integer"
                  },
                  "remainingGroups": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  "gpsRemaining": {
                    "type": "integer"
                  },
                  "pixelsUnchanged": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Decoded pixel hash equal before/after (null when not checked)."
                  },
                  "verified": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}