Access the InterNetworX XML-RPC API via Python

The Domain Hoster InterNetworX (abbr. inwx) offers an XML-RPC interface to access its services. You can even register new domains. Documentation of the XML-RPC API is available for download at (including examples in PHP & Java plus a PDF describing the API).

There is an operational test environment (ote) to learn and test how to use the API without paying for your orders at You need a separate test-account to use it and you can get it on

The available objects to query and modify via XMLRPC can be found on and here is the overview:

  • contact – The handles for your Domain such as registrant, admin-c etc.
  • domain – Your domains
  • nameserver – The nameserver entries (as served by InterNetworX)
  • nameserverset – Sets of nameservers that you can assign to your domains 'en bloc'.
  • accounting - Check your balance, list and download invoices etc.
  • host – This object represents so-called glue records
  • pdf – I'm not sure about this. Maybe you can use it to upload passport scans etc. if a domain registration requires verification.
  • message – Don't know about this one...
  • application – Don't know about this one...

Access the API via Python using python-inwx-xmlrpc

To leverage the use of the XML-RPC via Python, I wrote a Python class: inwx and published it under the GPL license on Github: The class inwx from the module inwx is what you want to use. It largely simplifies the code needed to communicate with the InterNetworX API. What it does is to create a domrobot class from the module inwx for every object you try to access on the XML-RPC API. This is needed as the API exposes its services in the form and not using normal "nested" call methods with dot syntax (e.g. examples.getStateName). Internally, the domrobot class is built by deriving a subclass of xmlrpclib.ServerProxy and reimplementing serveral of its methods.
The module is very elegant as it makes use some magic to bind XML-RPC methods to the inwx object without naming them explicitly (taken from the Python module itself). In addition the inwx module is an example of well done object-oriented inheritance.

The Readme should be your next resource for help. Please post your comments here if you have any questions or contribute to the project if you have good ideas!

Using the API with the inwx class is really simple:

from inwx import inwx
inwx_conn = domrobot("", username, password)

# Request the list of all domains belonging to your account:
print inwx_conn.nameserver.list()

# List your invoices:
print inwx_conn.accounting.listInvoices()

# you can pretty print the output like this:
import json
print json.dumps(inwx_conn.nameserver.list(), indent=2)
# or more human readable like this:
from inwx import prettyprint

Usage examples included in the project are:

  • – To back up all nameserver entries for all your domains.
  • – List previous and create a new contact handle.
  • – Download invoices (only ones you haven't got yet & to a configurable folder).
  • – Realize a DynDNS-like service using the API (doesn't work that well: The minimum TTL is 3600 seconds = 1 hour).
  • – List all domains belonging to your account.
  • ` – Print all the nameserver sets for your account.
  • – Enables you to order a new domain from the command line (does not include logic for extended requirements needed for special TLDs...)

DynDNS like service: (and updatedata.xml)

My code has been inspired by Christian Blechert's work. He has published a way to use the API in a Bash script to have regular DNS updates (like a DynDNS service). The bash script is called and is useful on devices such as routers (running open source firmware).
I republished the script in a gist on Github.

The XML file updatedata.xml must hold the account credentials for the customer area of as well as the Unique ID of the DNS entry (subdomain). You can get the UID when changing the value of a dns entry. With the new user interface this is not as easy to find out any more... With the old inwx website this site used to be something like
Off course, you can get the IDs via the API but I didn't work on this for the Bash script. My Python class supports this, however.