Skip to main content
def get_signed_url(
    gcs_uri: str,
    *,
    expiration_minutes: int = 60,
    api_key: Optional[str] = None,
) -> str:

source code

Generate a signed URL for a GCS object.Creates a time-limited, publicly accessible URL for downloading a Google Cloud Storage object without requiring authentication. Arguments:
  • gcs_uri - The GCS URI of the object (e.g., “gs://bucket-name/path/to/object”).
  • expiration_minutes - How long the signed URL should remain valid, in minutes.
  • api_key - If specified, unify API key to be used. Defaults to the value
Returns: A signed URL string that can be used to download the object via HTTP GET. Raises:
  • RequestError: If the request fails (e.g., object not found, invalid URI).