# Usage # Zone ## Get DNS Record Usage `client.dns.usage.zone.get(ZoneGetParamsparams, RequestOptionsoptions?): ZoneGetResponse` **get** `/zones/{zone_id}/dns_records/usage` Get the current DNS record usage for a zone, including the number of records and the quota limit. ### Parameters - `params: ZoneGetParams` - `zone_id: string` Identifier. ### Returns - `ZoneGetResponse` - `record_quota: number | null` Maximum number of DNS records allowed for the zone. Null if using account-level quota. - `record_usage: number` Current number of DNS records in the zone. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const zone = await client.dns.usage.zone.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(zone.record_quota); ``` #### Response ```json { "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": { "record_quota": 200, "record_usage": 150 } } ``` ## Domain Types ### Zone Get Response - `ZoneGetResponse` - `record_quota: number | null` Maximum number of DNS records allowed for the zone. Null if using account-level quota. - `record_usage: number` Current number of DNS records in the zone. # Account ## Get DNS Record Usage for Account `client.dns.usage.account.get(AccountGetParamsparams, RequestOptionsoptions?): AccountGetResponse` **get** `/accounts/{account_id}/dns_records/usage` Get the current DNS record usage and quota for an account. May include internal DNS usage and quota. ### Parameters - `params: AccountGetParams` - `account_id: string` Identifier. ### Returns - `AccountGetResponse` - `record_quota: number | null` Maximum number of DNS records allowed across all public zones in the account. Null if using zone-level quota. - `record_usage: number` Current number of DNS records across all public zones in the account. - `internal_record_quota?: number` Maximum number of DNS records allowed across all internal zones in the account. Only present if internal DNS is enabled. - `internal_record_usage?: number` Current number of DNS records across all internal zones in the account. Only present if internal DNS is enabled. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const account = await client.dns.usage.account.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(account.record_quota); ``` #### Response ```json { "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": { "record_quota": 1000000, "record_usage": 5000, "internal_record_quota": 1000000, "internal_record_usage": 5000 } } ``` ## Domain Types ### Account Get Response - `AccountGetResponse` - `record_quota: number | null` Maximum number of DNS records allowed across all public zones in the account. Null if using zone-level quota. - `record_usage: number` Current number of DNS records across all public zones in the account. - `internal_record_quota?: number` Maximum number of DNS records allowed across all internal zones in the account. Only present if internal DNS is enabled. - `internal_record_usage?: number` Current number of DNS records across all internal zones in the account. Only present if internal DNS is enabled.