Get image metadata from remote URL
get
https://api.imagekit.io
/v1/metadata
Get image metadata from remote URL API

Response structure and status code (application/JSON)

In case of error, you will get an error code along with the error message. On success, you will receive a 200 status code with the image metadata in the JSON-encoded response body.
A metadata object example can be found here.

Metadata through ImageKit transformation URL

If the url passed to this API has no transformation parameter, then the metadata of the original uploaded image will be fetched. We internally add orig-true parameter to fetch the original image.
Instead, if the passed url has any transformation parameters, then the metadata of the transformed image will be fetched.
See the examples below.

Examples

Here are some example requests to understand the API usage.

Get metadata of an original image (no transformation applied)

cURL
Python
PHP
Java
Ruby
1
# The unique fileId of the uploaded file. fileId is returned in response of list files API and upload API.
2
curl -X GET "https://api.imagekit.io/v1/metadata?url=https://ik.imagekit.io/demo/default-image.jpg" \
3
-u your_private_api_key:
Copied!
1
imagekit.get_remote_file_url_metadata("remote_file_url")
Copied!
1
$imageKit->getFileMetadataFromRemoteURL("remote_file_url")
Copied!
1
ResultMetaData result=ImageKit.getInstance().getRemoteFileMetadata("remote_file_url");
Copied!
1
imagekitio = ImageKit::ImageKitClient.new("your_private_key", "your_public_key", "your_url_endpoint")
2
imagekitio.get_remote_file_url_metadata("remote_file_url")
Copied!

Get metadata of a transformed image

cURL
Node.js
Python
PHP
Java
Ruby
1
# The URL of the uploaded file
2
curl -X GET "https://api.imagekit.io/v1/metadata?url=https://ik.imagekit.io/demo/tr:w-100/default-image.jpg" \
3
-u your_private_api_key:
Copied!
1
var ImageKit = require("imagekit");
2
3
var imagekit = new ImageKit({
4
publicKey : "your_public_api_key",
5
privateKey : "your_private_api_key",
6
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
7
});
8
9
imagekit.getFileMetadata("https://ik.imagekit.io/demo/tr:w-100/default-image.jpg", function(error, result) {
10
if(error) console.log(error);
11
else console.log(result);
12
});
Copied!
1
imagekit.get_remote_file_url_metadata("https://ik.imagekit.io/demo/tr:w-100/default-image.jpg")
Copied!
1
$imageKit->getFileMetadataFromRemoteURL("https://ik.imagekit.io/demo/tr:w-100/default-image.jpg")
Copied!
1
ResultMetaData result=ImageKit.getInstance().getRemoteFileMetadata("https://ik.imagekit.io/demo/tr:w-100/default-image.jpg");
Copied!
1
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
2
imagekitio.get_remote_file_url_metadata(remote_file_url: "https://ik.imagekit.io/demo/tr:w-100/default-image.jpg")
Copied!

Calculate pHash distance between two images

See examples here.