List domains
client.Registrar.Domains.List(ctx, query) (*SinglePage[Domain], error)
GET/accounts/{account_id}/registrar/domains
List domains handled by Registrar.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
List domains
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/registrar"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
page, err := client.Registrar.Domains.List(context.TODO(), registrar.DomainListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "ea95132c15732412d22c1476fa83f27a",
"available": false,
"can_register": false,
"created_at": "2018-08-28T17:26:26Z",
"current_registrar": "Cloudflare",
"expires_at": "2019-08-28T23:59:59Z",
"locked": false,
"registrant_contact": {
"address": "123 Sesame St.",
"city": "Austin",
"country": "US",
"first_name": "John",
"last_name": "Appleseed",
"organization": "Cloudflare, Inc.",
"phone": "+1 123-123-1234",
"state": "TX",
"zip": "12345",
"id": "ea95132c15732412d22c1476fa83f27a",
"address2": "Suite 430",
"email": "user@example.com",
"fax": "123-867-5309"
},
"registry_statuses": "ok,serverTransferProhibited",
"supported_tld": true,
"transfer_in": {
"accept_foa": "needed",
"approve_transfer": "unknown",
"can_cancel_transfer": true,
"disable_privacy": "ok",
"enter_auth_code": "needed",
"unlock_domain": "ok"
},
"updated_at": "2018-08-28T17:26:26Z"
}
],
"success": true,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}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"
}
}
],
"result": [
{
"id": "ea95132c15732412d22c1476fa83f27a",
"available": false,
"can_register": false,
"created_at": "2018-08-28T17:26:26Z",
"current_registrar": "Cloudflare",
"expires_at": "2019-08-28T23:59:59Z",
"locked": false,
"registrant_contact": {
"address": "123 Sesame St.",
"city": "Austin",
"country": "US",
"first_name": "John",
"last_name": "Appleseed",
"organization": "Cloudflare, Inc.",
"phone": "+1 123-123-1234",
"state": "TX",
"zip": "12345",
"id": "ea95132c15732412d22c1476fa83f27a",
"address2": "Suite 430",
"email": "user@example.com",
"fax": "123-867-5309"
},
"registry_statuses": "ok,serverTransferProhibited",
"supported_tld": true,
"transfer_in": {
"accept_foa": "needed",
"approve_transfer": "unknown",
"can_cancel_transfer": true,
"disable_privacy": "ok",
"enter_auth_code": "needed",
"unlock_domain": "ok"
},
"updated_at": "2018-08-28T17:26:26Z"
}
],
"success": true,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}