Skip to content
Start here

Get quota and availability

speed.availabilities.list(AvailabilityListParams**kwargs) -> Availability
GET/zones/{zone_id}/speed_api/availabilities

Retrieves quota for all plans, as well as the current zone quota.

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)
Zone Settings WriteZone Settings Read
ParametersExpand Collapse
zone_id: str

Identifier.

maxLength32
ReturnsExpand Collapse
class Availability:
quota: Optional[Quota]
plan: Optional[str]

Cloudflare plan.

quotas_per_plan: Optional[QuotaQuotasPerPlan]

The number of tests available per plan.

value: Optional[QuotaQuotasPerPlanValue]

Counts per account plan.

business: Optional[int]
enterprise: Optional[int]
free: Optional[int]
pro: Optional[int]
remaining_schedules: Optional[float]

The number of remaining schedules available.

remaining_tests: Optional[float]

The number of remaining tests available.

schedule_quotas_per_plan: Optional[QuotaScheduleQuotasPerPlan]

The number of schedules available per plan.

value: Optional[QuotaScheduleQuotasPerPlanValue]

Counts per account plan.

business: Optional[int]
enterprise: Optional[int]
free: Optional[int]
pro: Optional[int]
regions: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
regions_per_plan: Optional[RegionsPerPlan]

Available regions.

business: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
enterprise: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
free: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
pro: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"

Get quota and availability

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
availability = client.speed.availabilities.list(
    zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(availability.quota)
{
  "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": {
    "quota": {
      "plan": "free",
      "quotasPerPlan": {
        "value": {
          "business": 1,
          "enterprise": 1,
          "free": 1,
          "pro": 1
        }
      },
      "remainingSchedules": 1,
      "remainingTests": 30,
      "scheduleQuotasPerPlan": {
        "value": {
          "business": 1,
          "enterprise": 1,
          "free": 1,
          "pro": 1
        }
      }
    },
    "regions": [
      {
        "label": "Iowa, USA",
        "value": "us-central1"
      }
    ],
    "regionsPerPlan": {
      "business": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "enterprise": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "free": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "pro": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ]
    }
  }
}
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": {
    "quota": {
      "plan": "free",
      "quotasPerPlan": {
        "value": {
          "business": 1,
          "enterprise": 1,
          "free": 1,
          "pro": 1
        }
      },
      "remainingSchedules": 1,
      "remainingTests": 30,
      "scheduleQuotasPerPlan": {
        "value": {
          "business": 1,
          "enterprise": 1,
          "free": 1,
          "pro": 1
        }
      }
    },
    "regions": [
      {
        "label": "Iowa, USA",
        "value": "us-central1"
      }
    ],
    "regionsPerPlan": {
      "business": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "enterprise": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "free": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ],
      "pro": [
        {
          "label": "Iowa, USA",
          "value": "us-central1"
        }
      ]
    }
  }
}