Updated on 2026-08-21 GMT+08:00

Listing Objects

On OBS Console, when you open a bucket's object list page, objects are listed in lexicographical order by default. You can also sort objects by size or last modification time.

How It Works

In OBS object listing, all parameters (as defined by the API) work together based on the following logic to achieve precise and controllable data retrieval.

prefix defines the search scope. The system returns only object names that start with the specified prefix. As shown in Figure 1, when prefix is set to test/, the listing result includes objects whose names start with that prefix, such as test/a, test/b, and test/c.

Figure 1 How object listing works when prefix is specified

marker specifies the starting point for listing objects. The system returns only objects whose names are lexicographically greater than the specified marker value, enabling resumable data transfer. As shown in Figure 2, when marker is set to test/b, objects such as test/c and logs/2026 that follow test/b are returned.

Figure 2 How object listing works when marker is specified

delimiter, usually a slash (/), determines how folders are displayed.

  • If delimiter is not specified, the system recursively expands all levels of subfolders.
  • When prefix is not specified and only delimiter=/ is specified, the system groups the characters from the start of each object name up to the first slash (/) into a single CommonPrefixes entry, as shown in Figure 3. When both prefix=t and delimiter=/ are specified, the system groups the characters from the starting prefix t to the first slash (/) into one CommonPrefixes entry, as shown in Figure 4.
    Figure 3 How object listing works when delimiter is specified
    Figure 4 How object listing works when both prefix and delimiter are specified

max-keys is a hard limit that caps the number of items returned in a single request (maximum: 1,000). When the number of matching objects exceeds this limit, the response sets IsTruncated=true and provides NextMarker, which indicates where the next request should resume, thereby completing pagination. As shown in Figure 5, when max-keys is set to 2, the objects returned in a single request are test/a and test/b.

Figure 5 How object listing works when max-keys is specified

For details about the definition, usage constraints, and response examples of each parameter, see Using SDKs.

Access Control

Only the bucket owner and users granted the obs:bucket:ListBucket (versioning disabled) or obs:bucket:ListBucketVersions (versioning enabled or suspended) permission can list objects. The permissions can be granted through IAM or bucket policies. For details, see Creating a Custom Policy or Creating a Custom Bucket Policy.

Constraints

  • Listing objects by specifying a page number is not allowed.
  • OBS does not support listing objects by upload time. You can search for objects by prefix.
  • The size and last modification time in the object list only sort objects within the current page.

Ways to List Objects

You can use OBS Console, APIs, SDKs, or obsutil to list objects.

Best Practices

Performance optimization

  • Page size: When network conditions are good, set the maximum number of objects displayed on a single page in a bucket to the upper limit (1,000 by default). This reduces round-trip requests and improves listing efficiency. However, you should evaluate the client's memory capacity to avoid memory issues caused by returning too much data at once.
  • Directory caching: For objects that rarely change, cache the listing results to avoid repeated API calls, reducing request costs and latency.

Cost control

If you need to periodically generate a full object inventory, use bucket inventories. Bucket inventories are more cost-effective than real-time listing and support scheduled output, making them better suited for full analysis and auditing.

Logging and Monitoring

OBS provides logging and monitoring features that help you detect and handle object listing operations promptly. You can configure CTS to trace listObjects events or use Cloud Eye to monitor object-listing operations in a bucket (API ID: LIST.BUCKET.OBJECTS). You can also enable logging for the REST.GET.BUCKET operation so the system records detailed logs for auditing or further analysis. For details, see Using Logging to Record OBS Logs.