API Key ডকুমেন্টেশন
API keys দিয়ে GMCheck API ব্যবহারের সম্পূর্ণ গাইড
Overview
API Key Premium users কে login authentication ছাড়াই email verification API ব্যবহার করতে দেয়। API Key endpoints আলাদা prefix /api/v1/ ব্যবহার করে এবং encryption দরকার হয় না।
প্রয়োজনীয় শর্ত
- শুধু Premium Plan: API Key feature শুধুমাত্র premium users এর জন্য
- প্রতি user শুধু একটি API key রাখতে পারে
- API key endpoints encryption ব্যবহার করে না; requests ও responses plain text
শুরু করুন
1. API Key তৈরি করুন
প্রথমে web interface থেকে API key generate করুন:
- আপনার account এ login করুন
- Profile menu তে ক্লিক করুন
- "API Key" নির্বাচন করুন; এটি শুধু premium users দেখবে
- "Generate API Key" চাপুন
- গুরুত্বপূর্ণ: API key সঙ্গে সঙ্গে copy করে save করুন; পরে এটি আর full দেখা যাবে না
Warning: API key generate হওয়ার পর আপনি এটি আর full দেখতে পারবেন না। নিরাপদ জায়গায় save করুন।
2. API Key ব্যবহার করুন
API Key তিনভাবে দেওয়া যায়:
- X-API-Key Header (Recommended):
X-API-Key: your-api-key-here - Authorization Header:
Authorization: Bearer your-api-key-here - Query Parameter (কম নিরাপদ):
?apiKey=your-api-key-here
API Endpoints
সব API key endpoints /api/v1/ prefix ব্যবহার করে এবং encryption দরকার হয় না।
1. Emails চেক করুন
Email addresses check করার জন্য job submit করুন।
Endpoint:
POST /api/v1/check-emailsRequest:
{
"input": "[email protected]\[email protected]\[email protected]"
}Response:
{
"success": true,
"code": "JOB_SUBMITTED",
"message": "Job submitted successfully",
"data": {
"jobId": "job-123-1234567890",
"status": "pending",
"emailsCount": 3
}
}2. Job History নিন
আপনার jobs এর paginated list নিন।
Endpoint:
GET /api/v1/jobs/history?page=1&limit=203. Job Stats নিন
নির্দিষ্ট job এর summary statistics নিন।
Endpoint:
GET /api/v1/jobs/:jobId/stats4. Job Detail নিন
সব results সহ complete job details নিন।
Endpoint:
GET /api/v1/jobs/:jobId5. Usage Statistics নিন
আপনার current usage statistics নিন।
Endpoint:
GET /api/v1/usageCode Examples
cURL উদাহরণ
# Check Gmail addresses
curl -X POST https://api.gmcheck.live/api/v1/check-emails \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{"input": "[email protected]\[email protected]"}'
# Get job stats
curl -X GET https://api.gmcheck.live/api/v1/jobs/job-123-1234567890/stats \
-H "X-API-Key: your-api-key-here"Python উদাহরণ
import requests
API_KEY = "your-api-key-here"
BASE_URL = "https://api.gmcheck.live/api/v1"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
# Check emails
response = requests.post(
f"{BASE_URL}/check-emails",
headers=headers,
json={"input": "[email protected]\[email protected]"}
)
job_data = response.json()
job_id = job_data["data"]["jobId"]
# Get job stats
stats_response = requests.get(
f"{BASE_URL}/jobs/{job_id}/stats",
headers=headers
)
stats = stats_response.json()
print(stats)JavaScript উদাহরণ
const API_KEY = "your-api-key-here";
const BASE_URL = "https://api.gmcheck.live/api/v1";
const headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
};
// Check Gmail addresses
const checkEmails = async () => {
const response = await fetch(`${BASE_URL}/check-emails`, {
method: "POST",
headers: headers,
body: JSON.stringify({
input: "[email protected]\[email protected]"
})
});
const data = await response.json();
const jobId = data.data.jobId;
// Poll for job completion
const pollJob = async () => {
const statsResponse = await fetch(`${BASE_URL}/jobs/${jobId}/stats`, {
headers: headers
});
const stats = await statsResponse.json();
if (stats.data.status === "completed") {
// Get full results
const detailResponse = await fetch(`${BASE_URL}/jobs/${jobId}`, {
headers: headers
});
const detail = await detailResponse.json();
console.log(detail.data.result);
} else {
// Poll again after delay
setTimeout(pollJob, 2000);
}
};
pollJob();
};Email Status Values
LIVE: Email valid এবং activeVERIFY: Email verification দরকারDISABLE: Email disabledNOT_EXIST: Email নেইUNKNOWN: Status unknownPENDING: Email এখনও process হচ্ছে
Job Status Values
pending: Job queue তে আছে এবং processing এর অপেক্ষায়processing: Job বর্তমানে process হচ্ছেcompleted: Job সফলভাবে complete হয়েছেstopped: Job user থামিয়েছেfailed: Job complete হতে ব্যর্থ
Security Best Practices
- API key কখনও share করবেন না: password এর মতো নিরাপদে রাখুন
- Environment variables ব্যবহার করুন: API keys code এ hardcode করবেন না
- Regular rotation করুন: সময় সময় API key regenerate করুন
- Compromise সন্দেহ হলে revoke করুন: সন্দেহজনক activity দেখলে key সঙ্গে সঙ্গে revoke করুন
- শুধু HTTPS ব্যবহার করুন: API requests সবসময় HTTPS দিয়ে পাঠান
- Usage monitor করুন: unauthorized access ধরতে usage statistics নিয়মিত দেখুন
Error Responses
Invalid API Key:
{
"success": false,
"code": "INVALID_API_KEY",
"message": "Invalid API key. Please check your API key and try again."
}Premium Required:
{
"success": false,
"code": "PREMIUM_REQUIRED",
"message": "API key feature is only available for premium users."
}Monthly Limit Exceeded:
{
"success": false,
"code": "MONTHLY_LIMIT_EXCEEDED",
"message": "Monthly limit exceeded. You have checked 100000 / 100000 emails this month."
}Support
API keys সম্পর্কিত issue বা question এর জন্য contact page বা Telegram দিয়ে support এ যোগাযোগ করুন।