← Back to blog

Remove EXIF Metadata from Images: Free API for AI Agents

August 30, 2026 · Eric · 5 min read

Every JPEG and PNG your camera, phone, or screenshot tool produces can carry a hidden passenger: EXIF metadata. That invisible data may include your GPS coordinates, camera make and model, lens settings, software version, and exact timestamps. When you upload an original photo to a service, an archive, or an AI pipeline, that metadata travels with it — and it is one of the easiest ways to leak someone's location without meaning to.

If you build agents or scripts that handle images, stripping EXIF is a useful privacy step before sharing. This guide shows how to remove embedded metadata with one free API call using curl or Python requests, and how to make it part of an automated privacy workflow. No signup, API key, or credit card is required for the REST endpoint, within the site's free-use limits.

What EXIF data is actually in your images?

EXIF (Exchangeable Image File Format) is a metadata standard that cameras and phones write into image files at capture time. A typical photo can contain:

Social platforms usually strip this data on upload, which makes people think it is harmless. But the original file keeps everything. If your agent downloads a user's photo and re-uploads it elsewhere, or stores it in a bucket that gets shared, the GPS coordinates are still sitting in the header. For privacy-sensitive work — user-uploaded content, journalism, compliance, or just good hygiene — the safe move is to remove EXIF before the image goes anywhere.

The one-call solution: POST /api/strip-exif

Agent Media Tools exposes a dedicated endpoint that re-encodes an image without its metadata. Internally it runs the image through Sharp's rotate() pass and re-encodes with metadata dropped, which means you get a clean file and correct orientation baked in — a photo that was stored with an EXIF rotation flag comes out already upright.

The endpoint accepts either a multipart upload (field name image) or a publicly reachable image URL passed as url. Two optional parameters control the output:

ParameterDefaultNotes
formatpngOutput format; jpg is normalized to jpeg, or pass webp
quality90Re-encode quality (1–100)

The response returns stripped: true, a filename, the byte size, and a downloadUrl under /downloads/ that you can fetch immediately.

Strip EXIF with curl

Uploading a local file is a single -F flag:

curl -F "image=@vacation.jpg" \
     -F "format=jpeg" \
     https://agentmediatools.com/api/strip-exif

Example response:

{
  "success": true,
  "filename": "7f3c1d9e-2b4a-4c8f-9d0e-1a2b3c4d5e6f.jpg",
  "downloadUrl": "/downloads/7f3c1d9e-2b4a-4c8f-9d0e-1a2b3c4d5e6f.jpg",
  "size": 184320,
  "stripped": true
}

To fetch the cleaned image right away, chain the URL with jq:

curl -F "image=@vacation.jpg" \
     https://agentmediatools.com/api/strip-exif \
  | jq -r '.downloadUrl' \
  | xargs -I{} curl -s "https://agentmediatools.com{}" -o clean.jpg

No local file? Point the API at a public URL instead:

curl -X POST https://agentmediatools.com/api/strip-exif \
     -H "Content-Type: application/json" \
     -d '{"url": "https://example.com/uploads/photo.jpg", "format": "webp"}'

Both url, image_url, and file_url are accepted as body fields, and ?url= works as a query parameter too.

Strip EXIF with Python requests

In Python, the multipart version mirrors curl exactly:

import requests

with open("vacation.jpg", "rb") as f:
    r = requests.post(
        "https://agentmediatools.com/api/strip-exif",
        files={"image": ("vacation.jpg", f)},
        data={"format": "jpeg", "quality": 90},
    )
r.raise_for_status()
result = r.json()
print(result["stripped"], result["downloadUrl"])

# Save the cleaned image
clean = requests.get("https://agentmediatools.com" + result["downloadUrl"])
with open("vacation-clean.jpg", "wb") as out:
    out.write(clean.content)

For URL-based stripping:

import requests

r = requests.post(
    "https://agentmediatools.com/api/strip-exif",
    json={"url": "https://example.com/uploads/photo.jpg"},
)
print(r.json())  # {'success': True, 'downloadUrl': ..., 'stripped': True}

Using the MCP tools: strip_exif and analyze_image

If your agent runs over MCP, the server exposes a strip_exif tool with an image_url argument and optional format. It wraps the same endpoint. You can also call analyze_image first to inspect dimensions, format, size, and available image metadata before processing.

Claude users can wire this up in a few minutes; see the Claude MCP setup guide for the exact steps.

A privacy-first pipeline for agents

The endpoint is designed to slot into automated workflows. A typical agent-side pipeline looks like this:

Step 1

Download or receive the original image.

Step 2

POST it to /api/strip-exif (upload or URL).

Step 3

Fetch the downloadUrl and store, publish, or forward only the cleaned copy.

Because the API re-encodes rather than editing metadata offsets in place, the output is a fresh image file. You can then chain it with tools like watermarking, background removal, or compression. If a later tool adds metadata of its own, inspect the final output again before publishing.

When should you strip EXIF?

If you need the opposite operation — inspecting what metadata is present — use analyze_image in the toolbox or via the API first. Stripping is destructive; the original file is gone once you replace it, so keep a copy if you might need the metadata later.

Free, no account required

The /api/strip-exif endpoint is available without an account or API key — the toolbox calls it directly, and so can you. That makes it a cheap, dependable building block for scripts and agents. For higher-volume or paid tooling needs, the rest of the catalog (background removal, image generation, video, and the paid intelligence tools) uses the standard agent API key flow, but EXIF stripping stays a free utility.

Next time your agent touches an image, strip the metadata first. It's one request, it's free, and it closes a privacy hole most pipelines never think about.

Try it in the Toolbox

Run the same tools in the browser, or call them from your agent with an API key.

Open toolbox