Save over 30% when you subscribe to an annual subscription plan!

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

  • length  optional

    Length of password in characters. If not set, a default value of 16 is used.

  • exclude_numbers  optionalpremium only

    Whether to exclude numbers from the password. Must be either true or false. If not set, a default value of false will be used.

  • exclude_special_chars  optionalpremium only

    Whether to exclude special characters(!@#$%^&*()) from the password. Must be either true or false. If not set, a default value of false will be used.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

length
https://api.api-ninjas.com/v1/passwordgenerator?length=16

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
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.

We use cookies to enhance your experience
We use cookies to analyze site traffic, personalize content, and improve our services. By clicking "Accept All", you consent to our use of cookies. You can customize your preferences or learn more in our Privacy Policy.