Get API Key

Welcome to the API key generation guide. This section will walk you through the process of generating an API key for our service. Please follow the instructions carefully to ensure a smooth experience.

How to Generate Your API Key:

After successfully registering, follow these steps to generate your API key:

  1. Sign up at OpenAPI Box by completing the registration process.
  2. Once registered, log in and go to the API Services section of your dashboard.
  3. Search for Domain Whois API in the available services.
  4. Select the API that corresponds to your service.
  5. Look for the Generate API Key option and click it.
  6. A confirmation modal will appear. Confirm your action to proceed.
  7. Once confirmed, you will see the API key generated for your account.
  8. Click the Show API Key button to reveal your API key.
  9. Click the Copy button next to the key to copy it to your clipboard.

Domain Whois API

The Domain Whois API provides accurate, real-time data about domain ownership and registration details. It allows you to gather comprehensive information about domains, including registration dates, domain owners, and contact details, helping you make informed decisions and track domain histories globally.

Endpoints

POST /GET https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo

Parameters
Field Name Description Required Example Values
domain The domain name whose information you want to retrieve Yes google.com
Demo Code Examples
                                 
<?php

$endpoint = 'https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo';

$domain = 'example.com';  // Replace with the domain you want to get info for

$params = [
    'domain' => $domain
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $endpoint,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($params),
]);

$response = curl_exec($curl);

if ($response === false) {
    echo 'cURL error: ' . curl_error($curl);
} else {
    echo htmlentities($response);  // Display the response
}

curl_close($curl);
?>

<?php


use GuzzleHttp\Client;

// Create a new Guzzle client
$client = new Client();

// Replace 'YOUR-API-KEY' with your actual API Key
$endpoint = 'https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo';

// Set the domain parameter (replace with the domain you want to query)
$domain = 'example.com';  // Replace with the domain you want to get info for

// Set the parameters to be sent in the POST request
$params = [
    'domain' => $domain
];

// Make the POST request using Guzzle
try {
    $response = $client->post($endpoint, [
        'form_params' => $params  // Send parameters as form data
    ]);
    echo htmlentities($response->getBody());  // Display the response body
} catch (\GuzzleHttp\Exception\RequestException $e) {
    echo 'Guzzle error: ' . $e->getMessage();
}

?>

const axios = require('axios');
const querystring = require('querystring');

// Set the domain and API Key
const domain = 'example.com';  // Replace with the domain you want to query
const endpoint = 'https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo';  // Replace with your actual endpoint

// Set the data to be sent in the POST request
const data = {
    domain: domain  // Replace ip with domain
};

// Make the POST request using axios
axios.post(endpoint, querystring.stringify(data))
    .then(response => {
        console.log(response.data);  // Handle successful response
    })
    .catch(error => {
        console.error('Error:', error);  // Handle error
    });


import requests

# Set the domain and API Key
domain = 'example.com'  # Replace with the domain you want to query WHOIS info for

endpoint = 'https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo'  # Replace with your actual endpoint

# Set the data to be sent in the POST request
payload = {
    'domain': domain  # Replace 'ip' with 'domain'
}

# Make the POST request using requests
try:
    response = requests.post(endpoint, data=payload)
    print(response.text)  # Handle successful response
except requests.exceptions.RequestException as e:
    print('Error:', e)  # Handle error


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
)

func main() {
	// Set the domain and API Key
	domain := "example.com" // Replace with the domain you want to query WHOIS info for

	endpoint := "https://openapibox.com/api/domainwhois/YOUR-API-KEY/getInfo" // Replace with your actual endpoint

	// Set the data to be sent in the POST request
	data := url.Values{}
	data.Set("domain", domain) // Use "domain" instead of "ip"

	// Create a POST request
	req, err := http.NewRequest("POST", endpoint, bytes.NewBufferString(data.Encode()))
	if err != nil {
		log.Fatal(err)
	}

	// Set the Content-Type header to application/x-www-form-urlencoded
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

	// Send the request using the HTTP client
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	// Read and print the response body
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(body))
}


Example Responses


{
  "code": 1000,
  "parserType": "common",
  "domainName": "google.com",
  "whoisServer": "whois.markmonitor.com",
  "nameServers": [
    "ns1.google.com",
    "ns2.google.com",
    "ns3.google.com",
    "ns4.google.com"
  ],
  "creationDate": 874306800,
  "expirationDate": 1852441200,
  "states": [
    "clientupdateprohibited",
    "clienttransferprohibited",
    "clientdeleteprohibited",
    "serverupdateprohibited",
    "servertransferprohibited",
    "serverdeleteprohibited"
  ],
  "owner": "Google LLC",
  "registrar": "MarkMonitor, Inc."
}



{
  "code": 1111,
  "message": "Domain Parameter is Required"
}

{
  "code": 1002,
  "message": "Invalid API Key"
}

{
  "code": 1234,
  "message": "Invalid Domain or Subdomain Detected"
}

Response Details

Field Name Example Values
code 1000
parserType common
domainName google.com
whoisServer whois.markmonitor.com
nameServers
ns1: ns1.google.com
ns2: ns2.google.com
ns3: ns3.google.com
ns4: ns4.google.com
creationDate 874306800 (Unix Timestamp)
expirationDate 1852441200 (Unix Timestamp)
states
State 1: clientupdateprohibited
State 2: clienttransferprohibited
State 3: clientdeleteprohibited
State 4: serverupdateprohibited
State 5: servertransferprohibited
State 6: serverdeleteprohibited
owner Google LLC
registrar MarkMonitor, Inc.