Skip to content
Start here

Get quota and availability

client.speed.availabilities.list(AvailabilityListParams { zone_id } params, RequestOptionsoptions?): Availability { quota, regions, regionsPerPlan }
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
params: AvailabilityListParams { zone_id }
zone_id: string

Identifier.

maxLength32
ReturnsExpand Collapse
Availability { quota, regions, regionsPerPlan }
quota?: Quota { plan, quotasPerPlan, remainingSchedules, 2 more }
plan?: string

Cloudflare plan.

quotasPerPlan?: QuotasPerPlan { value }

The number of tests available per plan.

value?: Value { business, enterprise, free, pro }

Counts per account plan.

business?: number
enterprise?: number
free?: number
pro?: number
remainingSchedules?: number

The number of remaining schedules available.

remainingTests?: number

The number of remaining tests available.

scheduleQuotasPerPlan?: ScheduleQuotasPerPlan { value }

The number of schedules available per plan.

value?: Value { business, enterprise, free, pro }

Counts per account plan.

business?: number
enterprise?: number
free?: number
pro?: number
regions?: Array<LabeledRegion { label, value } >
label?: string
value?: "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"
regionsPerPlan?: RegionsPerPlan { business, enterprise, free, pro }

Available regions.

business?: Array<LabeledRegion { label, value } >
label?: string
value?: "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?: Array<LabeledRegion { label, value } >
label?: string
value?: "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?: Array<LabeledRegion { label, value } >
label?: string
value?: "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?: Array<LabeledRegion { label, value } >
label?: string
value?: "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 Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const availability = await client.speed.availabilities.list({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(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"
        }
      ]
    }
  }
}