### API Integration Examples Source: https://whoisjsonapi.com Code examples for querying the Whois API using various programming languages and tools. ```bash curl -X GET "https://whoisjsonapi.com/v1/example.com" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ```python import requests response = requests.get( "https://whoisjsonapi.com/v1/example.com", headers={ "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", }, ) print(response.json()) ``` ```javascript const response = await fetch("https://whoisjsonapi.com/v1/example.com", { headers: { Authorization: "Bearer YOUR_API_KEY", Accept: "application/json", }, }); const data = await response.json(); console.log(data); ``` ```go package main import ( "fmt" "io" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://whoisjsonapi.com/v1/example.com", nil) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Accept", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(string(body)) } ``` -------------------------------- ### API Request Examples Source: https://whoisjsonapi.com Examples of how to make requests to the Whois API using different tools and languages. ```APIDOC ## API Request Examples ### cURL ```bash curl -X GET "https://whoisjsonapi.com/v1/example.com" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ### Python ```python import requests response = requests.get( "https://whoisjsonapi.com/v1/example.com", headers={ "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", }, ) print(response.json()) ``` ### Node.js ```javascript const response = await fetch("https://whoisjsonapi.com/v1/example.com", { headers: { Authorization: "Bearer YOUR_API_KEY", Accept: "application/json", }, }); const data = await response.json(); console.log(data); ``` ### Golang ```go package main import ( "fmt" "io" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://whoisjsonapi.com/v1/example.com", nil) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Accept", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(string(body)) } ``` ``` -------------------------------- ### Example API Response Source: https://whoisjsonapi.com The structure of the JSON response returned by the API for a domain lookup. ```json { "domain": { "id": "2336799_DOMAIN_COM-VRSN", "domain": "EXAMPLE.COM", "name": "EXAMPLE", "extension": ".COM", "status": [ "client delete prohibited", "client transfer prohibited", "client update prohibited" ], "name_servers": [ "ELLIOTT.NS.CLOUDFLARE.COM", "HERA.NS.CLOUDFLARE.COM" ], "dnssec": true, "created_date": "1995-08-14T04:00:00Z", "created_date_in_time": "1995-08-14T04:00:00Z", "updated_date": "2026-01-16T18:26:50Z", "updated_date_in_time": "2026-01-16T18:26:50Z", "expiration_date": "2026-08-13T04:00:00Z", "expiration_date_in_time": "2026-08-13T04:00:00Z" }, "registrar": { "id": "376", "name": "RESERVED-Internet Assigned Numbers Authority" }, "technical": [] } ``` -------------------------------- ### GET /v1/{domain} Source: https://whoisjsonapi.com Retrieve WHOIS details for a specific domain. ```APIDOC ## GET /v1/{domain} ### Description Retrieves detailed WHOIS information for a specified domain name. ### Method GET ### Endpoint /v1/{domain} ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to look up (e.g., example.com). ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **domain** (object) - Contains domain-specific information. - **registrar** (object) - Contains registrar information. - **technical** (array) - Contains technical contact information. #### Response Example ```json { "domain": { "id": "2336799_DOMAIN_COM-VRSN", "domain": "EXAMPLE.COM", "name": "EXAMPLE", "extension": ".COM", "status": [ "client delete prohibited", "client transfer prohibited", "client update prohibited" ], "name_servers": [ "ELLIOTT.NS.CLOUDFLARE.COM", "HERA.NS.CLOUDFLARE.COM" ], "dnssec": true, "created_date": "1995-08-14T04:00:00Z", "created_date_in_time": "1995-08-14T04:00:00Z", "updated_date": "2026-01-16T18:26:50Z", "updated_date_in_time": "2026-01-16T18:26:50Z", "expiration_date": "2026-08-13T04:00:00Z", "expiration_date_in_time": "2026-08-13T04:00:00Z" }, "registrar": { "id": "376", "name": "RESERVED-Internet Assigned Numbers Authority" }, "technical": [] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.