Links

Get file details

get
https://api.imagekit.io
/v1/files/:fileId/details
Get file details API

Response structure and status code (application/JSON)

In case of an error, you will get an error code along with the error message. On success, you will receive a 200 status code with the file object in JSON-encoded response body.

Examples

Here is the example request to understand the API usage.
cURL
Node.js
Python
PHP
Java
Ruby
Go
.Net
# The unique fileId of the uploaded file. fileId is returned in response of list files API and upload API.
curl -X GET "https://api.imagekit.io/v1/files/file_id/details" \
-u your_private_api_key:
var ImageKit = require("imagekit");
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
imagekit.getFileDetails("file_id", function(error, result) {
if(error) console.log(error);
else console.log(result);
});
from imagekitio import ImageKit
imagekit = ImageKit(
public_key='your_public_api_key',
private_key='your_private_api_key',
url_endpoint = 'https://ik.imagekit.io/your_imagekit_id/'
)
details = imagekit.get_file_details(file_id="file_id")
print("File detail-", details, end="\n\n")
# Raw Response
print(details.response_metadata.raw)
# print that file's id
print(details.file_id)
use ImageKit\ImageKit;
$public_key = "your_public_api_key";
$your_private_key = "your_private_api_key";
$url_end_point = "https://ik.imagekit.io/your_imagekit_id";
$imageKit = new ImageKit(
$public_key,
$your_private_key,
$url_end_point
);
$getFileDetails = $imageKit->getDetails("file_id");
echo("File details : " . json_encode($getFileDetails));
Result result=ImageKit.getInstance().getFileDetail("file_id");
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.get_file_deltails(file_id: 'file_id')
resp, err := ik.Media.FileById(ctx, "file_id")
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
Result res1 = imagekit.GetFileDetail("file_Id");