API Documentation
Extract metadata from files using our simple and powerful API. Get started with your API key and start analyzing files programmatically.
Authentication
All API requests require an API key to be included in the header:
X-API-Key: YOUR_API_KEY_HERE
Extract Metadata
POST
https://exiftools.com/api/v1/extract
Extract metadata from a file using either a direct file upload or a URL.
Request Parameters
{
"file": "binary_file_data", // Required if url not provided
"url": "https://example.com/image.jpg", // Required if file not provided
}
Example Response
{
"success": true,
"metadata": {
"exif": {
"Make": "Canon",
"Model": "EOS R5",
"DateTimeOriginal": "2024:03:15 10:30:00",
"ExposureTime": "1/1000",
"FNumber": "2.8",
"ISO": "100"
},
"iptc": {
"Creator": "John Doe",
"Copyright": "© 2024"
}
}
}
Error Responses
400 Bad Request
{
"success": false,
"error": "No file or URL provided"
}
401 Unauthorized
{
"success": false,
"error": "Invalid API key"
}
Code Examples
cURL
curl -X POST https://exiftools.com/api/v1/extract \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-F "[email protected]"
{
"success": true,
"data": {
"exif": {
"Make": "Canon",
"Model": "EOS R5",
"DateTimeOriginal": "2024:03:15 10:30:00",
"ExposureTime": "1/1000",
"FNumber": "2.8",
"ISO": "100"
},
"File" : {
"Name" : "image.jpg",
"Size" : 123456,
"Type" : "image/jpeg"
}
// ... more metadata
}
}
Python
import requests
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)
metadata = response.json()
JavaScript
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));
PHP
$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);