API 문서
간단하고 강력한 API를 사용하여 파일에서 메타데이터를 추출하세요. API 키로 시작하여 프로그래밍 방식으로 파일 분석을 시작하세요.
인증
메타데이터 추출
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.
요청 매개변수
{
"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
}
응답 예제
{
"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…
}
}
응답의 필드는 추출 결과 가져오기와 같습니다. PDF 및 Office 파일에는 embedded 블록도 포함되며, 업로드 직후에는 대개 아직 "pending" 상태입니다. 몇 초 후 결과를 다시 가져오면 파일을 볼 수 있습니다(포함된 파일 참고).
오류 응답
{
"success": false,
"error": "Invalid request parameters"
}
{
"success": false,
"error": "Invalid API key"
}
{
"success": false,
"error": "An error occurred while processing your request"
}
추출 결과 가져오기
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. Requires your API key.
요청 매개변수
{
"uuid": "required", // The UUID returned from the extract endpoint
"X-API-Key": "required" // API key in header, or use ?key=YOUR_API_KEY
}
응답 예제(완료됨)
{
"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"
}
]
}
}
PDF 및 Office 결과에는 embedded 블록도 포함됩니다. 문서 안에서 찾은 모든 파일과 각각의 다운로드 링크, 그리고 모든 파일을 담은 ZIP입니다(포함된 파일 참고).
author, createDate, dimensions, cameraModel은 파일에 해당 정보가 있을 때만 표시됩니다. metadata는 ExifTool의 그룹 이름(File, EXIF, IPTC, XMP, GPS, ICC_Profile, Composite…)별로 묶이며, 어떤 그룹과 태그가 나오는지는 파일에 따라 다릅니다.
오류 응답
{
"success": false,
"error": "Invalid API key"
}
잘못된 API 키가 제공된 경우에만 반환됩니다
{
"success": false,
"error": "No extraction found with the given UUID."
}
포함된 파일
PDF 또는 Office 문서(docx, xlsx, pptx, OpenDocument)의 경우, 결과의 embedded 블록에 문서 안에서 찾은 이미지, 동영상, 오디오, 첨부 파일이 각각의 다운로드 링크와 함께 나열되고, 모든 파일을 담은 ZIP도 포함됩니다. 링크에는 API 키가 필요하며, 키가 없으면 null입니다.
https://exiftools.com/api/v1/results/{uuid}/embedded/{position}
https://exiftools.com/api/v1/results/{uuid}/embedded.zip
응답 예제
"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 | 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"
}
]
}
파일은 메타데이터가 준비된 뒤에 찾습니다. status가 "pending"인 동안에는 몇 초 후에 결과를 다시 가져오세요. "partial"은 한도에 도달해 처음 몇 개 파일만 나열되었다는 뜻이고, "failed"는 비밀번호가 필요한 경우처럼 문서를 읽을 수 없었다는 뜻입니다.
파일 url에 ?view=1을 붙이면 이미지, 동영상, 오디오, PDF를 다운로드하지 않고 브라우저에서 엽니다. risky로 표시된 파일(프로그램, 스크립트, 매크로)은 항상 다운로드됩니다.
오류 응답
A file url or the ZIP requested without a valid API key.
메타데이터 제거
https://exiftools.com/api/v1/remove
EXIF 데이터, GPS 위치, IPTC, XMP 및 기타 민감한 정보를 포함한 파일의 모든 메타데이터를 제거합니다. 파일을 직접 업로드하거나 처리할 URL을 제공하세요. 임베디드 메타데이터가 없는 정리된 버전을 받으세요. 정리된 파일은 반환된 URL을 통해 다운로드할 수 있습니다.
요청 매개변수
{
"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
}
응답 예제
{
"success": true,
"status": "completed",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"downloadUrl": "https://exiftools.com/download-cleaned/123e4567-e89b-12d3-a456-426614174000"
}
downloadUrl은 모든 메타데이터가 제거된 정리된 파일을 다운로드할 수 있는 직접 링크를 제공합니다. 파일은 24시간 동안 다운로드 가능합니다.
Cleaning runs on a queue. When it takes longer than the request waits, 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 no cleaner on the server handles comes back with "unchanged": true and a notice — its metadata is still inside.
오류 응답
{
"success": false,
"error": "An error occurred while processing your request"
}
코드 예제
# 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/download-cleaned/123e4567-e89b-12d3-a456-426614174000"
}
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)