Skip to main content

S3 List Objects

Returns some or all (up to 1,000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A 200 OK response can contain valid or invalid XML. Be sure to design your application to parse the contents of the response and handle it appropriately.

note

This action has been revised. We recommend that you use the newer version, ListObjectsV2, when developing applications. For backward compatibility, Amazon S3 continues to support ListObjects.

The following operations are related to ListObjects:

External Documentation

To learn more, visit the AWS documentation.

Basic Parameters

ParameterDescription
AWS Region(s)Enter the desired AWS Region(s).To execute the action in multiple regions, provide a comma-separated list.For example: us-east-1,eu-west-2.If you wish to run the action in all available regions, use the asterisk symbol (*) instead.
BucketThe name of the bucket containing the objects.When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName- AccountId.s3-accesspoint. Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName- AccountId. outpostID.s3-outposts. Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.
DelimiterA delimiter is a character you use to group keys.

Advanced Parameters

ParameterDescription
Disable XML To JSON Auto ConvertWhen checked, XML responses are not automatically converted into JSON format.
Encoding TypeRequests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response.
Expected Bucket OwnerThe account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
MarkerMarker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket.
Max KeysSets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.
PrefixLimits the response to keys that begin with the specified prefix.
Request PayerConfirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. For information about downloading objects from requester pays buckets, see Downloading Objects in Requestor Pays Buckets in the Amazon S3 User Guide.

Example Output

{
"Contents": [
{
"ETag": "\"70ee1738b6b21e2c8a43f3a5ab0eee71\"",
"Key": "example1.jpg",
"LastModified": "2014-11-21T19:40:05.000Z",
"Owner": {
"DisplayName": "myname",
"ID": "12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
},
"Size": 11,
"StorageClass": "STANDARD"
},
{
"ETag": "\"9c8af9a76df052144598c115ef33e511\"",
"Key": "example2.jpg",
"LastModified": "2013-11-15T01:10:49.000Z",
"Owner": {
"DisplayName": "myname",
"ID": "12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
},
"Size": 713193,
"StorageClass": "STANDARD"
}
],
"NextMarker": "eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ=="
}

Workflow Library Example

S3 List Objects with Aws and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop