Skip to content
Start here

Storage use

stream.videos.storage_usage(VideoStorageUsageParams**kwargs) -> VideoStorageUsageResponse
GET/accounts/{account_id}/stream/storage-usage

Returns information about an account's storage use.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Stream WriteStream Read
ParametersExpand Collapse
account_id: str

The account identifier tag.

maxLength32
creator: Optional[str]

A user-defined identifier for the media creator.

maxLength64
ReturnsExpand Collapse
class VideoStorageUsageResponse:
creator: Optional[str]

A user-defined identifier for the media creator.

maxLength64
total_storage_minutes: Optional[int]

The total minutes of video content stored in the account.

total_storage_minutes_limit: Optional[int]

The storage capacity alloted for the account.

video_count: Optional[int]

The total count of videos associated with the account.

Storage use

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
response = client.stream.videos.storage_usage(
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(response.video_count)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "creator": "creator-id_abcde12345",
    "totalStorageMinutes": 0,
    "totalStorageMinutesLimit": 0,
    "videoCount": 0
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "creator": "creator-id_abcde12345",
    "totalStorageMinutes": 0,
    "totalStorageMinutesLimit": 0,
    "videoCount": 0
  }
}