Code Examples

Ready-to-use code examples for integrating the ClickyID API

JavaScript/Node.js
Examples for Node.js applications and frontend frameworks

Basic Email Validation

Loading syntax highlighting...

Express.js Integration

Loading syntax highlighting...
Python
Examples for Python applications using requests and popular frameworks

Using requests library

import requests
import os

class ClickyIDClient:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://clickyid.com/api/v1"
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }
    
    def validate_email(self, email, target_group_id):
        """Validate an email against a target group"""
        url = f"{self.base_url}/validate/target-group"
        data = {
            "email": email,
            "targetGroupId": target_group_id
        }
        
        response = requests.post(url, json=data, headers=self.headers)
        response.raise_for_status()
        return response.json()

# Usage
client = ClickyIDClient(os.getenv("CLICKYID_API_KEY"))

try:
    result = client.validate_email("student@stanford.edu", "clh1234567890")
    print(f"Email is valid: {result['isValid']}")
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Django Integration

Loading syntax highlighting...
PHP
Examples for PHP applications and popular frameworks like Laravel

Basic cURL Implementation

Loading syntax highlighting...
cURL
Direct HTTP requests using cURL for testing and integration

Target Group Validation

Loading syntax highlighting...

Offer Validation

Loading syntax highlighting...

Next Steps

Quick Start

Get started with the ClickyID API in just a few minutes.

Authentication

Learn how to authenticate your API requests and manage API keys.

API Reference

Complete reference for all ClickyID API endpoints.

Error Handling

Learn best practices for handling API errors and rate limits.