API DOCUMENTATION

This is a simple PHP JSON api that gives response through GET in a json format. The guide below will help you to get started. Tested live on Registernp.

Current version

All API access is over HTTPS, and accessed from https://api.registernp.xyz/check.php All data is sent and received as JSON.

Copy the following code

<?php
    //put the domain name that you want to check availabilty of
    $search = "google.com.np";

    //donot change anything
    $url = "https://api.registernp.xyz/check.php?np=" . $search;
    $results = file_get_contents($url);
    $results = json_decode($results, TRUE);
    
    //main datas       
    echo $results['status']; //result['status'] prints availability status of; **REQUIRED**   
    echo '<br/>';  //breaks to make the code readable
    echo $results['message']; //result['message'] prints additional message; **OPTIONAL**
?>
                

Output

{"status":"not_available","message":"\"google.com.np\" is already registered!"}

Check (np) Domain

Modify the $search string only.

$search = "google.com.np";

Replace "google.com.np" with "domain.com.np" that you want to check.

Example

$search = "domain.com.np; 

"domain.com.np" refers to your custom domain name that you want to check for availability.

Responses

You'll get different responses for different domain names. Following table will guide you with what the responses mean.

Status Description
available The domain name is available for registration.
not_available The domain is taken and is not available for registration
not_format The domain is not in format. The domain name cannot start with "http://", "https://" or "www". The domain name should be entered without any protocol or www (For eg: sanjeevthapa.com.np)
not_np The domain name is not np. This api checks np domain only. So, there needs be an .np extension at the end of the domain name.
less As per "Register.com.np", The length of domain name cannot be less than 3 characters.
lol "sanjeevthapa.com.np" cannot be entered for domain check

Response Alert

Following table will show you, what alert to keep for each responses. Obviously, this is optional, you may choose to use your own warning. The intention of this table is to give you an extended understanding on Responses

Status Alert Type
available Success
not_available Danger
not_format Warning
not_np Danger
less Danger
lol Danger

What would JSON output look like ?

Your JSON output should look like the following.


    

{"status":"not_available","message":"\"google.com.np\" is already registered!"}

You can start using np availability checker by copying the code from above.