Skip to main content

๐Ÿ—‚๏ธ Image Metadata Extraction

The /metadata endpoint extracts technical and contextual information embedded in an image file. This includes EXIF data such as GPS coordinates, camera model, date taken, and more.

This is useful for photo management apps, forensic analysis, or any service requiring image provenance.


๐Ÿ“ฅ Endpoint: POST /metadataโ€‹

Base URL: https://api.visionary.ai/v1/metadata


๐Ÿ” Headersโ€‹

KeyValueRequired
AuthorizationBearer YOUR_API_KEYโœ…
Content-Typeapplication/json or multipart/form-dataโœ…

๐Ÿ“ธ Request Bodyโ€‹

Option 1 โ€“ JSON (Base64)โ€‹

{
"image": "data:image/jpeg;base64,/9j/4AAQSkZ..."
}

Option 2 โ€“ Multipartโ€‹

Use image as the field name.


๐Ÿงช Example (curl โ€“ multipart)โ€‹

curl -X POST https://api.visionary.ai/v1/metadata \
-H "Authorization: Bearer demo-api-key" \
-F "image=@/path/to/image.jpg"

โœ… Responseโ€‹

{
"camera": {
"make": "Canon",
"model": "EOS 80D"
},
"datetime": "2024-06-12T14:27:00Z",
"gps": {
"latitude": 48.8566,
"longitude": 2.3522
},
"resolution": {
"width": 6000,
"height": 4000
},
"format": "jpeg",
"filesize_kb": 3450
}

๐Ÿง  Fieldsโ€‹

FieldTypeDescription
cameraobjectObject containing camera manufacturer & model
camera.makestringCamera manufacturer (e.g. Canon, Sony)
camera.modelstringCamera model name
datetimestringDate and time the image was taken (ISO 8601)
gpsobjectObject containing GPS coordinates
gps.latitudefloatLatitude in decimal degrees
gps.longitudefloatLongitude in decimal degrees
resolutionobjectObject with image width and height
resolution.widthintegerImage width in pixels
resolution.heightintegerImage height in pixels
formatstringFile format (jpeg, png, webp)
filesize_kbintegerSize of the image in kilobytes

๐Ÿšซ Error Responsesโ€‹

CodeMessageCause
400"No image provided"Missing file or base64 string
401"Unauthorized"Invalid API key
422"Image lacks metadata"EXIF data not found or stripped

๐Ÿ“Œ Notesโ€‹

  • Not all images contain metadata (especially screenshots or edited photos).

  • GPS data may be removed depending on the device or privacy settings.

  • You can use this endpoint before or after any other processing step.


๐Ÿงญ Done with the endpoints?โ€‹

โžก๏ธ Head back to the Introduction or visit the FAQ for common questions.