Skip to main content

Namecheap Python SDK

PyPI version Downloads Downloads/month Python License: MIT

A modern, friendly Python SDK for the Namecheap API with comprehensive CLI and TUI tools.

๐Ÿš€ Features

[!NOTE] New in v3.0.0: register domains from the CLI โ€” namecheap-cli domain register shows the real cost up front (promo vs. regular price, renewal rate, ICANN fee) and charges your account balance only after you confirm.

Breaking (SDK): domains.register() now requires contact (the API always did; passing nothing simply failed) and drops the auto_renew parameter, which was accepted but never sent โ€” Namecheap's API has no auto-renew switch. Contact objects now serialize correctly in register()/set_contacts(); both were broken for Contact instances before.

  • Modern Python SDK with full type hints and Pydantic models
  • CLI Tool for managing domains and DNS from the terminal
  • TUI Application for visual DNS record management
  • Smart DNS Builder with fluent interface for record management
  • Auto-configuration from environment variables
  • Helpful error messages with troubleshooting guidance
  • IDN & emoji domain support โ€” pass ๐ŸงŠ.to or cafรฉ.com directly, punycode handled automatically
  • Comprehensive logging with beautiful colored output
  • Sandbox support for safe testing

๐ŸŽฏ Quick Start

Requires Python 3.12 or higher

namecheap-python: Core Python SDK Library

# Add as a dependency to your project
uv add namecheap-python
from namecheap import Namecheap

# Initialize (auto-loads from environment)
nc = Namecheap()

# Check domain availability
domains = nc.domains.check("example.com", "coolstartup.io")
for domain in domains:
    if domain.available:
        print(f"โœ… {domain.domain} is available!")

# List your domains
my_domains = nc.domains.list()
for domain in my_domains:
    print(f"{domain.name} expires on {domain.expires}")

# Manage DNS with the builder
nc.dns.set("example.com",
    nc.dns.builder()
    .a("@", "192.0.2.1")
    .a("www", "192.0.2.1")  
    .mx("@", "mail.example.com", priority=10)
    .txt("@", "v=spf1 include:_spf.google.com ~all")
)

namecheap-cli: CLI tool

It was meant as a proof of concept to showcase namecheap-python, but it is a tool that I use

# List domains with beautiful table output

# Run it without install with:
uvx --from 'namecheap-python[cli]' namecheap-cli domain list

# Or install it permanently with:
uv tool install --python 3.12 'namecheap-python[cli]'

# Then run
namecheap-cli domain list

                    Domains (4 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Domain            โ”ƒ Status โ”ƒ Expires    โ”ƒ Auto-Renew โ”ƒ Locked โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ example.com       โ”‚ Active โ”‚ 2025-10-21 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ coolsite.io       โ”‚ Active โ”‚ 2026-05-25 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ myproject.dev     โ”‚ Active โ”‚ 2026-05-30 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ awesome.site      โ”‚ Active โ”‚ 2026-03-20 โ”‚ โœ“          โ”‚        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Configure it before first use:

# Interactive setup
namecheap-cli config init

# Creates config file at:
# - Linux/macOS: $XDG_CONFIG_HOME/namecheap/config.yaml (or ~/.config/namecheap/config.yaml)
# - Windows: %APPDATA%\namecheap\config.yaml

Check domain availability and pricing:

# Check domain availability โ€” promo and regular price, so renewals never surprise you
โฏ namecheap-cli domain check myawesome.com coolstartup.live
                     Domain Availability
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Domain           โ”ƒ Available    โ”ƒ 1st Year โ”ƒ Regular (USD/yr) โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ myawesome.com    โ”‚ โŒ Taken     โ”‚ -        โ”‚ -                โ”‚
โ”‚ coolstartup.live โ”‚ โœ… Available โ”‚ $2.98    โ”‚ $34.48           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Suggestions for taken domains:
  โ€ข myawesome.com โ†’ myawesome.net, myawesome.io, getmyawesome.com

Register a domain (charges your Namecheap account balance, after an explicit confirmation):

โฏ namecheap-cli domain register coolstartup.live --contacts-from example.com

Registering coolstartup.live

Years: 1
Price: $2.98 first year (regular $34.48/yr)
Renews at: $39.48/yr
Total: $2.98
Privacy: โœ“ free WhoisGuard
Contact: John Doe <john@example.com> (from example.com)
Balance: 68.98 USD available

Register coolstartup.live for $2.98? [y/n] (n): y
โœ… Registered coolstartup.live!

--contacts-from copies the registrant contact from a domain you already own; without it the CLI prompts interactively. Auto-renew has no API switch โ€” enable it in the Namecheap dashboard afterwards if you want it.

Manage DNS records:

In this example I'll set up GitHub Pages for my domain tdo.garden

# First, check current DNS records (before setup)
namecheap-cli dns list tdo.garden

# Initial state (Namecheap default parking page):
                         DNS Records for tdo.garden (2 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Type     โ”ƒ Name                 โ”ƒ Value                      โ”ƒ TTL      โ”ƒ Priority โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ CNAME    โ”‚ www                  โ”‚ parkingpage.namecheap.com. โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ URL      โ”‚ @                    โ”‚ http://www.tdo.garden/     โ”‚ 1800     โ”‚ 10       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

# Add GitHub Pages A records for apex domain
โฏ namecheap-cli dns add tdo.garden A @ 185.199.108.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.109.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.110.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.111.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

# Add CNAME for www subdomain
โฏ namecheap-cli dns add tdo.garden CNAME www adriangalilea.github.io
Adding CNAME record to tdo.garden...
โœ… Added CNAME record successfully!

# Verify the setup
โฏ namecheap-cli dns list tdo.garden

# Final state with GitHub Pages + old records still present that you may want to remove:
```bash
                         DNS Records for tdo.garden (7 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Type     โ”ƒ Name                 โ”ƒ Value                      โ”ƒ TTL      โ”ƒ Priority โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ A        โ”‚ @                    โ”‚ 185.199.108.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.109.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.110.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.111.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ CNAME    โ”‚ www                  โ”‚ parkingpage.namecheap.com. โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ CNAME    โ”‚ www                  โ”‚ adriangalilea.github.io.   โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ URL      โ”‚ @                    โ”‚ http://www.tdo.garden/     โ”‚ 1800     โ”‚ 10       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Check account balance:

โฏ namecheap-cli account balance
          Account Balance
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Field               โ”ƒ    Amount โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Available Balance   โ”‚  0.00 USD โ”‚
โ”‚ Account Balance     โ”‚  0.00 USD โ”‚
โ”‚ Earned Amount       โ”‚  0.00 USD โ”‚
โ”‚ Withdrawable        โ”‚  0.00 USD โ”‚
โ”‚ Auto-Renew Required โ”‚ 20.16 USD โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Get detailed domain info:

โฏ namecheap-cli domain info self.fm

Domain Information: self.fm

Status: Ok
Owner: adriangalilea
Created: 07/15/2023
Expires: 07/15/2026
Premium: No
WHOIS Guard: โœ“ Enabled
DNS Provider: CUSTOM

You can also export DNS records:

namecheap-cli dns export example.com --format yaml

namecheap-dns-tui: TUI for DNS management

# Launch interactive DNS manager
namecheap-dns-tui

DNS Manager TUI

Install both the CLI and TUI

uv tool install --python 3.12 'namecheap-python[all]'

๐Ÿ“– Documentation

โš™๏ธ Configuration

Environment Variables

Set environment variables in your shell:

# Required
NAMECHEAP_API_KEY=your-api-key
NAMECHEAP_USERNAME=your-username

# Optional
NAMECHEAP_API_USER=api-username  # defaults to USERNAME
NAMECHEAP_CLIENT_IP=auto         # auto-detected if not set
NAMECHEAP_SANDBOX=false          # use production API

.env files

The CLI auto-loads .env from the current working directory, so cd ~/project && namecheap-cli ... Just Works.

The SDK does not read .env implicitly (libraries shouldn't reach into the filesystem on construction). If your code uses a .env file, load it explicitly:

from dotenv import load_dotenv
load_dotenv()
nc = Namecheap()

# or, equivalently:
nc = Namecheap.from_env_file(".env")

Python Configuration

from namecheap import Namecheap

nc = Namecheap(
    api_key="your-api-key",
    username="your-username", 
    api_user="api-username",    # Optional
    client_ip="1.2.3.4",       # Optional, auto-detected
    sandbox=False              # Production mode
)

Static IP via proxy

Namecheap's API requires whitelisting your client IP โ€” painful when your home IP rotates or your CI runners get random IPs. Instead of re-whitelisting forever, route API calls through any box you control with a static IP (a $5 VPS works).

The SDK uses httpx, which honors the standard proxy environment variables out of the box. For SOCKS proxies, install the socks extra:

uv add 'namecheap-python[socks]'

Then tunnel through your static-IP box and point the proxy env var at it:

# SOCKS tunnel over SSH โ€” no server setup needed
ssh -f -N -D 1080 your-vps

ALL_PROXY=socks5://127.0.0.1:1080 namecheap-cli domain list

Whitelist the VPS IP once in Namecheap (Profile โ†’ Tools โ†’ API Access) and set NAMECHEAP_CLIENT_IP to it. Now API calls work from anywhere โ€” home, laptop on hotel WiFi, CI โ€” with zero whitelist churn. HTTP proxies work too via HTTPS_PROXY=http://... (no extra needed).

๐Ÿ”ง Advanced SDK Usage

DNS Builder Pattern

The DNS builder provides a fluent interface for managing records:

# Build complex DNS configurations
nc.dns.set("example.com",
    nc.dns.builder()
    # A records
    .a("@", "192.0.2.1")
    .a("www", "192.0.2.1")
    .a("blog", "192.0.2.2")
    
    # AAAA records  
    .aaaa("@", "2001:db8::1")
    .aaaa("www", "2001:db8::1")
    
    # MX records
    .mx("@", "mail.example.com", priority=10)
    .mx("@", "mail2.example.com", priority=20)
    
    # TXT records
    .txt("@", "v=spf1 include:_spf.google.com ~all")
    .txt("_dmarc", "v=DMARC1; p=none;")
    
    # CNAME records
    .cname("blog", "myblog.wordpress.com")
    .cname("shop", "myshop.shopify.com")
    
    # URL redirects
    .url("old", "https://new-site.com", redirect_type="301")
)

Note on TTL: The default TTL is 1799 seconds, which displays as "Automatic" in the Namecheap web interface. This is an undocumented Namecheap API behavior. You can specify custom TTL values (60-86400 seconds) in any DNS method.

IDN & Emoji Domain Support

# Emoji domains work everywhere
ns = nc.dns.get_nameservers("๐ŸงŠ.to")
info = nc.domains.get_info("๐ŸงŠ.to")
nc.dns.set_custom_nameservers("๐ŸงŠ.to", ["ns1.cloudflare.com", "ns2.cloudflare.com"])

# So do IDN domains
nc.domains.check("cafรฉ.com", "Mรผnchen.de")

Nameserver Management

# Check current nameservers
ns = nc.dns.get_nameservers("example.com")
print(ns.nameservers)  # ['dns1.registrar-servers.com', 'dns2.registrar-servers.com']
print(ns.is_default)   # True

# Switch to custom nameservers (e.g., Cloudflare, Route 53)
nc.dns.set_custom_nameservers("example.com", [
    "ns1.cloudflare.com",
    "ns2.cloudflare.com",
])

# Reset back to Namecheap BasicDNS
nc.dns.set_default_nameservers("example.com")

Domain Info

info = nc.domains.get_info("example.com")
print(info.status)              # 'Ok'
print(info.whoisguard_enabled)  # True
print(info.dns_provider)        # 'CUSTOM'
print(info.created)             # '07/15/2023'
print(info.expires)             # '07/15/2026'

Account Balance

bal = nc.users.get_balances()
print(f"{bal.available_balance} {bal.currency}")  # '4932.96 USD'
print(bal.funds_required_for_auto_renew)          # Decimal('20.16')

Pricing

# Get registration pricing for a specific TLD
pricing = nc.users.get_pricing("DOMAIN", action="REGISTER", product_name="com")
for p in pricing["REGISTER"]["com"]:
    print(f"{p.duration} year: ${p.your_price} (regular: ${p.regular_price})")

# Get all domain pricing (large response โ€” cache it)
all_pricing = nc.users.get_pricing("DOMAIN")

Email Forwarding

# Read
rules = nc.dns.get_email_forwarding("example.com")
for r in rules:
    print(f"{r.mailbox} -> {r.forward_to}")

# Write (replaces all existing rules)
nc.dns.set_email_forwarding("example.com", [
    EmailForward(mailbox="info", forward_to="me@gmail.com"),
    EmailForward(mailbox="support", forward_to="help@gmail.com"),
])

Domain Contacts

contacts = nc.domains.get_contacts("example.com")
print(f"{contacts.registrant.first_name} {contacts.registrant.last_name}")
print(contacts.registrant.email)

TLD List

tlds = nc.domains.get_tld_list()
print(f"{len(tlds)} TLDs supported")

# Filter to API-registerable TLDs
registerable = [t for t in tlds if t.is_api_registerable]
for t in registerable[:5]:
    print(f".{t.name} ({t.type}) โ€” {t.min_register_years}-{t.max_register_years} years")

Domain Privacy (WhoisGuard)

# List all WhoisGuard subscriptions
entries = nc.whoisguard.get_list()
for e in entries:
    print(f"{e.domain} (ID={e.id}) status={e.status}")

# Enable privacy (resolves WhoisGuard ID from domain name automatically)
nc.whoisguard.enable("example.com", "me@gmail.com")

# Disable privacy
nc.whoisguard.disable("example.com")

# Renew privacy
result = nc.whoisguard.renew("example.com", years=1)
print(f"Charged: {result['charged_amount']}")

# Rotate the masked forwarding email
result = nc.whoisguard.change_email("example.com")
print(f"New: {result['new_email']}")

Domain Management

# Check multiple domains with pricing
results = nc.domains.check(
    "example.com", 
    "coolstartup.io",
    "myproject.dev",
    include_pricing=True
)

for domain in results:
    if domain.available:
        print(f"โœ… {domain.domain} - ${domain.price}/year")
    else:
        print(f"โŒ {domain.domain} is taken")

# List domains with filters
domains = nc.domains.list()
expiring_soon = [d for d in domains if (d.expires - datetime.now()).days < 30]

# Register a domain
from namecheap import Contact

contact = Contact(
    first_name="John",
    last_name="Doe", 
    address1="123 Main St",
    city="New York",
    state_province="NY",
    postal_code="10001", 
    country="US",
    phone="+1.2125551234",
    email="john@example.com"
)

result = nc.domains.register(
    "mynewdomain.com",
    years=2,
    contact=contact,
    whois_protection=True
)

Error Handling

from namecheap import NamecheapError

try:
    nc.domains.check("example.com")
except NamecheapError as e:
    print(f"Error: {e.message}")
    if e.help:
        print(f"๐Ÿ’ก Tip: {e.help}")

โš ๏ธ Namecheap API Quirks

This section documents undocumented or unusual Namecheap API behaviors we've discovered:

No WHOIS lookups or Marketplace data

The Namecheap API only operates on domains in your account. There is no API for:

  • WHOIS lookups on arbitrary domains
  • Checking if a domain is listed on Namecheap Marketplace
  • Aftermarket pricing or availability

domains.check() tells you if a domain is unregistered, not if it's for sale by its owner.

ICANN fee charged even when reported as zero

domains.check sometimes returns IcannFee=0 for a TLD that carries the fee, and registration then charges it anyway (~$0.20/yr). Expect the charged amount to exceed the quoted price by that much; the actual charge comes back in the domains.create response (@ChargedAmount).

TTL "Automatic" = 1799 seconds

The Namecheap web interface displays TTL as "Automatic" when the value is exactly 1799 seconds, but shows "30 min" when it's 1800 seconds. This behavior is completely undocumented in their official API documentation.

Their API docs state TTL defaults to 1800 when omitted, but the UI treats 1799 specially. This SDK defaults to 1799 to match the "Automatic" behavior users see in the web interface.

# Both are valid, but display differently in Namecheap UI:
nc.dns.builder().a("www", "192.0.2.1", ttl=1799)  # Shows as "Automatic"
nc.dns.builder().a("www", "192.0.2.1", ttl=1800)  # Shows as "30 min"

๐Ÿ“Š API Coverage

API Status Methods
namecheap.domains.* โœ… Done check, list, getInfo, getContacts, getTldList, register, renew, setContacts, lock/unlock
namecheap.domains.dns.* โœ… Done getHosts, setHosts (builder pattern), add, delete, export, getList, setCustom, setDefault, getEmailForwarding, setEmailForwarding
namecheap.whoisguard.* โœ… Done getList, enable, disable, renew, changeEmailAddress
namecheap.users.* โš ๏ธ Partial getBalances, getPricing. Remaining methods are account management (changePassword, update, create, login, resetPassword) โ€” only useful if building a reseller platform
namecheap.users.address.* ๐Ÿšง Planned Saved address book for domains.register() โ€” store contacts once, reuse by ID instead of passing full contact info every time
namecheap.ssl.* ๐Ÿšง Planned Full SSL certificate lifecycle โ€” purchase, activate with CSR, renew, revoke, reissue. Complex multi-step workflows with approval emails
namecheap.domains.transfer.* ๐Ÿšง Planned Transfer domains into Namecheap programmatically โ€” initiate, track status, retry
namecheap.domains.ns.* ๐Ÿšง Planned Glue records โ€” only needed if you run your own nameservers and need to register them with the registry
namecheap.domains.* ๐Ÿšง Planned reactivate โ€” restore expired domains within the redemption grace period

๐Ÿค– Claude Code Integration

The CLI ships with a Claude Code skill:

namecheap-cli skill install

This writes the skill to ~/.claude/skills/namecheap-cli/: CLI.md wrapped as SKILL.md (commands, safety rules for destructive operations, common workflows like GitHub Pages setup and Cloudflare migration) plus a command reference generated live from the installed CLI, so it always matches your exact version. Re-run after upgrading.

Then tell Claude "set up mycoolproject.dev for GitHub Pages" and it handles DNS without leaving the conversation.

๐Ÿ› ๏ธ Development

See CONTRIBUTING.md for setup and development guidelines.

๐Ÿ“ License

MIT License - see LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. See CONTRIBUTING.md for setup instructions and guidelines.

Contributors

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

namecheap_python-3.0.0.tar.gz (793.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

namecheap_python-3.0.0-py3-none-any.whl (774.0 kB view details)

Uploaded Python 3

File details

Details for the file namecheap_python-3.0.0.tar.gz.

File metadata

  • Download URL: namecheap_python-3.0.0.tar.gz
  • Upload date:
  • Size: 793.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for namecheap_python-3.0.0.tar.gz
Algorithm Hash digest
SHA256 fed609fca5cd39e1cd32fc07b61cf3cf77576ece9d998dea32ae5bd385871974
MD5 e1d90fe9458971afda57f709db9f8467
BLAKE2b-256 925c72b1be1af3df6106ee20576754ca5e0102778aaa90bb1e874ca8491fe96b

See more details on using hashes here.

Provenance

The following attestation bundles were made for namecheap_python-3.0.0.tar.gz:

Publisher: release.yml on adriangalilea/namecheap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file namecheap_python-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for namecheap_python-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0b72185b1125558bf953bacb8382ecd572e3e8753bd87038a679bd1614c55d
MD5 419b36d5a0e6084718da6371e8967f22
BLAKE2b-256 c94d1ed2720a7f67d18b5458200433f7b2e1bb4ad191a54f25c0f649d5693d6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for namecheap_python-3.0.0-py3-none-any.whl:

Publisher: release.yml on adriangalilea/namecheap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

3.1.0

2 files

This release

3.0.0 This release

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.2

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page