Getting started overview
Integrating with the EmailRep API involves a structured process that begins with account creation and culminates in a successful API call. EmailRep is designed for developers seeking to assess the reputation of email addresses programmatically, supporting use cases such as fraud prevention, user verification, and threat intelligence enrichment. The API's primary functionality revolves around a single endpoint for looking up email address reputation data.
This guide outlines the essential steps to get the EmailRep API operational. It covers the account registration process, obtaining your API key, and executing a basic request to confirm connectivity and authentication. EmailRep provides a free tier that allows for up to 100 requests per day, which facilitates initial testing and development without immediate cost.
Before proceeding, ensure you have an active internet connection and a development environment set up for making HTTP requests (e.g., cURL, Python with requests library, or similar HTTP client). Understanding HTTP request methods and headers will be beneficial for a smooth integration.
Here's a quick reference for the steps involved:
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Register for an EmailRep account. | EmailRep signup page |
| 2. Get API Key | Locate your unique API key in your account dashboard. | EmailRep dashboard |
| 3. Make Request | Construct and send an HTTP GET request to the EmailRep API endpoint. | Your preferred HTTP client (e.g., cURL, Python) |
| 4. Parse Response | Interpret the JSON response from the API. | Your application code |
Create an account and get keys
To access the EmailRep API, you must first create an account on the EmailRep website. This process is necessary to generate your API key, which serves as your authentication credential for all API interactions.
- Navigate to the Signup Page: Open your web browser and go to the official EmailRep signup page.
- Complete Registration: Provide the required information, typically an email address and a password. Follow any prompts for email verification.
- Access Dashboard: Once registered and logged in, you will be directed to your EmailRep user dashboard.
- Locate API Key: On the dashboard, find the section labeled 'API Key' or 'Developer Settings'. Your unique API key will be displayed there. This key is a long alphanumeric string.
Keep your API key secure and do not expose it in client-side code or public repositories. It should be treated as sensitive information, similar to a password, as it grants access to your EmailRep account's request quota.
Your first request
After obtaining your API key, you can make your first request to the EmailRep API. The primary endpoint for EmailRep is designed to accept an email address and return its reputation data.
The EmailRep API uses a simple RESTful structure. You will send an HTTP GET request to a specific URL, including the email address you want to query and your API key in the Key HTTP header.
API Endpoint
GET https://emailrep.io/query/{email_address}
Replace {email_address} with the actual email address you wish to query, such as [email protected].
Authentication
Include your API key in the HTTP request header as Key: YOUR_API_KEY.
For example, if your API key is abcdef1234567890 and you want to query [email protected], your request would be:
cURL Example
The following cURL command demonstrates how to make a basic request:
curl -X GET \
-H "Key: abcdef1234567890" \
"https://emailrep.io/query/[email protected]"
Python Example
Using Python with the requests library:
import requests
api_key = "abcdef1234567890" # Replace with your actual API key
email_to_query = "[email protected]"
url = f"https://emailrep.io/query/{email_to_query}"
headers = {"Key": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print("Success!")
print(response.json())
else:
print(f"Error: {response.status_code}")
print(response.text)
Expected Response
A successful request will return a JSON object containing various reputation attributes for the queried email address. For example:
{
"email": "[email protected]",
"reputation": "low",
"suspicious": true,
"references": 5,
"details": {
"blacklisted": true,
"malicious_activity": true,
"spam_trap": false,
"domain_reputation": "medium"
},
"deliverability": "undeliverable",
"first_seen": "2020-01-15T10:30:00Z"
}
The specific fields and their values will vary based on the email address queried and the data available to EmailRep. Refer to the EmailRep API documentation for a complete description of response fields.
Common next steps
Once you have successfully executed your first EmailRep API request, consider these common next steps to integrate the service more deeply into your applications:
- Error Handling: Implement robust error handling for various HTTP status codes (e.g.,
401 Unauthorizedfor invalid API key,404 Not Foundfor unknown email,429 Too Many Requestsfor rate limits). Understanding HTTP response status codes is crucial for this. - Rate Limiting Management: EmailRep imposes rate limits based on your subscription tier. Design your application to respect these limits, potentially using client-side throttling or queueing mechanisms. Review the EmailRep documentation on rate limits.
- Data Parsing and Utilization: Integrate the JSON response into your application logic. For example, if
"suspicious": true, your system might flag the user, require additional verification steps, or prevent account creation. - Integration with Workflows: Embed EmailRep checks into your existing user registration flows, lead scoring systems, or fraud detection engines. Services like Tray.io offer low-code platforms that can orchestrate such API calls within broader business workflows.
- Upgrade Subscription: If your usage exceeds the free tier, evaluate EmailRep's paid plans to select a tier that aligns with your anticipated request volume. Paid plans start at $50/month for 5,000 requests.
- Monitor Usage: Regularly check your API usage in the EmailRep dashboard to ensure you stay within your plan's limits and anticipate when an upgrade might be necessary.
Troubleshooting the first call
Encountering issues during your first API call is common. Here are some troubleshooting steps for typical problems:
- Invalid API Key (HTTP 401 Unauthorized):
- Check Key Accuracy: Ensure your API key is copied exactly from your EmailRep dashboard, with no leading or trailing spaces.
- Correct Header Name: Verify that the HTTP header is precisely
Key(case-sensitive) and notAuthorization,X-API-Key, or another common header. - Account Status: Confirm your EmailRep account is active and not suspended.
- Email Address Format (HTTP 400 Bad Request):
- Valid Email: Ensure the email address you are querying is a syntactically valid email format. For example,
[email protected]is valid, butuserexample.comis not. - URL Encoding: If the email address contains special characters, ensure it is URL-encoded.
- Valid Email: Ensure the email address you are querying is a syntactically valid email format. For example,
- Rate Limit Exceeded (HTTP 429 Too Many Requests):
- Free Tier Limits: Remember the free tier is limited to 100 requests per day. If you exceed this, you'll receive a 429. Wait until the next day or consider upgrading your plan.
- Sequential Testing: If running multiple tests quickly, space them out to avoid hitting temporary bursts limits.
- Network Issues:
- Connectivity: Verify your internet connection is stable.
- Firewall/Proxy: Check if a local firewall or corporate proxy is blocking outbound connections to
emailrep.io.
- Incorrect Endpoint URL:
- Exact Match: Ensure the URL is exactly
https://emailrep.io/query/{email_address}. - HTTPS: Confirm you are using
httpsand nothttp.
- Exact Match: Ensure the URL is exactly
- Empty or Unexpected Response:
- Check Status Code: Always check the HTTP status code first. A 200 OK status indicates the request was successful, even if the JSON payload is empty for certain emails.
- Documentation Review: Consult the EmailRep API documentation for expected response structures for various scenarios.
If issues persist, review the EmailRep official documentation for specific error codes and additional guidance.