Python Namesilo Module’s documentation!

Python Namesilo is API wrapper for Namesilo service. Currently we support fallowing operations:

  • registerDomain
  • renewDomain
  • checkRegisterAvailability
  • listDomains
  • getDomainInfo
  • contactList
  • contactAdd
  • getAccountBalance
  • addAccountFunds
  • getPrices

https://www.namesilo.com/Support/API-Manager

class namesilo.core.NameSilo(token, sandbox: bool = True)

Creating Namesilo object with given token

Parameters:
  • token – access token from namesilo.com
  • sandbox – true or false
add_account_funds(amount, payment_id)

Adding funds to Namesilo account

Parameters:
  • amount (float) – amount to add
  • payment_id (int) – ID of payment (credit card)
Returns:

Status and amount after adding funds, example: (True, 150.00)

Return type:

tuple

add_contact(contact)

Adding new contact for current account

Parameters:contact (ContactModel) –
Returns:Status for adding contact
Return type:bool
add_dns_records(domain_name, record_type, record_host, record_value, ttl=7207)

Add DNS record to specified domain name

Parameters:
  • domain_name (str) – Domain name for adding DNS record
  • record_type (str) – The type of resources record to add
  • record_host (str) – The hostname for the new record
  • record_value (str) – The value for the resource record
  • ttl (int) – The TTL for the new record
Returns:

Returns record id for specified domain record

Return type:

int

add_domain_privacy(domain_name)

Adds privacy to specified domain name

Parameters:domain_name (str) – Domain name for adding privacy
Returns:Status of action
Return type:bool
auto_renew_domain(domain_name: str)

Set auto-renew to specific domain

Parameters:domain_name (str) – Domain name
Returns:Status of action
Return type:bool
change_domain_nameservers(domain, primary_ns, secondary_ns)

Change name server for specified domain

Parameters:
  • domain (str) – Domain name
  • primary_ns (str) – Primary name Server
  • secondary_ns (str) – Secondary name server
Returns:

Status of action

Return type:

bool

check_domain(domain_name)

Check if domain name is available

Parameters:domain_name (str) – Domain name for checking
Returns:Availability of domain
Return type:bool
delete_contact(contact_id)

Delete contact from NameSilo account

Parameters:contact_id (int) – Contact ID
Returns:
Return type:None
get_account_balance()

Returns current account balance

Returns:current account balance
Return type:float
get_domain_info(domain_name)

Returns information about specified domain

Parameters:domain_name (str) – name of domain
Returns:domain information
Return type:DomainInfo
get_prices()

Returns all prices for supported TLDs

Returns:Prices for supported TLDs
Return type:dict
list_contacts()

Returns list of all contacts for current account

Returns:list of all contacts
Return type:list
list_dns_records(domain_name)

List all DNS records for specified domain name

Parameters:domain_name (str) – Domain name for listing DNS records
Returns:Returns a list of DNS records for specified domain name
Return type:list
list_domains()

List all domains registered with current account

Returns:list of registered domains
Return type:list
lock_domain(domain_name: str)
Parameters:domain_name (str) –
Returns:
register_domain(domain_name, years=1, auto_renew=0, private=0)

Register a new domain name

Parameters:
  • domain_name (str) – name of domain
  • years (int) – how long to register domain
  • auto_renew (int) – turn on or off auto-renewal option
  • private (int) – hide your private information (WHOIS)
Returns:

status of domain registration

Return type:

bool

remove_auto_renew_domain(domain_name: str)

Remove auto-renew to specific domain

Parameters:domain_name (str) – Domain name
Returns:Status of action
Return type:bool
remove_domain_privacy(domain_name)

Removes privacy for specified domain name

Parameters:domain_name (str) – Domain name for removing privacy
Returns:Status of action
Return type:bool
renew_domain(domain_name, years=1)

Renew domain name

Parameters:
  • domain_name (str) – domain name for renewal
  • years (int) –
Returns:

status of renewal

Return type:

bool

unlock_domain(domain_name: str)
Parameters:domain_name (str) –
Returns:
update_contact(contact: namesilo.core.ContactModel)

Update existing contact with new information

Parameters:contact (ContactModel) – new contact information
Returns:status of action
Return type:bool
update_dns_records(domain_name, record_id, record_host, record_value, ttl=7207)

Update an existing DNS resource record

Parameters:
  • domain_name (str) – Domain name for updating DNS record
  • record_id (str) – The unique ID of the resource record
  • record_host (str) – The hostname to use
  • record_value (str) – The value for the resource record
  • ttl (int) – The TTL for this record
Returns:

Returns record id for updated domain record

Return type:

int

class namesilo.core.ContactModel(**kwargs)

Model for manipulating NameSilo contacts

Parameters:
  • contact_id (str) – Contact ID
  • first_name (str) – First Name
  • last_name (str) – Last Name
  • address (str) – Address
  • city (str) – City
  • state (str) – State
  • country (str) – Country
  • email (str) – Email address
  • phone (str) – Telephone number
  • zip (str) – ZIP Code
static convert_contact_model(reply)

Convert standard Namesilo reply to ContactModel

Parameters:reply – Namesilo Contact response
Returns:Populated ContactModel from Namesilo
Return type:ContactModel

Indices and tables