The Namecheap API allows you to build web and desktop applications that integrate with your Namecheap account. It allows you to programmatically perform operations like domain search, domain register, purchase SSL etc., from within your application.
Using Namecheap API you can:
(a) Sell domains, SSL certificates etc., on your website for any price of your choice
(b) Integrate domain registrations with billing applications like Modernbill and Ubersmith
(c) Create applications to monitor domains and send alerts
(d) Build custom applications to manage your domains
(e) And many more!
We have a production as well as a test server environment. The test server environment is called Sandbox. You are advised to signup for a free account in sandbox, enable API access and test all your API calls on the sandbox environment before pointing your application to production. To point an application to production, you only need to make minor changes. In most cases, you barely need to change the service URL, APIusername and APIkey.
The following is the API Service URL for our sandbox environment:
We can't stress enough, but please test your APIs against our sandbox
environment before pointing it to production. We would like to avoid
service disruptions in production caused by untested code.
Following is the API Service URL for our production environment:
Enabling API Access
There is no restriction for trying out our APIs in the sandbox environment. However, to enable API access on the production environment, you must meet our requirements.If you don’t meet any of our requirements but wish to use our APIs in production, contact our support team and we will get back to you.
The steps for enabling API access are similar in production and sandbox environments.To enable API access, follow the steps given below on the appropriate environment:
Login to your Namecheap account.
Go to My Account > Manage Profile page
From the left pane, select API Access option.
On the Manage Profile - API Access page, enter your account password.
Read our terms of service, and select the box indicating you agree.
Click Enable API Access.
After enabling API access, you will be allotted an APIUsername and APIKey. Your access to the API is authenticated using these elements.
Making an API Call
You can easily access API be sending your parameters as a
HTTP-GET request query string to the service URLs. The response is given in XML format. The
HTTP-GET request URL is formed by adding query parameters and values to a service URL. The first parameter begins after a
? symbol. Successive parameters are included by adding an
& symbol before each parameter. The format for adding queries is
parameter=values. The following is the syntax of an API call:
Sample API Call
The above call returns a response in XML format. You can parse this XML file to obtain the results and embed the data into the application you are creating. Please take a look at API Reference for all available commands and required parameters.
You can find out if an API call was successful or not by checking the ApiResponse Status. The following is the syntax of a successful API call:
[#Requested data in XML format...]
The following is the syntax of an erroneous API call:
<Error Number="0">Error message</Error>
Resetting the API key
After logging into the appropriate environment, Go to My Account > Manage Profile page and select API Access option. Click on Reset API Key.
CAUTION Any application using your existing API key will stop working immediately.
If you reset the API key, make sure you update the new API key on every API call.
Disabling API Access
To discontinue using Namecheap API, go to Manage Profile - API Access in the appropriate environment and choose Disable API Access option.
CAUTION Any application using the API key will stop working immediately.