PIN Generator

🔐 4-Digit PIN Generator API

Generate secure random PINs with REST API endpoints

⚡ Generate PIN

Allow repeating digits
Start with non-zero
----
0
Total Generated
0
Unique PINs

🔌 API Endpoints

GET /api/generate
Generate a single random 4-digit PIN
GET /api/generate?count=5
Generate multiple PINs (max 100)
GET /api/generate?unique=true
Generate PIN with no repeating digits
POST /api/generate
Generate PIN with custom options
GET /api/generate
{
  "success": true,
  "pin": "7392",
  "length": 4,
  "timestamp": "2026-08-04T18:24:00Z",
  "metadata": {
    "unique_digits": true,
    "non_zero_start": false
  }
}
// Express.js Route
app.get('/api/generate', (req, res) => {
  const options = {
    count: parseInt(req.query.count) || 1,
    unique: req.query.unique === 'true',
    nonZero: req.query.nonZero === 'true'
  };
  
  const pins = generatePINs(options);
  
  res.json({
    success: true,
    pins: pins,
    timestamp: new Date().toISOString()
  });
});
Copied to clipboard!