API Reference

class namecom.Auth(username, token)

The class for http basic authentication. Used by api class to do authenticate request. Could be found at token manage page: https://www.name.com/account/settings/api

Parameters:
  • username (string) – username from token manage page
  • token (string) – token value from token manage page
class namecom.DnsApi(domainName, auth, use_test_env=False)

The api class for DNS. More details about each parameter here. Official namecom documentation : https://www.name.com/api-docs/DNS

Parameters:
  • domainName (string) – domain that dns records belongs to
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_records(page=1, perPage=1000)

Returns all records for a zone.

Parameters:
  • page (int) – which page to return
  • perPage (int) – the number of records to return per request
Returns:

a response result instance with parsed response info

Return type:

ListRecordsResult

get_record(id)

Returns details about an individual record.

Parameters:id (int) – the server-assigned unique identifier for this record
Returns:a response result instance with parsed response info
Return type:GetRecordResult
create_record(host, type, answer, ttl=300, priority=None)

Creates a new record in the zone.

Parameters:
  • host (string) – hostname relative to the zone
  • type (string) – dns record type
  • answer (string) – dns record answer
  • ttl (int) – dns record ttl
  • priority (int) – dns record priority
Returns:

a response result instance with parsed response info

Return type:

CreateRecordResult

update_record(id, host=None, type=None, answer=None, ttl=300, priority=None)

Replaces the record with the new record that is passed.

Parameters:
  • id (int) – the server-assigned unique identifier for this record
  • host (string) – hostname relative to the zone
  • type (string) – dns record type
  • answer (string) – dns record answer
  • ttl (int) – dns record ttl
  • priority (int) – dns record priority
Returns:

a response result instance with parsed response info

Return type:

UpdateRecordResult

delete_record(id)

Deletes a record from the zone.

Parameters:id (int) – the server-assigned unique identifier for this record
Returns:a response result instance with parsed response info
Return type:DeleteRecordResult
class namecom.DnssecApi(domainName, auth, use_test_env=False)

The api class for Domain Name System Security Extensions (DNSSEC). More details about each parameter here. Official namecom documentation : https://www.name.com/api-docs/DNSSECs

Parameters:
  • domainName (string) – domain to manipulate dnssec on
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_dnssecs(page=1, perPage=1000)

Lists all of the DNSSEC keys registered with the registry.

Parameters:
  • page (int) – which page to return
  • perPage (int) – the number of records to return per request
Returns:

a response result instance with parsed response info

Return type:

ListDnssecsResult

get_dnssec(digest)

Retrieves the details for a key registered with the registry.

Parameters:digest (string) – Digest is the digest for the DNSKEY RR to retrieve.
Returns:a response result instance with parsed response info
Return type:GetDnssecResult
create_dnssec(keyTag, algorithm, digestType, digest)

Registers a DNSSEC key with the registry.

Parameters:
  • keyTag (int) – key tag value of the DNSKEY RR
  • algorithm (int) – an integer identifying the algorithm used for signing
  • digestType (int) – an integer identifying the algorithm used to create the digest
  • digest (string) – a digest of the DNSKEY RR that is registered with the registry
Returns:

a response result instance with parsed response info

Return type:

CreateDnssecResult

delete_dnssec(digest)

Removes a DNSSEC key from the registry.

Parameters:digest (string) – a digest of the DNSKEY RR that is registered with the registry
Returns:a response result instance with parsed response info
Return type:DeleteDnssecResult
class namecom.DomainApi(auth, use_test_env=False)

The api class for Domain. More details about each parameter here. Official namecom documentation : https://www.name.com/api-docs/domain

Parameters:
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_domains(page=1, perPage=1000)

Returns all domains in the account. It omits some information that can be retrieved from GetDomain.

Parameters:
  • page (int) – which page to return
  • perPage (int) – the number of records to return per request
Returns:

a response result instance with parsed response info

Return type:

ListDomainsResult

get_domain(domainName)

Returns details about a specific domain

Parameters:domainName (string) – name of the domain to retrieve
Returns:a response result instance with parsed response info
Return type:GetDomainResult
create_domain(domain, purchasePrice, purchaseType='registration', years=1, tldRequirements=None, promoCode=None)
Parameters:
  • domain (Domain) – the domain object to create
  • purchasePrice (float) – the amount to pay for the domain
  • purchaseType (string) – PurchaseType defaults to “registration” but should be copied from the result of a search command otherwise
  • years (int) – how many years to register the domain for.
  • tldRequirements (dict[string -> string]) – TLDRequirements is a way to pass additional data that is required by some registries
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

CreateDomainResult

enable_autorenew(domainName)

Enables the domain to be automatically renewed when it gets close to expiring.

Parameters:domainName (string) – name of the domain to retrieve
Returns:a response result instance with parsed response info
Return type:EnableAutorenewResult
disable_autorenew(domainName)

Disables automatic renewals, thus requiring the domain to be renewed manually.

Parameters:domainName (string) – name of the domain to retrieve
Returns:a response result instance with parsed response info
Return type:DisableAutorenewResult
renew_domain(domainName, purchasePrice, years=1, promoCode=None)

Renew a domain. Purchase_price is required if the renewal is not regularly priced.

Parameters:
  • domainName (string) – name of the domain to renew
  • purchasePrice (float) – the amount to pay for the domain renewal
  • years (int) – how many years to renew the domain for
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

RenewDomainResult

get_auth_code_for_domain(domainName)

Returns the Transfer Authorization Code for the domain.

Parameters:domainName (string) – name of the domain to renew
Returns:a response result instance with parsed response info
Return type:GetAuthCodeForDomainResult
purchase_privacy(domainName, purchasePrice, years=1, promoCode=None)

Add Whois Privacy protection to a domain or will an renew existing subscription.

Parameters:
  • domainName (string) – name of the domain to renew
  • purchasePrice (float) – the amount to pay for the domain renewal
  • years (int) – how many years to renew the domain for
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

PurchasePrivacyResult

set_nameservers(domainName, nameservers)

Set the nameservers for the Domain.

Parameters:
  • domainName (string) – name of the domain to set the nameservers for
  • nameservers ([]string) – a list of the nameservers to set
Returns:

a response result instance with parsed response info

Return type:

SetNameserversResult

set_contacts(domainName, contacts)

“Set the contacts for the Domain.

Parameters:
  • domainName (string) – name of the domain to set the contacts for
  • contacts (Contacts) – contacts to set
Returns:

a response result instance with parsed response info

Return type:

SetContactsResult

lock_domain(domainName)

Lock a domain so that it cannot be transfered to another registrar.

Parameters:domainName (string) – name of the domain to lock
Returns:a response result instance with parsed response info
Return type:LockDomainResult
unlock_domain(domainName)

Unlock a domain so that it can be transfered to another registrar.

Parameters:domainName (string) – name of the domain to unlock
Returns:a response result instance with parsed response info
Return type:UnlockDomainResult
check_availability(domainNames, promoCode=None)

Check a list of domains to see if they are purchaseable. A Maximum of 50 domains can be specified.

Parameters:
  • domainNames ([]string) – the list of domains to check if they are available
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

CheckAvailabilityResult

search(keyword, tldFilter=None, timeout=1000, promoCode=None)

Perform a search for specified keywords.

Parameters:
  • keyword (string) – the search term to search for
  • tldFilter ([]string) – TLDFilter will limit results to only contain the specified TLDs
  • timeout (int) – Timeout is a value in milliseconds on how long to perform the search for
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

SearchResult

search_stream(keyword, tldFilter=None, timeout=1000, promoCode=None)

Return JSON encoded SearchResults as they are recieved from the registry

Parameters:
  • keyword (string) – the search term to search for
  • tldFilter ([]string) – TLDFilter will limit results to only contain the specified TLDs
  • timeout (int) – Timeout is a value in milliseconds on how long to perform the search for
  • promoCode (string) – PromoCode is not yet implemented
Returns:

a response result instance with parsed response info

Return type:

SearchStreamResult

class namecom.EmailForwardingApi(domainName, auth, use_test_env=False)

The api class for name.com EmailForwarding. More details about each parameter here. Official namecom documentation : https://www.name.com/api-docs/EmailForwardings

Parameters:
  • domainName (string) – domain that dns records belongs to
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_email_forwardings(perPage=1000, page=1)

Returns a pagenated list of email forwarding entries for a domain.

Parameters:
  • perPage (int) – the number of records to return per request
  • page (int) – which page to return
Returns:

a response result instance with parsed response info

Return type:

ListEmailForwardingsResult

get_mail_forwarding(emailBox)

Returns an email forwarding entry

Parameters:emailBox (string) – which email box to retrieve
Returns:a response result instance with parsed response info
Return type:GetEmailForwardingResult
create_email_forwarding(emailBox, emailTo)

Creates an email forwarding entry.

If this is the first email forwarding entry, it may modify the MX records for the domain accordingly.

Parameters:
  • emailBox (string) – the user portion of the email address to forward
  • emailTo (string) – the entire email address to forward email to
Returns:

a response result instance with parsed response info

Return type:

GetEmailForwardingResult

update_email_forwarding(emailBox, emailTo)

Updates which email address the email is being forwarded to.

Parameters:
  • emailBox (string) – the user portion of the email address to forward
  • emailTo (string) – the entire email address to forward email to
Returns:

a response result instance with parsed response info

Return type:

GetEmailForwardingResult

delete_email_forwarding(emailBox)

Deletes the email forwarding entry.

Parameters:emailBox (string) – the user portion of the email address to forward
Returns:a response result instance with parsed response info
Return type:DeleteEmailForwardingResult
class namecom.TransferApi(auth, use_test_env=False)

The api class for Domain Transfer. More details about each parameter here. Official namecom documentation : https://www.name.com/api-docs/Transfers

Parameters:
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_transfers(page=1, perPage=1000)

Lists all pending transfer in requests.

To get the information related to a non-pending transfer, you can use the GetTransfer function for that.

Returns:a response result instance with parsed response info
Return type:ListTransferResult
get_transfer(domainName)

Gets details for a transfer request.

Parameters:domainName (str) – DomainName is the domain you want to get the transfer information for
Returns:a response result instance with parsed response info
Return type:GetTransferResult
create_transfer(domainName, authCode, purchasePrice, privacyEnabled=False, promoCode=None)

Purchases a new domain transfer request.

Parameters:
  • domainName (str) – DomainName is the domain you want to transfer to Name.com
  • authCode (str) – AuthCode is the authorization code for the transfer
  • purchasePrice (float) – the amount to pay for the transfer of the domain
  • privacyEnabled (bool) – a flag on whether to purchase Whois Privacy with the transfer
  • promoCode (str) – PromoCode is not implemented yet
Returns:

a response result instance with parsed response info

Return type:

CreateTransferResult

cancel_transfer(domainName)

Cancels a pending transfer request and refunds the amount to account credit.

Parameters:domainName (str) – DomainName is the domain to be transfered to Name.com
Returns:a response result instance with parsed response info
Return type:CancelTransferResult
class namecom.URLForwardingApi(domainName, auth, use_test_env=False)
Parameters:
  • domainName (str) – domain name to manipulate url forwarding for
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_url_forwardings(page=1, perPage=1000)

Returns a pagenated list of URL forwarding entries for a domain.

Parameters:
  • page (int) – which page to return
  • perPage (int) – the number of records to return per request
Returns:

a response result instance with parsed response info

Return type:

ListURLForwardingsResult

get_url_forwarding(host)

Returns an URL forwarding entry.

Parameters:host (str) – the part of the domain name before the domain
Returns:a response result instance with parsed response info
Return type:GetURLForwardingResult
create_url_forwarding(host, forwardsTo, type=None, title=None, meta=None)

Creates an URL forwarding entry.

If this is the first URL forwarding entry, it may modify the A records for the domain accordingly.

Parameters:
  • host (str) – the entirety of the hostname. i.e. www.example.org
  • forwardsTo (str) – the URL this host will be forwarded to
  • type (str) – the type of forwarding
  • title (str) – the title for the html page to use if the type is masked
  • meta (str) – the meta tags to add to the html page if the type is masked
Returns:

a response result instance with parsed response info

Return type:

CreateURLForwardingResult

update_url_forwarding(host, forwardsTo, type=None, title=None, meta=None)

Updates which URL the host is being forwarded to.

Parameters:
  • host (str) – the entirety of the hostname. i.e. www.example.org
  • forwardsTo (str) – the URL this host will be forwarded to
  • type (str) – the type of forwarding
  • title (str) – the title for the html page to use if the type is masked
  • meta (str) – the meta tags to add to the html page if the type is masked
Returns:

a response result instance with parsed response info

Return type:

UpdateURLForwardingResult

delete_url_forwarding(host)

Deletes the URL forwarding entry.

Parameters:host (str) – the entirety of the hostname. i.e. www.example.org
Returns:a response result instance with parsed response info
Return type:DeleteURLForwardingResult
class namecom.VanityNameserverApi(domainName, auth, use_test_env=False)
Parameters:
  • domainName (str) – domain name to manipulate nameserver for
  • auth (Auth) – http authentication to use
  • use_test_env (bool) – whether runs in test environment
list_vanity_nameservers(page=1, perPage=1000)

Lists all nameservers registered with the registry.

It omits the IP addresses from the response. Those can be found from calling GetVanityNameserver.

Parameters:
  • page (int) – which page to return
  • perPage (int) – the number of records to return per request
Returns:

a response result instance with parsed response info

Return type:

ListVanityNameserversResult

get_vanity_nameserver(hostname)

GetVanityNameserver gets the details for a vanity nameserver registered with the registry.

Parameters:hostname (str) – the hostname of the nameserver
Returns:a response result instance with parsed response info
Return type:GetVanityNameserverResult
create_vanity_nameserver(hostname, ips)

Registers a nameserver with the registry.

Parameters:
  • hostname (str) – the hostname of the nameserver
  • ips ([]str) – a list of IP addresses that are used for glue records for this nameserver
Returns:

a response result instance with parsed response info

Return type:

CreateVanityNameserverResult

update_vanity_nameserver(hostname, ips)

Update the glue record IP addresses at the registry.

Parameters:
  • hostname (str) – the domain to for the vanity nameserver
  • ips ([]str) – a list of IP addresses that are used for glue records for this nameserver
Returns:

a response result instance with parsed response info

Return type:

UpdateVanityNameserverResult

delete_vanity_nameserver(hostname)

Unregisteres the nameserver at the registry.

This might fail if the registry believes the nameserver is in use.

Parameters:hostname (str) – the domain of the vanity nameserver to delete
Returns:a response result instance with parsed response info
Return type:DeleteVanityNameserverResult