API Documentation
Integrate secure password generation into your applications with our comprehensive JavaScript API and REST endpoints
Quick Start
Get started with our API in just a few lines of code. All password generation happens client-side for maximum security.
JavaScript API Reference
SafePasswordGen.generate(options)
Generates a cryptographically secure password using the Web Crypto API.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
length | number | 16 | Password length (8-128 characters) |
includeUppercase | boolean | true | Include uppercase letters (A-Z) |
includeLowercase | boolean | true | Include lowercase letters (a-z) |
includeNumbers | boolean | true | Include numbers (0-9) |
includeSymbols | boolean | true | Include symbols (!@#$%^&*) |
excludeSimilar | boolean | false | Exclude similar characters (0,O,l,1,I) |
excludeAmbiguous | boolean | false | Exclude ambiguous symbols ({},[],(),\/,~,;,<>) |
easyToType | boolean | false | Use only easy-to-type characters |
Example Usage
๐ Passphrase Generation
SafePasswordGen.generatePassphrase(options)
Generate memorable passphrases using a curated word list.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
wordCount | number | 4 | Number of words (3-8) |
separator | string | " " | Word separator |
capitalize | boolean | false | Capitalize first letter of each word |
includeNumbers | boolean | false | Add random numbers |
Example Usage
๐ข Bulk Generation
SafePasswordGen.generateBulk(options)
Generate multiple passwords at once for batch operations.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
count | number | 10 | Number of passwords to generate (1-1000) |
format | string | "array" | Output format: "array", "csv", "json" |
passwordOptions | object | {} | Options for individual password generation |
Example Usage
๐งช Interactive API Tester
Test our API directly in your browser. Try different configurations and see the results instantly.
Password Generator Test
Passphrase Generator Test
Security & Privacy
Our API is designed with security and privacy as the top priorities:
- Client-Side Generation: All passwords are generated in your browser using the Web Crypto API
- No Data Transmission: Passwords never leave your device or our servers
- Cryptographically Secure: Uses
crypto.getRandomValues()
for true randomness - No Logging: We don't track, store, or log any generated passwords
- Open Source: Our generation algorithms are transparent and auditable
๐ฑ Browser Support
Our API works in all modern browsers that support the Web Crypto API:
- Chrome 37+
- Firefox 34+
- Safari 7+
- Edge 12+
- Internet Explorer 11+ (with polyfill)
Frequently Asked Questions
Q: Is there a rate limit for the API?
A: No, there are no rate limits. Since all generation happens client-side, you can generate as many passwords as needed without restrictions.
Q: Can I use this API in commercial applications?
A: Yes, our API is free to use in both personal and commercial applications. We only ask that you don't resell our API as a service.
Q: How do I handle errors in my application?
A: Our API throws descriptive errors for invalid parameters. Always wrap API calls in try-catch blocks for production use.
Q: Can I customize the character sets?
A: Currently, we provide predefined character sets for security reasons. Contact us if you need custom character sets for specific use cases.