Authentication overview
Domainsdb.info provides programmatic access to its extensive domain registration data through a RESTful API. Authentication for the Domainsdb.info API is managed via a unique API key assigned to each registered user. This API key serves as the primary credential for verifying the identity of the client making requests and ensuring authorized access to the API's resources. The API key model simplifies integration while maintaining a necessary level of security for data access.
The API key must be included with every request to the Domainsdb.info API. Without a valid and active API key, requests will be rejected, typically with an authentication error. This mechanism applies uniformly across all API endpoints and usage tiers, from the free tier of 1,000 requests per month to custom enterprise plans. Understanding proper API key management and secure implementation is crucial for any developer integrating with the Domainsdb.info platform.
For detailed information on API endpoints and request parameters, refer to the official Domainsdb.info API documentation.
Supported authentication methods
Domainsdb.info exclusively supports API key authentication for its API. This method involves generating a unique string (the API key) that acts as a secret token. When a client makes an API request, this key is transmitted to the server, which then verifies its validity and permissions before processing the request.
The use of API keys is a common practice for many web services due to its simplicity and ease of implementation for both developers and API providers. While effective for rate limiting and basic access control, API keys require careful handling to prevent unauthorized use. They are generally considered a good fit for services where the primary goal is to control access to public data or data that does not require granular, user-specific permissions, such as the aggregated domain registration data provided by Domainsdb.info.
Other authentication methods, such as OAuth 2.0 or mutual TLS, are not currently supported by the Domainsdb.info API. OAuth 2.0, for instance, is typically used for delegated authorization, allowing third-party applications to access user data without sharing user credentials directly, as described by the OAuth 2.0 specification. Given Domainsdb.info's model of providing general domain data rather than user-specific data, API keys remain the appropriate and supported method.
Authentication Method Summary
| Method | Description | When to Use | Security Level |
|---|---|---|---|
| API Key | A unique, secret string passed with each request. | All API interactions with Domainsdb.info. | Moderate (requires secure handling of the key). |
Getting your credentials
To obtain your API key for Domainsdb.info, you must first register an account on their website. The process typically involves the following steps:
- Visit the Domainsdb.info website: Navigate to the Domainsdb.info homepage.
- Sign Up/Register: Look for a "Sign Up" or "Register" option, usually located in the header or footer of the website. You will likely need to provide an email address and create a password.
- Verify Email (if required): Some registration processes include an email verification step to confirm your account.
- Access API Dashboard: Once registered and logged in, you should be directed to a user dashboard or an API section. Within this section, your unique API key will be displayed. It may also be referred to as a "Developer Key" or "Access Token."
- Copy Your API Key: Carefully copy your API key. It is a long, alphanumeric string. Store it securely, as it grants access to your allocated API requests.
Domainsdb.info offers a free tier that includes 1,000 requests per month, which is sufficient for initial testing and development. Your API key will work for both the free tier and any subsequent paid plans you may subscribe to, with the request limits adjusting accordingly based on your subscription level. If you lose or compromise your API key, most API dashboards provide an option to regenerate a new key, invalidating the old one.
Authenticated request example
Once you have obtained your API key, you can integrate it into your API requests. The Domainsdb.info API expects the API key to be sent as a query parameter named key in the URL. Below is an example of an authenticated request using a placeholder API key (YOUR_API_KEY) to query domain information. This example uses curl, a common command-line tool for making HTTP requests.
Example: Fetching domain information
Suppose you want to retrieve information for the domain example.com. Your request would look like this:
curl "https://domainsdb.info/api/v1/domain/example.com?key=YOUR_API_KEY"
In this example:
https://domainsdb.info/api/v1/domain/example.comis the API endpoint for querying a specific domain.?key=YOUR_API_KEYappends your unique API key as a query parameter.
Replace YOUR_API_KEY with your actual API key obtained from your Domainsdb.info dashboard. The API will return JSON formatted data containing details about example.com, assuming the key is valid and you have remaining requests in your quota.
Example response (truncated for brevity):
{
"domain": "example.com",
"registrar": "IANA - IANA Registrar",
"whois_server": "whois.iana.org",
"creation_date": "1995-08-14",
"updated_date": "2023-08-07",
"expiration_date": "2024-08-13",
"name_servers": [
"a.iana-servers.net",
"b.iana-servers.net"
],
"status": [
"client delete prohibited",
"client transfer prohibited",
"client update prohibited"
],
"raw_whois": "... (full WHOIS record) ..."
}
For more specific API endpoints and their respective parameters, consult the Domainsdb.info API reference.
Security best practices
While API keys offer simplicity, their security relies heavily on proper handling. Adhering to these best practices helps mitigate risks associated with their use:
-
Never hardcode API keys: Avoid embedding API keys directly into your source code. Hardcoding makes keys discoverable in version control systems and difficult to rotate. Instead, use environment variables, configuration files that are excluded from version control (e.g., via
.gitignore), or secure secret management services. For example, AWS provides AWS Secrets Manager for securely storing and retrieving credentials. - Use HTTPS/TLS: Always ensure that all API requests are made over HTTPS (HTTP Secure). This encrypts the communication channel between your client and the Domainsdb.info API, preventing your API key from being intercepted in plain text during transit. All modern APIs, including Domainsdb.info, enforce HTTPS. If you attempt to use HTTP, your request will likely fail or be redirected.
- Restrict API key privileges (if applicable): Although Domainsdb.info API keys generally provide access to all available data based on your subscription tier, in systems where API keys can have granular permissions, always assign the minimum necessary privileges. This principle of least privilege limits the damage if a key is compromised.
- Implement IP Whitelisting (if available): If Domainsdb.info offered IP whitelisting as a feature (which is common in many APIs for enhanced security), you would configure your account to only accept API requests originating from a list of trusted IP addresses. This prevents unauthorized requests from unknown locations, even if the key is compromised. Check the Domainsdb.info API documentation for any updates on such features.
- Monitor API usage: Regularly monitor your API usage through your Domainsdb.info dashboard. Unusual spikes in activity or requests from unexpected locations could indicate a compromised API key. Prompt detection allows for quick key rotation.
- Rotate API keys regularly: Periodically rotate your API keys. This means generating a new key and updating all your applications to use the new key, then revoking the old one. Regular rotation reduces the window of opportunity for a compromised key to be exploited. Check your Domainsdb.info account settings for options to regenerate your key.
- Client-side vs. Server-side: Never expose your API key in client-side code (e.g., JavaScript in a web browser or mobile app). Client-side code is easily inspectable, making the key vulnerable. All API requests that require your private Domainsdb.info API key should originate from a secure server-side environment. If you need to access data from a client, route requests through your own backend API, which then securely calls Domainsdb.info.
By diligently applying these security measures, developers can significantly reduce the risk of unauthorized access and ensure the integrity of their integration with the Domainsdb.info API.