Disclosure: BlogZenn is reader-supported. If you buy through our links we may earn a commission at no extra cost to you. Full disclosure here.
The Namecheap API is free — but you must have either a $50 account balance or 20+ domains registered. Once approved, you get a key in My Profile → Tools → API Access, whitelist your server IP, and hit
https://api.namecheap.com/xml.response. The most useful call is namecheap.domains.check for bulk availability lookups. Rate limit is 700 calls per minute.
What Is the Namecheap API?
The Namecheap API is a RESTful XML interface that gives developers programmatic control over domain registration, DNS management, email hosting, and SSL certificates — everything you can do in the Namecheap dashboard, but via code.
It’s used by domain resellers building white-label registrar products, SaaS tools that check domain availability at signup, bulk domain investors managing hundreds of renewals, and developers who want to automate DNS changes across a fleet of sites.
Unlike many registrar APIs, Namecheap’s is genuinely free for qualifying accounts. There are no per-call fees and no monthly subscription — you just need to meet the account threshold.
Who Qualifies for Free API Access?
Namecheap requires at least one of the following to activate API access:
- $50 or more in your Namecheap account balance (pre-paid funds), or
- 20 or more domains registered in your account, or
- $50 or more spent within the last two years
If you’re starting from scratch, depositing $50 into your Namecheap balance is the fastest route. The funds remain usable for domain renewals — you’re not spending them just to qualify.
Accounts below the threshold can still access the sandbox environment at api.sandbox.namecheap.com for testing. The sandbox is a complete mirror of production and resets periodically. It’s the right place to build and test before going live.
Step-by-Step: How to Get Your API Key
- Log in to your Namecheap account at namecheap.com.
- Click your username in the top-right corner → Profile.
- Go to the Tools tab in your profile settings.
- Scroll to Business & Dev Tools → click Manage next to “Namecheap API Access”.
- If your account qualifies, you’ll see an option to Enable API Access. Toggle it on.
- Your API key appears immediately. Copy and store it securely — treat it like a password.
- Add up to 10 whitelisted IP addresses in the same panel. These are the only IPs allowed to make API calls.
Sandbox vs Production
| Environment | Base URL | Real Money? |
|---|---|---|
| Sandbox | api.sandbox.namecheap.com/xml.response |
No |
| Production | api.namecheap.com/xml.response |
Yes |
Authentication Parameters
Every API call requires: ApiUser, ApiKey, UserName, ClientIp, and Command.
Domain Availability Check
The namecheap.domains.check command checks up to 50 domains in one call.
https://api.namecheap.com/xml.response
?ApiUser=YOUR_USERNAME
&ApiKey=YOUR_API_KEY
&UserName=YOUR_USERNAME
&ClientIp=YOUR_IP
&Command=namecheap.domains.check
&DomainList=example.com,example.net,mybrand.io
Python example:
import requests, xml.etree.ElementTree as ET
params = {'ApiUser':'user','ApiKey':'key','UserName':'user','ClientIp':'1.2.3.4','Command':'namecheap.domains.check','DomainList':'mybrand.io,mybrand.com'}
resp = requests.get('https://api.namecheap.com/xml.response', params=params)
root = ET.fromstring(resp.text)
for r in root.iter('DomainCheckResult'):
print(r.get('Domain'), r.get('Available'))
Pricing API
Use namecheap.users.getPricing with ProductType=DOMAIN, ActionName=REGISTER, ProductName=com to fetch live registration prices programmatically.
Registering a Domain via API
namecheap.domains.create registers a domain. Include AddFreeWhoisguard=yes and WGEnabled=yes to activate free privacy. Test in sandbox first — production calls charge your Namecheap balance immediately.
Rate Limits
| Limit | Value |
|---|---|
| Calls per minute | 700 |
| Max domains per check call | 50 |
| Whitelisted IPs | 10 |
6 Common API Errors and Fixes
Error 1011102 — Authentication Failure
Wrong ApiKey or IP not whitelisted. Check My Profile → Tools → API Access and confirm the calling machine’s IP is listed.
Error 2010326 — Insufficient Funds
Top up your Namecheap balance before registering. Use namecheap.users.getBalances to check funds programmatically.
Error 1010324 — Domain List Empty
DomainList parameter blank or malformed. IDNs must be Punycode (xn--...).
Error 2030280 — Domain Not Available
Domain was taken between check and create. Always re-check immediately before create; build retry logic.
Error 1011150 — Command Not Found
Typo or wrong case in Command parameter. Commands are case-sensitive: namecheap.domains.check works, namecheap.domains.Check does not.
Error 1010321 — TLD Not Supported
Run namecheap.domains.getTldList first. New gTLDs may need extra registrant fields.
DNS Management via API
namecheap.domains.dns.setHosts writes a full DNS record set in one call (overwrites existing records). Use numbered parameter sets: HostName1, RecordType1, Address1, TTL1 … HostName2, RecordType2, etc. Also available: setDefault, setCustom, getHosts.
SSL Certificate Management
Core SSL commands: namecheap.ssl.create (purchase), namecheap.ssl.activate (submit CSR), namecheap.ssl.getList, namecheap.ssl.renew. For Let’s Encrypt, handle ACME separately and use setHosts to add the DNS TXT challenge record.
PHP Example
<?php
$params = http_build_query(['ApiUser'=>'u','ApiKey'=>'k','UserName'=>'u','ClientIp'=>'1.2.3.4','Command'=>'namecheap.domains.check','DomainList'=>'mybrand.io']);
$xml = simplexml_load_string(file_get_contents('https://api.namecheap.com/xml.response?'.$params));
foreach($xml->CommandResponse->DomainCheckResult as $r) echo $r['Domain'].' '.$r['Available']."\n";
Using the Sandbox
Sandbox has separate credentials from production — register at ap.www.sandbox.namecheap.com. Domain records reset periodically. Balance is pre-loaded. Switch environments via a config constant for the base URL only.
Common Use Cases
SaaS signup flows: Check domain availability at signup and offer registration in one step. Bulk investor tools: Check 50 domains/call, register matches automatically. Reseller storefronts: Full white-label registrar via API sub-accounts. DNS automation: Provision subdomains or Let’s Encrypt challenges at scale. Renewal management: Query expiry dates via namecheap.domains.getList and auto-renew via namecheap.domains.renew.
Frequently Asked Questions
Is the Namecheap API free?
Yes — no per-call fees. You pay normal domain prices when registering or renewing. The only barrier is the $50 balance or 20-domain threshold for production access.
Can I check prices before registering?
Yes. namecheap.users.getPricing returns current registration, renewal, and transfer prices per TLD including live promotions.
What happens at the rate limit?
Error 1011103. Throttle to 10–12 calls/second and build exponential backoff for bulk jobs.
Does the API bypass 2FA?
API auth is key-only, no 2FA required per call — which is exactly why IP whitelisting is mandatory. Rotate your key immediately if compromised.
Can I resell domains via the API?
Yes. Namecheap’s reseller programme supports sub-accounts, reseller pricing, and white-label use via API. Contact Namecheap to activate reseller pricing.
Get API Access — Start with Namecheap
Deposit $50 to unlock production API access immediately — the funds count toward domain registrations, so nothing is wasted.
Namecheap .com from £8.40/year. Verified May 2026.
Related Guides
- Namecheap .com Domain Price 2026
- Namecheap Renewal vs Registration
- Namecheap Private Email Pricing 2026
Written by Alex Morgan, domain industry researcher. API specifications verified against Namecheap documentation, May 2026.