> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # CheckDomainAvailability # Package: domainSearch # Namespace: DomainAvailabilityService # Method link: https://dev.wix.com/docs/api-reference/account-level/domains/domain-search/availability-v2/check-domain-availability.md ## Introduction Checks whether the given domain is available for purchase. You can purchase the specified domain in case the returned `availability.available` boolean is `true`. The domain is already taken when `false` is returned. The `domain` field must include the TLD. For example, `my-new-domain.com`. > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header. --- ## REST API ### Schema ``` Method: checkDomainAvailability Description: Checks whether the given domain is available for purchase. You can purchase the specified domain in case the returned `availability.available` boolean is `true`. The domain is already taken when `false` is returned. The `domain` field must include the TLD. For example, `my-new-domain.com`. > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header. URL: https://www.wixapis.com/domain-search/v2/check-domain-availability Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: domain Method parameters: query param name: domain | type: domain | description: Domain name. Must include the TLD. For example, `my-new-domain.com`. Only alphanumeric characters, hyphens, and dots are supported. Min: 3 characters Max: 63 characters | required: true Return type: CheckDomainAvailabilityResponse - name: availability | type: DomainAvailability | description: Information about the domain's availability. - name: domain | type: string | description: Domain name including TLD. For example, `my-new-domain.com`. - name: available | type: boolean | description: Whether the domain is available for purchase. You can purchase the domain in case the boolean is `true`. The domain is already taken when `false` is returned. - name: premium | type: boolean | description: Whether the domain has a higher price due to its perceived value or demand. - name: premiumType | type: PremiumType | description: In case the domain is premium the premium_type will represent the type of the premium domain. FIRST_YEAR_ONLY - only initial purchase price is premium while the renewal will cost the regular price of the TLD. FIRST_YEAR_AND_RENEWAL - both initial purchase and renewal prices are premium. - enum: FIRST_YEAR_ONLY, FIRST_YEAR_AND_RENEWAL ``` ### Examples ### Check a domain's availability. ```curl curl -X GET 'https://www.wixapis.com/domain-search/v2/check-domain-availability?domain=mydomain.com' \ -H 'Authorization: ' \ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.domainSearch.DomainAvailabilityService.checkDomainAvailability(domain) Description: Checks whether the given domain is available for purchase. You can purchase the specified domain in case the returned `availability.available` boolean is `true`. The domain is already taken when `false` is returned. The `domain` field must include the TLD. For example, `my-new-domain.com`. > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: domain Method parameters: param name: domain | type: string | description: Domain name. Must include the TLD. For example, `my-new-domain.com`. Only alphanumeric characters, hyphens, and dots are supported. Min: 3 characters Max: 63 characters | required: true Return type: PROMISE - name: availability | type: DomainAvailability | description: Information about the domain's availability. - name: domain | type: string | description: Domain name including TLD. For example, `my-new-domain.com`. - name: available | type: boolean | description: Whether the domain is available for purchase. You can purchase the domain in case the boolean is `true`. The domain is already taken when `false` is returned. - name: premium | type: boolean | description: Whether the domain has a higher price due to its perceived value or demand. - name: premiumType | type: PremiumType | description: In case the domain is premium the premium_type will represent the type of the premium domain. FIRST_YEAR_ONLY - only initial purchase price is premium while the renewal will cost the regular price of the TLD. FIRST_YEAR_AND_RENEWAL - both initial purchase and renewal prices are premium. - enum: FIRST_YEAR_ONLY, FIRST_YEAR_AND_RENEWAL ``` ### Examples ### Check domain availability with an API Key ```javascript import { createClient } from "@wix/sdk"; import { domainAvailability, ApiKeyStrategy } from "@wix/domains"; const wixClient = createClient({ modules: { domainAvailability }, auth: ApiKeyStrategy({ siteId: "MY-SITE-ID", apiKey: "MY-API-KEY", }), }); async function checkDomainAvailability(domain) { const response = await domainAvailability.checkDomainAvailability(domain); } ``` ### checkDomainAvailability (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { domainAvailability } from '@wix/domains'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { domainAvailability }, // Include the auth strategy and host as relevant }); async function checkDomainAvailability(domain) { const response = await myWixClient.domainAvailability.checkDomainAvailability(domain); }; ``` ---