API Documentation
Integrate password strength analysis and quantum resistance estimates into your applications with our simple REST API.
🚀 Quick Start
1. Get Your API Key
Register to receive your free API key:
Response:
2. Make Your First Request
Use your API key to check password strength:
Response:
🔑 Authentication
For API Requests (Programmatic Access)
All API requests require an API key sent in the X-API-Key
header:
For Dashboard Access (Web Browser)
The Developer Dashboard uses secure session-based authentication with httpOnly cookies. To access your dashboard:
- Visit mypasswordchecker.com/dashboard
- Enter your API key to create a secure session
- Your session will last 24 hours
Dashboard authentication endpoints:
⏱️ Rate Limiting
API responses include rate limit headers:
Plan | Tier 1 Quota | Tier 2 Quota |
---|---|---|
Free | 50/month | - |
Standard ($19/mo) | 3,000/month + $0.09 overage | - |
Quantum Monthly ($150/mo) | Included | 1,500/month + $0.09 overage |
📡 API Endpoints
POST /api/auth/register
Register for an API key (no authentication required)
Request Body:
Response (201):
POST /api/v1/check-password
Tier 1 Endpoint - Validate password checking request
Headers:
Request Body:
Response (200):
Error Response (429 - Quota Exceeded):
POST /api/v1/quantum-estimate
Tier 2 Endpoint - Validate quantum resistance estimate request (requires paid plan)
Headers:
Request Body:
Response (200):
Error Response (402 - Payment Required):
GET /api/dashboard/usage
Get current month's usage statistics
Authentication: Supports both API key header and session cookie
Headers (API Key Method):
Headers (Session Method):
Response (200):
💻 Client-Side Implementation
After validating with our API, perform the actual password analysis client-side using zxcvbn:
For quantum estimates, use our quantum estimator module:
⚠️ Error Codes
Code | Meaning | Solution |
---|---|---|
400 |
Bad Request | Check request format |
401 |
Unauthorized | Invalid or missing API key |
402 |
Payment Required | Upgrade plan to access endpoint |
429 |
Too Many Requests | Quota exceeded - upgrade or wait for reset |
500 |
Internal Error | Contact support |
✨ Best Practices
🔒 Security
- Never expose your API key in client-side code
- Store keys as environment variables
- Rotate keys if compromised
- Use HTTPS for all requests
⚡ Performance
- Cache validation responses when possible
- Perform analysis client-side after validation
- Monitor rate limit headers
- Implement exponential backoff for retries
🎯 Usage
- Validate once per user session, not per keystroke
- Display quota remaining to users
- Handle errors gracefully
- Upgrade before hitting quota limits