Developer API

Code Plagiarism
Detection API

Build plagiarism detection into your apps. Check code against 20+ billion sources.

const response = await fetch('https://codequiry.com/api/v1/check', { method: 'POST', headers: { 'apikey': 'YOUR_API_KEY' }, body: formData }); // Check created!
VALIDATE API KEY

Validate Your API Key

Verify that your API key is valid and retrieve basic account information. Use this endpoint to test connectivity and confirm your credentials before making other API calls.

API Endpoint

GET/POST https://codequiry.com/api/v1/auth/validate
Health Check: This is the perfect endpoint to use as a health check or connectivity test in your application startup sequence.

Authentication

Include your API key in the request header:

apikey: YOUR_API_KEY_HERE

Success Response

HTTP Status: 200 OK

{
    "valid": true,
    "user_id": 12345,
    "email": "[email protected]",
    "name": "John Developer"
}
        
JSON Response
Response Fields
  • valid — Boolean confirming the API key is valid and active
  • user_id — Your unique user identifier
  • email — The email address associated with your account
  • name — Your account display name

Error Responses

401 Unauthorized

The API key is invalid, expired, or missing from the request headers.

403 Forbidden

The API key is valid but the account has been suspended or restricted.

Code Examples

cURL
curl -X GET "https://codequiry.com/api/v1/auth/validate" \
  -H "apikey: YOUR_API_KEY_HERE"
        
cURL
JavaScript
async function validateApiKey(apiKey) {
    try {
        const response = await fetch('https://codequiry.com/api/v1/auth/validate', {
            headers: { 'apikey': apiKey }
        });

        const data = await response.json();

        if (data.valid) {
            console.log(`API key valid! Welcome, ${data.name}`);
            return true;
        } else {
            console.error('API key is invalid');
            return false;
        }
    } catch (error) {
        console.error(`Validation failed: ${error.message}`);
        return false;
    }
}

// Use as a startup health check
const isValid = await validateApiKey('YOUR_API_KEY_HERE');
if (!isValid) process.exit(1);
        
JavaScript
Python
import requests
import sys

def validate_api_key(api_key):
    """Validate API key and return account info."""
    response = requests.get(
        'https://codequiry.com/api/v1/auth/validate',
        headers={'apikey': api_key}
    )

    if response.status_code == 200:
        data = response.json()
        if data.get('valid'):
            print(f"API key valid! Welcome, {data['name']}")
            return data

    print("API key is invalid")
    return None

# Startup validation
account = validate_api_key('YOUR_API_KEY_HERE')
if not account:
    sys.exit(1)
        
Python

Common Use Cases

Health Checks

Verify API connectivity and key validity during application startup or deployment.

Key Rotation

Validate new API keys before switching from old keys in your configuration.

Setup Wizards

Verify user-provided API keys in configuration or onboarding flows.