# SDK Examples

Node.js

```javascript
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('example@domain.com');
    console.log('Verification result:', result);
  } catch (error) {
    // Handle error
  }
  
  // Verify multiple emails
  try {
    const results = await verifyEmails([
      'example1@domain.com',
      'example2@domain.com'
    ]);
    console.log('Bulk verification results:', results);
  } catch (error) {
    // Handle error
  }
})();
```

#### Python

```python
import requests

NOPARAM_API_KEY = 'your_api_key'
BASE_URL = 'https://noparam.com/api/v1'

headers = {
    'Authorization': f'Bearer {NOPARAM_API_KEY}',
    'Content-Type': 'application/json'
}

# Single email verification
def verify_email(email):
    try:
        response = requests.post(
            f'{BASE_URL}/verify',
            json={'email': email},
            headers=headers
        )
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Verification failed: {e}')
        if hasattr(e, 'response') and e.response:
            print(e.response.json())
        raise

# Bulk email verification
def verify_emails(emails):
    try:
        response = requests.post(
            f'{BASE_URL}/verify/bulk',
            json={'emails': emails},
            headers=headers
        )
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Bulk verification failed: {e}')
        if hasattr(e, 'response') and e.response:
            print(e.response.json())
        raise

# Example usage
if __name__ == '__main__':
    # Verify a single email
    try:
        result = verify_email('example@domain.com')
        print(f'Verification result: {result}')
    except Exception:
        # Handle error
        pass
    
    # Verify multiple emails
    try:
        results = verify_emails([
            'example1@domain.com',
            'example2@domain.com'
        ])
        print(f'Bulk verification results: {results}')
    except Exception:
        # Handle error
        pass
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.noparam.com/sdk-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
