{"id":24441693,"url":"https://github.com/yonjuuni/namecheapapi","last_synced_at":"2025-04-12T20:13:18.087Z","repository":{"id":47358984,"uuid":"61044879","full_name":"yonjuuni/namecheapapi","owner":"yonjuuni","description":"Python Namecheap API wrapper. Supports domain registration/renewal/management, domain availability checks, DNS updates and more.","archived":false,"fork":false,"pushed_at":"2021-09-02T07:46:02.000Z","size":38,"stargazers_count":26,"open_issues_count":1,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T20:13:12.569Z","etag":null,"topics":["dns","domains","namecheap","python","python-3","xml-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yonjuuni.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-13T14:52:52.000Z","updated_at":"2024-11-22T16:27:18.000Z","dependencies_parsed_at":"2022-09-26T17:30:34.552Z","dependency_job_id":null,"html_url":"https://github.com/yonjuuni/namecheapapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonjuuni%2Fnamecheapapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonjuuni%2Fnamecheapapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonjuuni%2Fnamecheapapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonjuuni%2Fnamecheapapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yonjuuni","download_url":"https://codeload.github.com/yonjuuni/namecheapapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625517,"owners_count":21135514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","domains","namecheap","python","python-3","xml-api"],"created_at":"2025-01-20T21:18:59.656Z","updated_at":"2025-04-12T20:13:18.067Z","avatar_url":"https://github.com/yonjuuni.png","language":"Python","readme":"============\nnamecheapapi\n============\nPython Namecheap API wrapper for simple domain name registration and management.\n\nNOTE: you will need API key from Namecheap to use this module (see below).\n\nOverview\n--------\n\nThis is work in progress. Official API docs: https://www.namecheap.com/support/api\n\nFor now I'm trying not to use anything outside the standard library.\nMost methods are more or less well-documented, so don't be shy to use help(). Type hints (PEP 484) are available for every method.\nMethod names are NOT in 100% match with those from Namecheap, but they are more pythonic and/or hopefully make more sense.\n\nFeatures\n--------\n* domain registration/renewal\n* domain availability check\n* DNS updates\n* WHOIS information updates\n* get your domain's information\n* get a list of your Namecheap domains\n* set/remove registrar lock\n\n... and more.\n\n\nNamecheap API\n-------------\n\nNamecheap offers two API endpoints: sandbox (for development \u0026 testing) and production (for real world).\nYou can sign up for a free sandbox account at https://www.sandbox.namecheap.com/ and activate API access at\nhttps://ap.www.sandbox.namecheap.com/Profile/Tools/ApiAccess\n\nMake sure to add your public IP address in Whitelisted IPs section.\n\nKeep in mind that sandbox domains are not 'real', i.e. they exist only\nin Namecheap sandbox (not on the actual Web). With that you may be able\nto see google.com as available for registration. At the same time, you\nwill need to make sure to register your 'virtual' domains if you want to\ntest domain-specific options, such as renewal, DNS updates, etc.\n\n\nInstallation\n------------\n::\n\n  $ pip install namecheapapi\n\nExample usage\n-------------\n.. code-block:: python\n\n    # Initialize API\n    \u003e\u003e\u003e from namecheapapi import DomainAPI\n    \u003e\u003e\u003e api = DomainAPI(\n    ...    api_user='api_user',\n    ...    api_key='api_key,\n    ...    username='username',  # usually the same as api_user\n    ...    client_ip='your IP address',\n    ...    sandbox=True,  # recommended for testing\n    ...    coupon='coupon'  # optional\n    ...)\n    \u003e\u003e\u003e\n\n    # Check availability of google.com\n    \u003e\u003e\u003e api.check('google.com')\n    {'google.com': False}\n\n    # Check multiple domains at once\n    \u003e\u003e\u003e api.check(['asdfghjhgfdsa.com', 'google.com'])\n    {'google.com': False, 'asdfghjhgfdsa.com': True}\n\n    # Register a domain\n    \u003e\u003e\u003e address = {\n    ...    'FirstName': 'Peter',\n    ...    'LastName': 'Griffin',\n    ...    'Address1': '31 Spooner St.',\n    ...    'City': 'Quahog',\n    ...    'StateProvince': 'RI',\n    ...    'PostalCode': '00093',\n    ...    'Country': 'US',\n    ...    'Phone': '+1.123456789',\n    ...    'EmailAddress': 'peter@griffin.tv'\n    ...}\n    \u003e\u003e\u003e api.register('asdfghjhgfdsa.com', address=address)\n    {'NonRealTimeDomain': False, 'TransactionID': 1216215, 'WhoisGuardEnabled': False, 'Domain': 'asdfghjhgfdsa.com', 'OrderID': 823656, 'Success': True, 'ChargedAmount': 10.87, 'ID': 117154}\n\n    # Custom query (a raw XML response is returned)\n    \u003e\u003e\u003e q = api.raw_query(command='namecheap.domains.transfer.getList', query={})\n    \u003e\u003e\u003e print(q)\n    \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n    \u003cApiResponse Status=\"OK\" xmlns=\"http://api.namecheap.com/xml.response\"\u003e\n      \u003cErrors /\u003e\n      \u003cWarnings /\u003e\n      \u003cRequestedCommand\u003enamecheap.domains.transfer.getlist\u003c/RequestedCommand\u003e\n      \u003cCommandResponse Type=\"namecheap.domains.transfer.getList\"\u003e\n        \u003cTransferGetListResult /\u003e\n        \u003cPaging\u003e\n          \u003cTotalItems\u003e0\u003c/TotalItems\u003e\n          \u003cCurrentPage\u003e1\u003c/CurrentPage\u003e\n          \u003cPageSize\u003e20\u003c/PageSize\u003e\n        \u003c/Paging\u003e\n      \u003c/CommandResponse\u003e\n      \u003cServer\u003ePHX01SBAPI01\u003c/Server\u003e\n      \u003cGMTTimeDifference\u003e--4:00\u003c/GMTTimeDifference\u003e\n      \u003cExecutionTime\u003e0.01\u003c/ExecutionTime\u003e\n    \u003c/ApiResponse\u003e\n\n\nImplemented methods\n-------------------\n* domains.register (namecheap.domains.create)\n* domains.check (namecheap.domains.check)\n* domains.get_info (namecheap.domains.getInfo)\n* domains.get_list (namecheap.domains.getList)\n* domains.get_tld_list (namecheap.domains.getTldList)\n* domains.renew (namecheap.domains.renew)\n* domains.reactivate (namecheap.domains.reactivate)\n* domains.get_lock (namecheap.domains.getRegistrarLock)\n* domains.set_lock (namecheap.domains.setRegistrarLock)\n* domains.get_nameservers (namecheap.domains.dns.getList)\n* domains.set_nameservers (namecheap.domains.dns.setCustom, namecheap.domains.dns.setDefault)\n* domains.get_contacts (namecheap.domains.getContacts)\n* domains.set_contacts (namecheap.domains.setContacts)\n\nTODO\n----\n* domains.create_nameserver (namecheap.domains.ns.create)\n* domains.delete_nameserver (namecheap.domains.ns.delete)\n* domains.update_nameserver (namecheap.domains.ns.update)\n* domains.get_nameserver_info (namecheap.domains.ns.getInfo)\n* domains.get_host_records (namecheap.domains.dns.getHosts)\n* domains.set_host_records (namecheap.domains.dns.setHosts)\n\nTesting\n-------\n\n1. Create ``config.py`` in ``namecheapapi/tests/`` directory, fill it in:\n\n* ``API_KEY`` = 'string' -- API key that you got from Namecheap\n* ``API_USER`` = 'string' -- your Namecheap username\n* ``USERNAME`` = 'string' -- in most cases it would be your Namecheap username\n* ``CLIENT_IP`` = 'string' -- your public IP address (MUST be whitelisted in your Namecheap account)\n* ``SANDBOX`` = True (recommended!)\n* ``COUPON`` = 'string' -- coupon code if you have any, '' otherwise\n* ``DOMAIN`` = 'string' -- a domain name you ALREADY HAVE in your Namecheap account\n\n2. Run ``python3 -m unittest -v /path/to/namecheapapi/dir``\n\nChangelog\n---------\n\n0.2.1\n~~~~~\n\n* minor bugfixes\n\n0.2\n~~~\n\n* documentation update\n* domains.get_contacts/set_contacts methods added\n\n0.1.1\n~~~~~\n\n* First published working version.\n\nAuthor\n------\n\n`Alex Sanchez \u003cmailto:alex@s1ck.org\u003e`_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonjuuni%2Fnamecheapapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyonjuuni%2Fnamecheapapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonjuuni%2Fnamecheapapi/lists"}