All Products
Search
Document Center

Object Storage Service:get-object-meta

Last Updated:Mar 20, 2026

Retrieves an object's metadata — ETag, size, and last modified time — without downloading the object itself.

This command corresponds to the GetObjectMeta API operation.

Prerequisites

Before you begin, ensure that you have:

  • ossutil installed and configured with a valid endpoint and credentials

  • The oss:GetObject permission on the target bucket (required for RAM users and Security Token Service (STS) users)

Alibaba Cloud account owners have this permission by default.

Syntax

ossutil api get-object-meta --bucket <bucket-name> --key <object-key> [flags]

Parameters

ParameterTypeRequiredDescription
--bucketstringYesName of the bucket
--keystringYesFull path of the object (object key)
--version-idstringNoVersion ID of the object. Use this to retrieve metadata for a specific version in a versioning-enabled bucket.

For additional flags (such as --output-format), run ossutil api --help.

Examples

Get metadata for an object

ossutil api get-object-meta --bucket examplebucket --key exampleobject

Get metadata in JSON format

ossutil api get-object-meta --bucket examplebucket --key exampleobject --output-format json

Get metadata for a specific version

ossutil api get-object-meta --bucket examplebucket --key exampleobject --version-id 123

Output fields

The response includes the following fields:

FieldDescription
ETagEntity tag that identifies a specific version of the object.
SizeObject size in bytes.
LastModifiedDate and time when the object was last modified.
get-object-meta returns only these three fields and does not return the object body. For the full set of object metadata, use the GetObjectMeta API reference.

Usage notes

  • Symbolic links: If the object is a symbolic link, the command returns metadata for the symbolic link itself, not the target object.

  • Permissions: RAM users and STS users require the oss:GetObject permission.

  • Versioning: Without --version-id, the command retrieves metadata for the current version of the object.

What's next