Getting started overview
Integrating the Disify API involves a few key steps: account registration, obtaining your unique API key, and constructing your first API call. Disify is designed for real-time email validation, primarily focusing on detecting disposable email addresses through a straightforward RESTful HTTP interface. The API supports various programming languages via standard HTTP request libraries, making it accessible for most development environments.
This guide provides a rapid walkthrough to get you from account creation to a successful API response, enabling quick implementation for tasks like form validation or lead qualification. For detailed API specifications and advanced usage patterns, consult the Disify official documentation.
Here's a quick reference for the getting started process:
| Step | What to do | Where |
|---|---|---|
| 1. Create Account | Register on the Disify website. | Disify homepage |
| 2. Get API Key | Locate your unique API key in your dashboard. | Disify user dashboard (after login) |
| 3. Make First Request | Construct and execute an HTTP GET request to the validation endpoint. | Your preferred development environment (e.g., cURL, Node.js, Python) |
| 4. Parse Response | Process the JSON response to check email validity. | Your application logic |
Create an account and get keys
To begin using the Disify API, you must first create an account on the official Disify website. This process registers you and grants access to your personal dashboard, where your API key is generated and managed.
- Navigate to the Disify Website: Open your web browser and go to the Disify homepage.
- Sign Up: Look for a "Sign Up" or "Get Started" button, typically located in the navigation bar or prominently on the page. Follow the prompts to create your account. This usually involves providing an email address and setting a password. Disify offers a free tier that allows up to 1,000 requests per month, making it suitable for initial testing and low-volume use.
- Access Your Dashboard: After successful registration and login, you will be redirected to your user dashboard. This is your central hub for managing your Disify service.
-
Locate Your API Key: Within the dashboard, there will be a section clearly labeled for your "API Key" or "Credentials." Your API key is a unique alphanumeric string that authenticates your requests to the Disify API. Copy this key, as it will be required for every API call you make.
Security Note: Your API key acts as a password for your Disify account. Keep it confidential and do not expose it in client-side code, public repositories, or unsecured environments. For server-side applications, use environment variables or a secure configuration management system to store your key. The Google Cloud API Keys Best Practices guide offers general recommendations for API key security.
Your first request
Once you have your API key, you can make your first call to the Disify API. The primary endpoint for email validation is https://api.disify.com/v1/email/your_email_here. You'll need to replace your_email_here with the email address you wish to validate and append your API key as a query parameter.
Here are examples demonstrating how to make a basic request using cURL, Node.js, and Python:
cURL Example
cURL is a command-line tool for making HTTP requests and is excellent for quick testing.
curl "https://api.disify.com/v1/email/[email protected]?apiKey=YOUR_API_KEY"
Replace [email protected] with the email you want to validate and YOUR_API_KEY with your actual Disify API key.
Node.js Example
Using the built-in https module or a library like axios (recommended for ease of use).
const https = require('https');
const apiKey = 'YOUR_API_KEY';
const email = '[email protected]';
const url = `https://api.disify.com/v1/email/${email}?apiKey=${apiKey}`;
https.get(url, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
try {
const result = JSON.parse(data);
console.log('Disify API Response:', result);
// Example: check if disposable
if (result.disposable) {
console.log(`${email} is a disposable email address.`);
} else {
console.log(`${email} is not a disposable email address.`);
}
} catch (e) {
console.error('Error parsing JSON:', e);
}
});
}).on('error', (err) => {
console.error('Error making API request:', err.message);
});
Python Example
Using the requests library (install with pip install requests).
import requests
import json
api_key = "YOUR_API_KEY"
email_to_validate = "[email protected]"
url = f"https://api.disify.com/v1/email/{email_to_validate}?apiKey={api_key}"
try:
response = requests.get(url)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
data = response.json()
print("Disify API Response:", json.dumps(data, indent=2))
# Example: check if disposable
if data.get('disposable'):
print(f"{email_to_validate} is a disposable email address.")
else:
print(f"{email_to_validate} is not a disposable email address.")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
except requests.exceptions.ConnectionError as conn_err:
print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
print(f"An unexpected error occurred: {req_err}")
except json.JSONDecodeError:
print("Error decoding JSON response.")
Understanding the Response
A successful response from the Disify API typically returns a JSON object similar to this:
{
"email": "[email protected]",
"format": true,
"disposable": false,
"dns": true,
"blacklist": false,
"score": 0.85
}
email: The email address that was validated.format: Boolean indicating if the email address has a valid format (e.g., contains '@' and a domain).disposable: The key indicator.trueif the email is from a known disposable email provider,falseotherwise.dns: Boolean indicating if the email's domain has valid DNS records.blacklist: Boolean indicating if the email or domain is on a common blacklist.score: A confidence score (0-1) related to the validation.
Focus on the disposable field for your primary use case of detecting temporary email addresses.
Common next steps
After successfully making your first Disify API call, consider these next steps for integrating and optimizing its use within your applications:
- Error Handling: Implement robust error handling in your code to manage network issues, invalid API keys, or rate limit exceeded responses. The Disify API returns standard HTTP status codes (e.g., 400 for bad request, 401 for unauthorized, 429 for rate limiting) that your application should interpret.
- Rate Limiting: Be aware of the Disify API's rate limits, especially on the free tier (1,000 requests/month). If your application requires higher volumes, review the Disify pricing page and consider upgrading to a paid plan. Implement client-side rate limiting or request queuing to avoid exceeding your quota.
-
Advanced Validation Logic: While
disposableis the core field, you might integrate other fields likeformatanddnsinto your validation logic for a more comprehensive check. For instance, you might reject emails that are disposable or have an invalid format. - Integrate with Forms: Use Disify in real-time during user registration or lead capture forms to prevent submissions from disposable email addresses. This can reduce spam, improve lead quality, and ensure better communication with legitimate users.
- Batch Processing (if applicable): If you need to validate a large list of emails asynchronously, consider implementing a batch processing mechanism. While Disify's API is designed for real-time validation, you can queue individual requests if direct batch endpoints are not explicitly provided.
- Monitor Usage: Regularly check your Disify dashboard to monitor your API usage and ensure you are within your plan's limits. This helps in anticipating when an upgrade might be necessary.
Troubleshooting the first call
If your first API call to Disify doesn't return the expected result, here are some common issues and troubleshooting steps:
-
Invalid API Key (HTTP 401 Unauthorized):
- Issue: You receive a
401 Unauthorizedstatus code. - Solution: Double-check that you have copied your API key correctly from your Disify dashboard. Ensure there are no leading or trailing spaces. Verify that the
apiKeyquery parameter is correctly spelled and included in your request URL.
- Issue: You receive a
-
Incorrect Endpoint or Missing Parameters (HTTP 400 Bad Request):
- Issue: You receive a
400 Bad Requeststatus code. - Solution: Confirm that the base URL (
https://api.disify.com/v1/email/) is correct. Ensure the email address is properly appended to the URL and is URL-encoded if it contains special characters (though typically, standard email addresses don't require this).
- Issue: You receive a
-
Network or Connection Issues:
- Issue: No response, timeout, or connection refused errors.
- Solution: Check your internet connection. Ensure there are no firewall rules or proxy settings blocking outgoing HTTPs requests from your environment to
api.disify.com. Try making the request from a different network or tool (e.g., use cURL on your local machine to rule out application-specific issues).
-
Rate Limit Exceeded (HTTP 429 Too Many Requests):
- Issue: You receive a
429 Too Many Requestsstatus code. - Solution: This indicates you've exceeded your plan's request limit. If you are on the free tier, you might have used all 1,000 requests. Wait for your quota to reset or consider upgrading your plan on the Disify pricing page.
- Issue: You receive a
-
JSON Parsing Errors:
- Issue: Your application fails to parse the API response.
- Solution: This usually happens if the API returned an error message that isn't valid JSON, or if the network connection was abruptly closed. Inspect the raw response body. Ensure your code correctly handles potential non-JSON responses (e.g., HTML error pages).
-
Unexpected Results (e.g.,
disposable: falsefor a known disposable email):- Issue: The API returns a result that contradicts your expectation for a specific email.
- Solution: While Disify maintains an extensive database, new disposable email providers emerge. If you encounter a consistent discrepancy, you can report it through Disify's support channels. Also, verify that the email address you are sending is exactly the one you intend to validate.
For more specific error codes and their meanings, refer to the official Disify API documentation.