Hostinger Python SDK¶
A small, typed Python client for the Hostinger Domains and DNS API. It works in sync and async code, waits and retries when Hostinger rate limits you, and gives you plain dataclasses instead of raw JSON.
from hostinger_sdk import Hostinger
with Hostinger("API_TOKEN") as hs:
hs.dns.point("example.com", "shop", "203.0.113.10")
That call makes shop.example.com resolve to 203.0.113.10, replacing any A records shop had before.
The package is on PyPI as hostinger-python-sdk and is imported as hostinger_sdk, so it does not clash with other Hostinger packages. It needs Python 3.10 or newer.
Where to start¶
Set up a virtual environment, install the package with pip, uv or Poetry, and check that it imports.
Create a token in hPanel and keep it safe.
Write your first script: list your domains, read a zone and point a subdomain at a server.
Pass settings in code, through HOSTINGER_* environment variables or from a TOML, YAML or JSON file.
Record sets, every record method and the shortcuts.
Validate changes before saving, roll a zone back to a snapshot, or reset it to Hostinger’s defaults.
Portfolio, availability, name servers, transfer lock, privacy protection and forwarding.
Every public class, method and exception with its signature.
What the SDK covers¶
DNS: list and check records, add, replace one or many record sets, delete whole sets or single values.
DNS shortcuts:
point,unpoint,aliasandset_txt.Safety nets: validate records without saving, list zone snapshots, restore one, or reset the zone.
Domains: portfolio, details, availability across TLDs, name servers, transfer lock, privacy protection and domain forwarding.
Any other Hostinger endpoint (VPS, billing and more) through
request(), with the same authentication, retries and errors.Typed errors with Hostinger’s
correlation_idand per field messages.Automatic retries for rate limits, server errors and dropped connections, only where a retry is safe.
Settings through goodconf: code, environment variables or a config file.
Every message the SDK prints lives in a YAML file you can translate.
It has three siblings with the same shape: the GoDaddy, Namecheap and DigitalOcean SDKs. dns.point("example.com", "shop", ip) does the same thing in all four.