selectObjectContent method
Filters and returns the contents of an Object Storage object using an S3 Select request.
Warning
To be able to make S3 Select requests, contact supports3:GetObject permission. For more information, see Bucket policy.
Features of objects you can query:
-
Objects in CSV, JSON, and Parquet formats are supported.
-
UTF-8 encoded objects are supported.
-
GZIP and BZIP2 compression methods are supported for CSV files. For Parquet files, columnar compression with GZIP, Snappy, and ZSTD is supported.
-
Objects can be protected by server-side encryption.
For objects that are encrypted with managed encryption keys stored in YC Key Management Service (SSE-KMS), server-side encryption is transparent. This means you do not need to specify anything else.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
POST /{bucket}/{key}?select&select-type=2 HTTP/2
Path parameters
| Parameter | Description |
|---|---|
bucket |
Bucket name. |
key |
Object key. |
Request parameters
| Parameter | Description |
|---|---|
select |
Required parameter that indicates the type of operation. |
select-type |
Optional parameter that indicates the type of query. |
Headers
Use the appropriate common headers in your request.
Data schema
Request parameters are provided in XML format:
<ListBucketResult
xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<KeyCount>1</KeyCount>
<Name>my-sample-bucket</Name>
<Prefix></Prefix>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>text.txt</Key>
<LastModified>2025-05-15T07:23:08.030Z</LastModified>
<Owner>
<ID>ajegtlf2q28a********</ID>
<DisplayName>ajegtlf2q28a********</DisplayName>
</Owner>
<ETag>"f75a361db63aa4722fb8e083********"</ETag>
<Size>103</Size>
<StorageClass>STANDARD</StorageClass>
<TagSet></TagSet>
</Contents>
</ListBucketResult>
| Tag | Description |
|---|---|
SelectObjectContentRequest |
Root-level tag for providing request parameters. Required: yes. Path: /SelectObjectContentRequest. |
Expression |
SQL expression used to query object data. Data type: string. Required: yes. Path: /SelectObjectContentRequest/Expression. |
ExpressionType |
Expression type used for the request. Data type: string. Acceptable values: SQL.Required: yes. Path: /SelectObjectContentRequest/ExpressionType. |
InputSerialization |
Description of data format in the requested object. Data type: InputSerialization.Required: yes. Path: /SelectObjectContentRequest/InputSerialization. |
OutputSerialization |
Description of the returned data format. Data type: OutputSerialization.Required: yes. Path: /SelectObjectContentRequest/OutputSerialization. |
RequestProgress |
Tag that indicates whether regular notifications on the request progress are enabled. Data type: RequestProgress.Required: no. Path: /SelectObjectContentRequest/RequestProgress. |
ScanRange |
Tag that specifies the byte range of the object to get the records from. A record is processed when its first byte is within the range. It is used only for objects in CSV format. Data type: ScanRange.Required: no. Path: /SelectObjectContentRequest/ScanRange. |
Response
Headers
Responses can only contain common headers.
Response codes
For a list of possible responses, see Responses.
A successful response contains additional data in XML format with the schema described below.
Data schema
<ListBucketResult
xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<KeyCount>1</KeyCount>
<Name>my-sample-bucket</Name>
<Prefix></Prefix>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>text.txt</Key>
<LastModified>2025-05-15T07:23:08.030Z</LastModified>
<Owner>
<ID>ajegtlf2q28a********</ID>
<DisplayName>ajegtlf2q28a********</DisplayName>
</Owner>
<ETag>"f75a361db63aa4722fb8e083********"</ETag>
<Size>103</Size>
<StorageClass>STANDARD</StorageClass>
<TagSet></TagSet>
</Contents>
</ListBucketResult>
| Tag | Description |
|---|---|
Payload |
Root-level tag used for providing response parameters. Path: /Payload. |
Cont |
Message indicating the request is being processed. Path: /Payload/Cont. |
End |
Message indicating the request has been processed. Path: /Payload/End. |
Progress |
Information about the request progress. Path: /Payload/Progress. |
Records |
Request result. Path: /Payload/Records. |
Stats |
Statistics on the processed data. It is sent once at the end of the request. Path: /Payload/Stats. |