--- title: "Use the S3-compatible API" description: "Connect to E2E Object Storage from Python with the MinIO SDK, and list, upload, and remove objects in code." content_type: "how-to" product: "object-storage" platform: "MyAccount" url: "/myaccount/object-storage/how-to/use-the-s3-compatible-api/" topic: ["create-and-connect"] relationships: {"requires":["/myaccount/object-storage/how-to/generate-an-access-key/"]} --- # Use the S3-compatible API E2E Object Storage supports any S3-compatible SDK; E2E recommends a MinIO SDK for the smoothest experience. The examples use Python. You need a bucket and an access key first; see [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). ## Install the SDK and connect ```bash frame="none" pip install minio ``` ```python from minio import Minio client = Minio( "objectstore.e2enetworks.net", # Delhi; use "in-south1-objectstore.e2enetworks.net" for a Chennai bucket access_key="", secret_key="", secure=True, ) ``` ## List, upload, and download objects ```python # List objects in a bucket for obj in client.list_objects("", recursive=True): print(obj.object_name, obj.size) # Upload a file client.fput_object("", "", "") # Download a file client.fget_object("", "", "") # Download only a byte range of a file, instead of the whole object client.get_object("", "", offset=, length=) ``` Run the list loop first to check the connection. It prints each object's name and its size in bytes, one per line: ```text report.pdf 1258291 logs/app-2026-09-22.gz 48213 ``` Nothing printed means the bucket is empty; an access error means the key has no role on it. ## Remove an object ```python client.remove_object("", "") ``` Remove every object under a prefix in one call instead of one at a time: ```python names = (obj.object_name for obj in client.list_objects("", prefix="", recursive=True)) for error in client.remove_objects("", names): print("Deletion error:", error) ``` ## Generate a presigned URL in code ```python from datetime import timedelta url = client.presigned_get_object("", "", expires=timedelta(days=)) ``` The SDK has an equivalent call for an upload link instead of a download one; see [Share an object with a presigned URL](/myaccount/object-storage/how-to/share-an-object-with-a-presigned-url/) for the same thing from the dashboard, and the expiry limit that applies either way. ## Supported operations E2E Object Storage supports these object-level operations, the everyday work an S3-compatible SDK does. For bucket-level work, see [Creating and listing buckets](#creating-and-listing-buckets). | Operation | What it does | | ------------------------ | ----------------------------------------------------- | | list_objects | List the objects in a bucket | | get_object | Download an object | | remove_object | Delete an object | | put_object | Upload an object | | copy_object | Copy an object within a bucket | | remove_objects | Delete several objects at once | | fput_object | Upload a file as an object | | fget_object | Download an object to a file | | get_partial_object | Download a byte range of an object | | select_object_content | Query an object's contents with an SQL-like statement | | remove_incomplete_upload | Remove a multipart upload that never finished | | presigned_get_object | Make a presigned download URL | | presigned_put_object | Make a presigned upload URL | The MinIO SDKs expose each of these as a method; the code in [List, upload, and download objects](#list-upload-and-download-objects) uses a few of them. ## Creating and listing buckets An SDK with an access key works on the objects in the buckets that key is attached to. To create a bucket or list every bucket on your account, use the dashboard, or the MyAccount API with your [account API key](/myaccount/object-storage/concepts/s3-compatibility/#creating-and-listing-buckets), which is separate from an access key. See [S3 compatibility](/myaccount/object-storage/concepts/s3-compatibility/) for the complete list of what carries over from S3 and what does not. If a call fails with an access error, check the key's role on that bucket in [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/), or see [Troubleshooting E2E Object Storage](/myaccount/object-storage/troubleshooting/object-storage/).