SDK Examples
Node.js
const axios = require('axios');
const NOPARAM_API_KEY = 'your_api_key';
const baseURL = 'https://noparam.com/api/v1';
// Single email verification
async function verifyEmail(email) {
try {
const response = await axios.post(
`${baseURL}/verify`,
{ email },
{
headers: {
'Authorization': `Bearer ${NOPARAM_API_KEY}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
} catch (error) {
console.error('Verification failed:', error.response?.data || error.message);
throw error;
}
}
// Bulk email verification
async function verifyEmails(emails) {
try {
const response = await axios.post(
`${baseURL}/verify/bulk`,
{ emails },
{
headers: {
'Authorization': `Bearer ${NOPARAM_API_KEY}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
} catch (error) {
console.error('Bulk verification failed:', error.response?.data || error.message);
throw error;
}
}
// Example usage
(async () => {
// Verify a single email
try {
const result = await verifyEmail('[email protected]');
console.log('Verification result:', result);
} catch (error) {
// Handle error
}
// Verify multiple emails
try {
const results = await verifyEmails([
'[email protected]',
'[email protected]'
]);
console.log('Bulk verification results:', results);
} catch (error) {
// Handle error
}
})();Python
Last updated