API-dokumentation
Udtræk metadata fra filer ved hjælp af vores enkle og kraftfulde API. Kom i gang med din API-nøgle og begynd at analysere filer programmatisk.
Autentificering
Send your API key with every request, in one of two ways:
1. I anmodningshovedet:
X-API-Key: YOUR_API_KEY_HERE
2. Som en forespørgselsparameter:
?key=YOUR_API_KEY_HERE
Results you create are private to your account until you share them (see Share Results). Shared results, and results from before October 28, 2026, can still be read without a key for now, but that is deprecated and will be removed. The downloadUrl of Remove Metadata needs no key.
Udtræk Metadata
https://exiftools.com/api/v1/extract
Extract metadata from a file using a direct file upload, a URL, or a base64 data URL. Results are returned in the same response when processing finishes within a few seconds; otherwise the API answers 202 with a statusUrl to poll.
Anmodningsparametre
{
"file": "binary_file_data", // Option 1: direct file upload
"url": "https://example.com/image.jpg", // Option 2: URL. Can be passed as POST body or query string parameter
"data_url": "data:image/jpeg;base64,/9j/4AAQ..." // Option 3: base64 data URL
// Provide exactly one of the above
}
Eksempel Svar
{
"success": true,
"status": "completed",
"fileName": "image.jpg",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"processedAt": "2026-03-15T10:31:02+00:00",
"author": "John Doe", // author, createDate, dimensions, cameraModel: only when the file has them
"createDate": "2026-03-15 10:30:00",
"fileSize": "4.2 MB",
"fileSizeBytes": 4404019,
"mimeType": "image/jpeg",
"dimensions": "8192x5464",
"cameraModel": "Canon EOS R5",
"metadata": {
"File": {
"FileType": "JPEG",
"MIMEType": "image/jpeg",
"FileSize": "4.2 MB",
"ImageWidth": 8192,
"ImageHeight": 5464,
"SHA256": "a5e50cbe66078249973d9a71230c4a8edbaedc26af11204042d3bce1f9ed4409"
},
"EXIF": {
"Make": "Canon",
"Model": "Canon EOS R5",
"DateTimeOriginal": "2026:03:15 10:30:00",
"ExposureTime": "1/1000",
"FNumber": 2.8,
"ISO": 100
},
"IPTC": {
"By-line": "John Doe",
"CopyrightNotice": "© 2026 John Doe"
}
// ... more groups: XMP, GPS, ICC_Profile, MakerNotes, Composite…
}
}
Svaret har de samme felter som Hent Udtrækningsresultater. PDF- og Office-filer får også en embedded-blok, som som regel stadig er "pending" lige efter upload: hent resultatet igen et par sekunder senere for at se filerne (se Indlejrede filer).
Example Response (Still Processing)
{
"success": true,
"status": "processing",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"statusUrl": "https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000",
"message": "Still processing — poll statusUrl."
}
Answered with HTTP 202 when the file takes longer to process. Get statusUrl until status is completed or failed.
Example Response (Failed)
{
"success": false,
"status": "failed",
"message": "Processing failed.",
"fileName": "image.jpg"
}
Answered with HTTP 422 when the url could not be downloaded, otherwise 500.
Fejlsvar
{
"success": false,
"error": "Invalid request parameters"
}
Other 400 errors: "No file, URL, or data_url provided", "Provide only one of file, URL, or data_url", "Invalid data URL format", "Invalid base64 encoding", "File exceeds maximum allowed size".
{
"success": false,
"error": "API key required"
}
Without a key. A key that is not valid gets "Invalid API key".
{
"success": false,
"error": "An error occurred while processing your request"
}
Or "Failed to process file".
Hent Udtrækningsresultater
https://exiftools.com/api/v1/extract/{uuid}
Retrieve the metadata extraction results for a specific UUID. Use this endpoint to check the status and get results after submitting a file or URL for processing. Your results are private to your account, so send your API key. Results that are shared, and results from before October 28, 2026, can also be read without a key (deprecated, see Authentication).
Anmodningsparametre
{
"uuid": "required", // The UUID returned from the extract endpoint
"X-API-Key": "your key" // in the header, or ?key=YOUR_API_KEY. Required for your own results; without it only shared and older results can be read (no embedded media, with a deprecation notice)
}
Eksempel Svar (Færdig)
{
"success": true,
"status": "completed",
"fileName": "image.jpg",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"processedAt": "2026-03-15T10:31:02+00:00",
"author": "John Doe", // author, createDate, dimensions, cameraModel: only when the file has them
"createDate": "2026-03-15 10:30:00",
"fileSize": "4.2 MB",
"fileSizeBytes": 4404019,
"mimeType": "image/jpeg",
"dimensions": "8192x5464",
"cameraModel": "Canon EOS R5",
"metadata": {
"File": {
"FileType": "JPEG",
"MIMEType": "image/jpeg",
"FileSize": "4.2 MB",
"ImageWidth": 8192,
"ImageHeight": 5464,
"SHA256": "a5e50cbe66078249973d9a71230c4a8edbaedc26af11204042d3bce1f9ed4409"
},
"EXIF": {
"Make": "Canon",
"Model": "Canon EOS R5",
"DateTimeOriginal": "2026:03:15 10:30:00",
"ExposureTime": "1/1000",
"FNumber": 2.8,
"ISO": 100
},
"IPTC": {
"By-line": "John Doe",
"CopyrightNotice": "© 2026 John Doe"
}
// ... more groups: XMP, GPS, ICC_Profile, MakerNotes, Composite…
},
"embedded": { // PDF and Office files only, see Embedded Files
"status": "done",
"count": 1,
"zip": "https://exiftools.com/api/v1/results/{uuid}/embedded.zip",
"items": [
{
"position": 1,
"kind": "image",
"mime": "image/jpeg",
// ...
"url": "https://exiftools.com/api/v1/results/{uuid}/embedded/1"
}
]
},
"contentCredentials": { // files with Content Credentials only, see Content Credentials
"state": "trusted_legacy",
"signer": "Adobe Inc.",
// ...
"aiGenerated": true
}
}
Resultater for PDF- og Office-filer har også en embedded-blok: alle filer fundet i dokumentet, hver med sit downloadlink, og en ZIP med dem alle (se Indlejrede filer).
Filer med Content Credentials har også en contentCredentials-blok: resultatet af tjekket af deres C2PA-signatur (se Content Credentials).
author, createDate, dimensions and cameraModel appear only when the file has them, and so do fileUrl (the url it was read from), duration (audio and video), and for a file with a location gpsCoordinates, latitude, longitude, gpsAltitude, address and addressPlusCode. metadata is grouped the way ExifTool names the groups (File, EXIF, IPTC, XMP, GPS, ICC_Profile, Composite…); which groups and tags appear depends on the file.
A video with a recorded GPS track also gets a "GPS Track" group: Samples, Distance, StartTime, EndTime, PointsListed, and one "Point N" entry per listed point ("latitude, longitude, altitude m, time").
Example Response (Not Finished)
{
"success": false,
"status": "processing", // pending | downloading | processing | failed
"message": "Your file is currently being processed.",
"fileName": "image.jpg"
}
Answered with HTTP 200 while the file is queued, downloading or being read: get the result again in a few seconds. "failed" means it could not be read.
Fejlsvar
{
"success": false,
"error": "Invalid API key"
}
Only returned when the key you send is not valid. A result that is not yours and is not shared answers 404; a shared result whose link has expired answers 410.
{
"success": false,
"error": "No extraction found with the given UUID."
}
{
"success": false,
"error": "An error occurred while retrieving data"
}
Indlejrede filer
For et PDF- eller Office-dokument (docx, xlsx, pptx, OpenDocument) viser resultatet i sin embedded-blok de billeder, video, lyd og vedhæftede filer, der findes i det, hver med et downloadlink, plus en ZIP med dem alle. Linkene kræver din API-nøgle; uden den er de null.
https://exiftools.com/api/v1/results/{uuid}/embedded/{position}
https://exiftools.com/api/v1/results/{uuid}/embedded.zip
Eksempel Svar
"embedded": {
"status": "done", // pending | done | partial | failed
"count": 2,
"zip": "https://exiftools.com/api/v1/results/{uuid}/embedded.zip",
"items": [
{
"position": 1,
"kind": "image", // image | video | audio | document | text | archive | other
"mime": "image/jpeg",
"ext": "jpg",
"bytes": 64753,
"width": 1023,
"height": 158,
"page": 1, // PDF page or slide number
"name": null, // an attachment's own file name
"risky": false,
"url": "https://exiftools.com/api/v1/results/{uuid}/embedded/1"
},
{
"position": 2,
"kind": "document",
"mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"ext": "xlsx",
"bytes": 18311,
"width": null,
"height": null,
"page": null,
"name": "budget.xlsx",
"risky": false,
"url": "https://exiftools.com/api/v1/results/{uuid}/embedded/2"
}
]
}
While status is "pending", get the result again in a few seconds. "partial" means only some of the files are listed; "failed" means the document could not be read, for example because it needs a password.
Add ?view=1 to a file url to open images, video, audio and PDFs in the browser instead of downloading them. risky marks programs, scripts and macros.
Fejlsvar
A file url or the ZIP requested without a valid API key.
No file at that position, the result is not finished, or the ZIP would be empty (no files, none readable, or none left after ?only / ?source).
The result has been taken down.
Too many ZIP requests: wait a moment and try again.
Content Credentials
Files that carry Content Credentials (C2PA) get a contentCredentials block: whether the signature holds, whether the file changed after it was signed, whether the signer is on a trust list, and what the credentials declare (AI generation, actions, the files it was made from).
Eksempel Svar
"contentCredentials": {
"state": "trusted_legacy", // trusted | trusted_legacy | valid | unverifiable | invalid | remote | unchecked | error
// "reason": "changed", // invalid: changed | signature | expired; error: tool
// "remoteHost": "…", // remote: where the credentials are stored
"signer": "Adobe Inc.",
"certificateName": "cai-prod",
"trustList": "itl", // c2pa (C2PA Trust List) | itl (earlier Content Credentials list)
"signedAt": "2023-10-02T16:51:02+00:00",
"timestamped": true,
"algorithm": "Ps256",
"generator": "Adobe Firefly 1.0",
"title": "Generated image",
"aiGenerated": true,
"digitalSourceTypes": ["ai"],
"actions": [
{ "action": "c2pa.created", "softwareAgent": "Adobe Firefly", "digitalSourceType": "ai" }
],
"ingredients": [],
"creator": [],
"aiTraining": [],
"checks": [
{ "code": "assertion.dataHash.match", "outcome": "success" },
{ "code": "signingCredential.trusted", "outcome": "success" },
{ "code": "signingCredential.ocsp.skipped", "outcome": "info" }
// ...
],
"manifestUrl": "https://exiftools.com/results/{uuid}/credentials?format=manifest",
"checkedAt": "2026-10-15T16:36:48+00:00"
}
state: trusted means the signer is on the C2PA Trust List; trusted_legacy, on the earlier Content Credentials list; valid, the signature and the file are intact but the signer is on no trusted list; unverifiable, the signature holds but the content could not be compared with it; invalid comes with a reason: changed (the file was edited after signing), signature or expired; remote (with remoteHost), the credentials are stored online; unchecked, the credentials were not checked; error, the check failed. A trusted signer says who made the file, not that its content is true.
Fields with no value are left out. checks lists the validation results with their status code and outcome (success, info or failure). manifestUrl returns the whole C2PA manifest as JSON.
Items: ingredients {title, format, relationship, signer, state: signed | invalid | none, ingredients: […]}; creator {name, provider}; aiTraining {key, use: allowed | notAllowed | constrained}. digitalSourceTypes values: ai, ai_composite, algorithmic, enhanced, camera, computational, composite, edited, digital_art, screenshot, scan.
Fjern Metadata
https://exiftools.com/api/v1/remove
Fjern alle metadata fra en fil, herunder EXIF-data, GPS-placering, IPTC, XMP og andre følsomme oplysninger. Upload en fil direkte eller angiv en URL til behandling. Modtag en renset version uden indlejrede metadata. Den rensede fil er tilgængelig til download via den returnerede URL.
Anmodningsparametre
{
"file": "binary_file_data", // Option 1: direct file upload
"url": "https://example.com/image.jpg", // Option 2: URL. Can be passed as POST body or query string parameter
"data_url": "data:image/jpeg;base64,/9j/4AAQ..." // Option 3: base64 data URL
// Provide exactly one of the above
}
Eksempel Svar
{
"success": true,
"status": "completed",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"downloadUrl": "https://exiftools.com/api/v1/download-cleaned/123e4567-e89b-12d3-a456-426614174000?expires=1793020800&signature=…"
}
The downloadUrl links to the cleaned file with all metadata removed. It needs no API key and expires, so download the file soon.
When the file takes longer, the response is 202 with "status": "processing" and a statusUrl (GET /api/v1/remove/{uuid}, same API key) that returns this same payload once the file is ready. A format we cannot clean comes back with "unchanged": true and a notice: its metadata is still inside.
Fejlsvar
The 400, 401 and 500 errors are the same as for Extract Metadata.
{
"success": false,
"status": "failed",
"error": "Failed to download file: …"
}
The url could not be downloaded.
{
"success": false,
"status": "failed",
"error": "Failed to remove metadata"
}
Or "Failed to process file" when the file could not be read.
{
"success": false,
"error": "No remove request found with the given UUID."
}
From GET /api/v1/remove/{uuid}: you can only poll your own requests. A missing or invalid key there gets 401 "Invalid API key".
Kodeeksempler
# File Upload - Using header
curl -X POST https://exiftools.com/api/v1/extract \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-F "[email protected]"
# File Upload - Using query parameter
curl -X POST "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE" \
-F "[email protected]"
# URL Processing - Using header
curl -X POST https://exiftools.com/api/v1/extract \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.jpg"}'
# URL Processing - Using query parameter
curl -X POST "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.jpg"}'
# Data URL (base64) - encode a local file inline - Using header
curl -X POST https://exiftools.com/api/v1/extract \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d "{\"data_url\": \"data:image/jpeg;base64,$(base64 -i image.jpg)\"}"
# Data URL (base64) - encode a local file inline - Using query parameter
curl -X POST "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d "{\"data_url\": \"data:image/jpeg;base64,$(base64 -i image.jpg)\"}"
# Get results by UUID - Using header
curl -X GET https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000 \
-H "X-API-Key: YOUR_API_KEY_HERE"
# Get results by UUID - Using query parameter
curl -X GET "https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000?key=YOUR_API_KEY_HERE"
# Response (immediate results)
{
"success": true,
"status": "completed",
"fileName": "image.jpg",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"processedAt": "2026-03-15T10:31:02+00:00",
"author": "John Doe", # author, createDate, dimensions, cameraModel: only when the file has them
"createDate": "2026-03-15 10:30:00",
"fileSize": "4.2 MB",
"fileSizeBytes": 4404019,
"mimeType": "image/jpeg",
"dimensions": "8192x5464",
"cameraModel": "Canon EOS R5",
"metadata": {
"File": {
"FileType": "JPEG",
"MIMEType": "image/jpeg",
"FileSize": "4.2 MB",
"ImageWidth": 8192,
"ImageHeight": 5464,
"SHA256": "a5e50cbe66078249973d9a71230c4a8edbaedc26af11204042d3bce1f9ed4409"
},
"EXIF": {
"Make": "Canon",
"Model": "Canon EOS R5",
"DateTimeOriginal": "2026:03:15 10:30:00",
"ExposureTime": "1/1000",
"FNumber": 2.8,
"ISO": 100
},
"IPTC": {
"By-line": "John Doe",
"CopyrightNotice": "© 2026 John Doe"
}
# ... more groups: XMP, GPS, ICC_Profile, MakerNotes, Composite…
}
}
# Remove Metadata - File Upload - Using header
curl -X POST https://exiftools.com/api/v1/remove \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-F "[email protected]"
# Remove Metadata - File Upload - Using query parameter
curl -X POST "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE" \
-F "[email protected]"
# Remove Metadata - URL Processing - Using header
curl -X POST https://exiftools.com/api/v1/remove \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.jpg"}'
# Remove Metadata - URL Processing - Using query parameter
curl -X POST "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.jpg"}'
# Remove Metadata - Data URL (base64) - Using header
curl -X POST https://exiftools.com/api/v1/remove \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d "{\"data_url\": \"data:image/jpeg;base64,$(base64 -i image.jpg)\"}"
# Remove Metadata - Data URL (base64) - Using query parameter
curl -X POST "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d "{\"data_url\": \"data:image/jpeg;base64,$(base64 -i image.jpg)\"}"
# Response
{
"success": true,
"status": "completed",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"downloadUrl": "https://exiftools.com/api/v1/download-cleaned/123e4567-e89b-12d3-a456-426614174000?expires=1793020800&signature=…"
}
import requests
# File Upload - Using header
url = "https://exiftools.com/api/v1/extract"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE"
}
files = {
"file": open("image.jpg", "rb")
}
response = requests.post(url, headers=headers, files=files)
# File Upload - Using query parameter
url = "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE"
files = {
"file": open("image.jpg", "rb")
}
response = requests.post(url, files=files)
# URL Processing - Using header
url = "https://exiftools.com/api/v1/extract"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json"
}
data = {
"url": "https://example.com/image.jpg"
}
response = requests.post(url, headers=headers, json=data)
# URL Processing - Using query parameter
url = "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE"
headers = {
"Content-Type": "application/json"
}
data = {
"url": "https://example.com/image.jpg"
}
response = requests.post(url, headers=headers, json=data)
# Data URL (base64) - encode a local file - Using header
import base64
with open("image.jpg", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
url = "https://exiftools.com/api/v1/extract"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json"
}
data = {
"data_url": f"data:image/jpeg;base64,{encoded}"
}
response = requests.post(url, headers=headers, json=data)
# Data URL (base64) - encode a local file - Using query parameter
import base64
with open("image.jpg", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
url = "https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE"
headers = {
"Content-Type": "application/json"
}
data = {
"data_url": f"data:image/jpeg;base64,{encoded}"
}
response = requests.post(url, headers=headers, json=data)
# Get results by UUID - Using header
response = requests.get('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000', headers={"X-API-Key": "YOUR_API_KEY_HERE"})
metadata = response.json()
# Get results by UUID - Using query parameter
response = requests.get('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000?key=YOUR_API_KEY_HERE')
metadata = response.json()
# Remove Metadata - File Upload - Using header
url = "https://exiftools.com/api/v1/remove"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE"
}
files = {
"file": open("image.jpg", "rb")
}
response = requests.post(url, headers=headers, files=files)
result = response.json()
# Download the cleaned file
download_url = result['downloadUrl']
cleaned_file = requests.get(download_url)
with open("image_cleaned.jpg", "wb") as f:
f.write(cleaned_file.content)
# Remove Metadata - File Upload - Using query parameter
url = "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE"
files = {
"file": open("image.jpg", "rb")
}
response = requests.post(url, files=files)
result = response.json()
# Remove Metadata - URL Processing - Using header
url = "https://exiftools.com/api/v1/remove"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json"
}
data = {
"url": "https://example.com/image.jpg"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
# Remove Metadata - URL Processing - Using query parameter
url = "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE"
headers = {
"Content-Type": "application/json"
}
data = {
"url": "https://example.com/image.jpg"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
# Remove Metadata - Data URL (base64) - Using header
import base64
with open("image.jpg", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
url = "https://exiftools.com/api/v1/remove"
headers = {
"X-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json"
}
data = {
"data_url": f"data:image/jpeg;base64,{encoded}"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
# Remove Metadata - Data URL (base64) - Using query parameter
import base64
with open("image.jpg", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
url = "https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE"
headers = {
"Content-Type": "application/json"
}
data = {
"data_url": f"data:image/jpeg;base64,{encoded}"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
# Download cleaned file
cleaned_file = requests.get(result['downloadUrl'])
with open("image_cleaned.jpg", "wb") as f:
f.write(cleaned_file.content)
// File Upload - Using header
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://exiftools.com/api/v1/extract', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE'
},
body: formData
})
.then(response => response.json())
.then(data => console.log(data));
// File Upload - Using query parameter
const formData2 = new FormData();
formData2.append('file', fileInput.files[0]);
fetch('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE', {
method: 'POST',
body: formData2
})
.then(response => response.json())
.then(data => console.log(data));
// URL Processing - Using header
fetch('https://exiftools.com/api/v1/extract', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/image.jpg'
})
})
.then(response => response.json())
.then(data => console.log(data));
// URL Processing - Using query parameter
fetch('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/image.jpg'
})
})
.then(response => response.json())
.then(data => console.log(data));
// Data URL (base64) - from a File input or canvas - Using header
const reader = new FileReader();
reader.onload = () => {
fetch('https://exiftools.com/api/v1/extract', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data_url: reader.result // e.g. "data:image/jpeg;base64,..."
})
})
.then(response => response.json())
.then(data => console.log(data));
};
reader.readAsDataURL(fileInput.files[0]);
// Data URL (base64) - from a File input or canvas - Using query parameter
const readerQuery = new FileReader();
readerQuery.onload = () => {
fetch('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
data_url: readerQuery.result // e.g. "data:image/jpeg;base64,..."
})
})
.then(response => response.json())
.then(data => console.log(data));
};
readerQuery.readAsDataURL(fileInput.files[0]);
// Get results by UUID - Using header
fetch('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000', {
headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' }
})
.then(response => response.json())
.then(data => console.log(data));
// Get results by UUID - Using query parameter
fetch('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000?key=YOUR_API_KEY_HERE')
.then(response => response.json())
.then(data => console.log(data));
// Remove Metadata - File Upload - Using header
const removeFormData = new FormData();
removeFormData.append('file', fileInput.files[0]);
fetch('https://exiftools.com/api/v1/remove', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE'
},
body: removeFormData
})
.then(response => response.json())
.then(data => {
// Download the cleaned file
window.location.href = data.downloadUrl;
});
// Remove Metadata - File Upload - Using query parameter
const removeFormData2 = new FormData();
removeFormData2.append('file', fileInput.files[0]);
fetch('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE', {
method: 'POST',
body: removeFormData2
})
.then(response => response.json())
.then(data => console.log(data));
// Remove Metadata - URL Processing - Using header
fetch('https://exiftools.com/api/v1/remove', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/image.jpg'
})
})
.then(response => response.json())
.then(data => {
window.location.href = data.downloadUrl;
});
// Remove Metadata - URL Processing - Using query parameter
fetch('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/image.jpg'
})
})
.then(response => response.json())
.then(data => console.log(data));
// Remove Metadata - Data URL (base64) - Using header
const reader2 = new FileReader();
reader2.onload = () => {
fetch('https://exiftools.com/api/v1/remove', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data_url: reader2.result
})
})
.then(response => response.json())
.then(data => {
window.location.href = data.downloadUrl;
});
};
reader2.readAsDataURL(fileInput.files[0]);
// Remove Metadata - Data URL (base64) - Using query parameter
const reader2Query = new FileReader();
reader2Query.onload = () => {
fetch('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
data_url: reader2Query.result
})
})
.then(response => response.json())
.then(data => {
window.location.href = data.downloadUrl;
});
};
reader2Query.readAsDataURL(fileInput.files[0]);
// File Upload - Using header
$curl = curl_init();
$file = new CURLFile('/path/to/image.jpg', 'image/jpeg', 'image.jpg');
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'file' => $file
],
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE'
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// File Upload - Using query parameter
$curl = curl_init();
$file = new CURLFile('/path/to/image.jpg', 'image/jpeg', 'image.jpg');
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'file' => $file
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// URL Processing - Using header
$curl = curl_init();
$data = json_encode(['url' => 'https://example.com/image.jpg']);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// URL Processing - Using query parameter
$curl = curl_init();
$data = json_encode(['url' => 'https://example.com/image.jpg']);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// Data URL (base64) - encode a local file - Using header
$curl = curl_init();
$base64 = base64_encode(file_get_contents('/path/to/image.jpg'));
$data = json_encode(['data_url' => 'data:image/jpeg;base64,' . $base64]);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// Data URL (base64) - encode a local file - Using query parameter
$curl = curl_init();
$base64 = base64_encode(file_get_contents('/path/to/image.jpg'));
$data = json_encode(['data_url' => 'data:image/jpeg;base64,' . $base64]);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// Get results by UUID - Using header
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY_HERE']
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// Get results by UUID - Using query parameter
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
]);
$response = curl_exec($curl);
$metadata = json_decode($response, true);
curl_close($curl);
// Remove Metadata - File Upload - Using header
$curl = curl_init();
$file = new CURLFile('/path/to/image.jpg', 'image/jpeg', 'image.jpg');
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'file' => $file
],
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE'
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Download the cleaned file
$downloadUrl = $result['downloadUrl'];
$cleanedContent = file_get_contents($downloadUrl);
file_put_contents('image_cleaned.jpg', $cleanedContent);
// Remove Metadata - File Upload - Using query parameter
$curl = curl_init();
$file = new CURLFile('/path/to/image.jpg', 'image/jpeg', 'image.jpg');
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'file' => $file
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Remove Metadata - URL Processing - Using header
$curl = curl_init();
$data = json_encode(['url' => 'https://example.com/image.jpg']);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Remove Metadata - URL Processing - Using query parameter
$curl = curl_init();
$data = json_encode(['url' => 'https://example.com/image.jpg']);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Remove Metadata - Data URL (base64) - Using header
$curl = curl_init();
$base64 = base64_encode(file_get_contents('/path/to/image.jpg'));
$data = json_encode(['data_url' => 'data:image/jpeg;base64,' . $base64]);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY_HERE',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Remove Metadata - Data URL (base64) - Using query parameter
$curl = curl_init();
$base64 = base64_encode(file_get_contents('/path/to/image.jpg'));
$data = json_encode(['data_url' => 'data:image/jpeg;base64,' . $base64]);
curl_setopt_array($curl, [
CURLOPT_URL => 'https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
// Download cleaned file
$cleanedContent = file_get_contents($result['downloadUrl']);
file_put_contents('image_cleaned.jpg', $cleanedContent);
require 'net/http'
require 'json'
require 'uri'
# File Upload - Using header
uri = URI('https://exiftools.com/api/v1/extract')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
# Create multipart form data
form_data = [['file', File.open('image.jpg', 'rb')]]
request.set_form(form_data, 'multipart/form-data')
response = http.request(request)
metadata = JSON.parse(response.body)
# File Upload - Using query parameter
uri = URI('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
form_data = [['file', File.open('image.jpg', 'rb')]]
request.set_form(form_data, 'multipart/form-data')
response = http.request(request)
metadata = JSON.parse(response.body)
# URL Processing - Using header
uri = URI('https://exiftools.com/api/v1/extract')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
request['Content-Type'] = 'application/json'
request.body = { url: 'https://example.com/image.jpg' }.to_json
response = http.request(request)
metadata = JSON.parse(response.body)
# URL Processing - Using query parameter
uri = URI('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = { url: 'https://example.com/image.jpg' }.to_json
response = http.request(request)
metadata = JSON.parse(response.body)
# Data URL (base64) - encode a local file - Using header
require 'base64'
encoded = Base64.strict_encode64(File.binread('image.jpg'))
uri = URI('https://exiftools.com/api/v1/extract')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
request['Content-Type'] = 'application/json'
request.body = { data_url: "data:image/jpeg;base64,#{encoded}" }.to_json
response = http.request(request)
metadata = JSON.parse(response.body)
# Data URL (base64) - encode a local file - Using query parameter
require 'base64'
encoded = Base64.strict_encode64(File.binread('image.jpg'))
uri = URI('https://exiftools.com/api/v1/extract?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = { data_url: "data:image/jpeg;base64,#{encoded}" }.to_json
response = http.request(request)
metadata = JSON.parse(response.body)
# Alternative using HTTParty gem (if available)
# require 'httparty'
#
# # File Upload
# response = HTTParty.post('https://exiftools.com/api/v1/extract',
# headers: { 'X-API-Key' => 'YOUR_API_KEY_HERE' },
# body: { file: File.open('image.jpg', 'rb') }
# )
#
# # URL Processing
# response = HTTParty.post('https://exiftools.com/api/v1/extract',
# headers: {
# 'X-API-Key' => 'YOUR_API_KEY_HERE',
# 'Content-Type' => 'application/json'
# },
# body: { url: 'https://example.com/image.jpg' }.to_json
# )
# Get results by UUID - Using header
uri = URI('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
response = http.request(request)
metadata = JSON.parse(response.body)
# Get results by UUID - Using query parameter
uri = URI('https://exiftools.com/api/v1/extract/123e4567-e89b-12d3-a456-426614174000?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
response = http.request(request)
metadata = JSON.parse(response.body)
# Remove Metadata - File Upload - Using header
uri = URI('https://exiftools.com/api/v1/remove')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
# Create multipart form data
form_data = [['file', File.open('image.jpg', 'rb')]]
request.set_form(form_data, 'multipart/form-data')
response = http.request(request)
result = JSON.parse(response.body)
# Download the cleaned file
download_uri = URI(result['downloadUrl'])
cleaned_file = Net::HTTP.get(download_uri)
File.write('image_cleaned.jpg', cleaned_file)
# Remove Metadata - File Upload - Using query parameter
uri = URI('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
form_data = [['file', File.open('image.jpg', 'rb')]]
request.set_form(form_data, 'multipart/form-data')
response = http.request(request)
result = JSON.parse(response.body)
# Remove Metadata - URL Processing - Using header
uri = URI('https://exiftools.com/api/v1/remove')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
request['Content-Type'] = 'application/json'
request.body = { url: 'https://example.com/image.jpg' }.to_json
response = http.request(request)
result = JSON.parse(response.body)
# Remove Metadata - URL Processing - Using query parameter
uri = URI('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = { url: 'https://example.com/image.jpg' }.to_json
response = http.request(request)
result = JSON.parse(response.body)
# Remove Metadata - Data URL (base64) - Using header
require 'base64'
encoded = Base64.strict_encode64(File.binread('image.jpg'))
uri = URI('https://exiftools.com/api/v1/remove')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY_HERE'
request['Content-Type'] = 'application/json'
request.body = { data_url: "data:image/jpeg;base64,#{encoded}" }.to_json
response = http.request(request)
result = JSON.parse(response.body)
# Remove Metadata - Data URL (base64) - Using query parameter
require 'base64'
encoded = Base64.strict_encode64(File.binread('image.jpg'))
uri = URI('https://exiftools.com/api/v1/remove?key=YOUR_API_KEY_HERE')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = { data_url: "data:image/jpeg;base64,#{encoded}" }.to_json
response = http.request(request)
result = JSON.parse(response.body)
# Download cleaned file
download_uri = URI(result['downloadUrl'])
cleaned_file = Net::HTTP.get(download_uri)
File.write('image_cleaned.jpg', cleaned_file)