Password Generator API
The Password Generator API auto-generates random passwords that are incredibly hard to guess.
/v1/passwordgenerator GET
https://api.api-ninjas.com/v1/passwordgenerator
Returns a random password string adhering to the specified parameters.
Parameters
lengthoptionalLength of password in characters. If not set, a default value of
16is used.exclude_numbersoptionalpremium onlyWhether to exclude numbers from the password. Must be either
trueorfalse. If not set, a default value offalsewill be used.exclude_special_charsoptionalpremium onlyWhether to exclude special characters(
!@#$%^&*()) from the password. Must be eithertrueorfalse. If not set, a default value offalsewill be used.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/passwordgenerator?length=16Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
{
"random_password": "nYs43u5f1oGK9*g5"
}Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/passwordgenerator?length=12&uppercase=true&lowercase=true&numbers=true&special=true" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.