Password Ninja API v2 — Get Started
Endpoint https://api.password.ninja/api/v2/password
The Password Ninja API generates random, kid-friendly passwords from URL parameters. No API key is required.
V2 always returns a consistent JSON object, making it straightforward to parse in any language.
# Basic request
curl https://api.password.ninja/api/v2/password
# Response
{
"passwords": ["chickenant40"],
"count": 1
}
Response Format
Every V2 response is a JSON object with two fields:
| Field | Type | Description |
|---|---|---|
| passwords | Array<String> | The generated passwords |
| count | Integer | Number of passwords returned |
# Multiple passwords
curl "https://api.password.ninja/api/v2/password?numOfPasswords=3"
# Response
{
"passwords": ["dogbird23", "catfish91", "bearcrab55"],
"count": 3
}
Errors
On error, an appropriate HTTP status code is returned alongside a JSON body:
{"error": "description of the problem"}
Parameters
https://api.password.ninja/api/v2/password?minPassLength=20
{"passwords":["crabbearcamelsheep74"],"count":1}
https://api.password.ninja/api/v2/password?capitals=true&numAtEnd=3
{"passwords":["DuckCrab279"],"count":1}
https://api.password.ninja/api/v2/password?animals=false&colours=true&food=true&capitals=true&lettersForNumbers=100
{"passwords":["HamY3110w84"],"count":1}
Append parameters to the URL using standard query string format. To pass more than one parameter use & between them.
Boolean parameters only need to be set to true to enable — omit them if not needed. Most values default to false or 0; non-zero defaults are shown in bold.
URL PARAMETERS
| Parameter | Type | Description |
|---|---|---|
| minPassLength | Integer | Minimum password length (8–20). Default: 8 |
| maxLength | Integer | Maximum password length. Default: 20 |
| numAtEnd | Integer | Digits appended after words (0–5). Default: 2 |
| numOfPasswords | Integer | Number of passwords to generate. Default: 1 |
| animals | Boolean | Use the animals word list. Default: true |
| instruments | Boolean | Use the instruments word list |
| colours | Boolean | Use the colours word list |
| shapes | Boolean | Use the shapes word list |
| food | Boolean | Use the food word list |
| sports | Boolean | Use the sports word list |
| transport | Boolean | Use the transport word list |
| symbols | Boolean | Add a random symbol to the end of the password |
| capitals | Boolean | Capitalise the first letter of each word |
| spacers | Boolean | Add - between each word |
| randCapitals | Boolean | Randomly capitalise letters throughout the password |
| lettersForNumbers | Integer | Chance (0–100) to substitute letters with similar-looking numbers — e.g. e→3, o→0 |
| lettersForSymbols | Integer | Chance (0–100) to substitute letters with similar-looking symbols — e.g. a→@, i→!. excludeSymbols also applies. |
| excludeSymbols | String |
Exclude specific symbols using letter codes: e=! d=$ p=% s=* f=. h=# a=@ Example: excludeSymbols=eh excludes ! and #
|
Use with PowerShell
# Single password
$r = Invoke-RestMethod "https://api.password.ninja/api/v2/password"
$r.passwords[0]
# Returns: chickenant40
# Multiple passwords
$r = Invoke-RestMethod "https://api.password.ninja/api/v2/password?numOfPasswords=5"
$r.passwords
# Returns an array of 5 passwords
# With options — capitals, 3 digits
$r = Invoke-RestMethod "https://api.password.ninja/api/v2/password?minPassLength=12&capitals=true&numAtEnd=3"
$r.passwords[0]
# Returns: DuckCrab279
# Write 100 passwords to a CSV
$r = Invoke-RestMethod "https://api.password.ninja/api/v2/password?numOfPasswords=100"
$r.passwords | Set-Content C:\100passwords.csv
V2 returns native JSON, so Invoke-RestMethod deserialises the response automatically. Access passwords via the .passwords property — no string manipulation required.
Note: The maximum practical batch size is around 30,000 passwords. Larger requests may result in a 504 timeout.
Change Log
May 2026
1. Website refreshed with an emphasis on performance and user experience
2. API v2 introduced — all responses now return a consistent JSON format
3. Improved API reliability, error reporting, and request handling
4. Legacy v1 endpoint maintained for backwards compatibility
October 10th 2025
1. Added saving and loading of advanced settings on the main page
2. Added the ability to include - between words (thanks for the suggestion, Peter!)
3. Fixed a bug where saved settings were not applied on page load (thanks, James!)
September 12th 2024
1. Added the ability to replace letters with symbols — excludeSymbols also applies to this feature
2. Added @ symbol exclusion option
3. Fixed bug where the ban list was not being applied to generated passwords
4. Fixed capital letters not being accounted for when replacing letters with numbers
5. Fixed the API using stale word lists when no options were provided
September 11th 2024
1. Fixed browser freeze when minimum and maximum length were set to the same value
2. Removed "white", "yellow", "black", "brown" from the colour set
3. Removed "pig", "monkey", "cow", "ape" from the animals set
4. Added ban list for numbers: 69, 420, 666
5. Added excludeSymbols to the API
Password Ninja API v1 Legacy
Endpoint https://password.ninja/api/password
The original Password Ninja API. This endpoint is maintained for backwards compatibility. For new integrations, use API v2, which provides a consistent JSON response format and improved error reporting.
No API key is required.
# Basic request
curl https://password.ninja/api/password
# Single password — returns a quoted plain string
"chickenant40"
# Multiple passwords — returns a JSON array
["chickenant40","dogbird23","catfish91"]
Response Format
The v1 response format varies based on how many passwords are requested:
| Condition | Response |
|---|---|
| Single password (default) | Quoted plain string — "chickenant40" |
| Multiple passwords | JSON array — ["pass1","pass2"] |
Errors
Errors return an appropriate HTTP status code with a plain text body describing the problem.
Parameters
https://password.ninja/api/password?minPassLength=20
"crabbearcamelsheep74"
https://password.ninja/api/password?minPassLength=10&capitals=true
"DuckCrab27"
https://password.ninja/api/password?animals=false&colours=true&food=true&capitals=true&lettersForNumbers=100
"HamY3110w84"
Parameters are identical to v2. Boolean parameters only need to be set to true — omit them if not needed.
URL PARAMETERS
| Parameter | Type | Description |
|---|---|---|
| minPassLength | Integer | Minimum password length (8–20). Default: 8 |
| maxLength | Integer | Maximum password length. Default: 20 |
| numAtEnd | Integer | Digits appended after words (0–5). Default: 2 |
| numOfPasswords | Integer | Number of passwords to generate. Default: 1 |
| animals | Boolean | Use the animals word list. Default: true |
| instruments | Boolean | Use the instruments word list |
| colours | Boolean | Use the colours word list |
| shapes | Boolean | Use the shapes word list |
| food | Boolean | Use the food word list |
| sports | Boolean | Use the sports word list |
| transport | Boolean | Use the transport word list |
| symbols | Boolean | Add a random symbol to the end of the password |
| capitals | Boolean | Capitalise the first letter of each word |
| spacers | Boolean | Add - between each word |
| randCapitals | Boolean | Randomly capitalise letters throughout the password |
| lettersForNumbers | Integer | Chance (0–100) to substitute letters with similar-looking numbers — e.g. e→3, o→0 |
| lettersForSymbols | Integer | Chance (0–100) to substitute letters with similar-looking symbols — e.g. a→@, i→!. excludeSymbols also applies. |
| excludeSymbols | String |
Exclude specific symbols using letter codes: e=! d=$ p=% s=* f=. h=# a=@ Example: excludeSymbols=eh excludes ! and #
|
Use with PowerShell
# Single password
(Invoke-WebRequest -Uri "https://password.ninja/api/password" | Select-Object -ExpandProperty content)
# Returns: ["dogbee91"]
# Single password, cleaned up
(Invoke-WebRequest -Uri "https://password.ninja/api/password?minPassLength=20" | Select-Object -ExpandProperty content) -replace '[]" []', ''
# Returns: monkeyparrotbughawk65
# With capitals
(Invoke-WebRequest -Uri "https://password.ninja/api/password?minPassLength=10&capitals=true" | Select-Object -ExpandProperty content) -replace '[]" []', ''
# Returns: HawkBird80
# Colours and food, letters replaced with numbers
(Invoke-WebRequest -Uri "https://password.ninja/api/password?animals=false&colours=true&food=true&capitals=true&lettersForNumbers=100" | Select-Object -ExpandProperty content) -replace '[]" []', ''
# Returns: Gr3yGrap323
# Generate 100 passwords into a CSV
$passwords = ((Invoke-WebRequest -Uri "https://password.ninja/api/password?numOfPasswords=100" | Select-Object -ExpandProperty content) -replace "[] []", "").split(",")
for ($i = 0; $i -lt $passwords.Length; $i++){$passwords[$i] | Add-Content C:\100passwords.csv}
V1 returns a plain quoted string for single passwords, requiring string manipulation to extract the value. For cleaner, simpler code consider migrating to API v2.
Note: The maximum practical batch size is around 30,000 passwords. Larger requests may result in a 504 timeout.
Change Log
May 2026
1. Website refreshed with an emphasis on performance and user experience
2. API v2 introduced — v1 endpoint maintained for backwards compatibility
October 10th 2025
1. Added saving and loading of advanced settings on the main page
2. Added the ability to include - between words (thanks for the suggestion, Peter!)
3. Fixed a bug where saved settings were not applied on page load (thanks, James!)
September 12th 2024
1. Added the ability to replace letters with symbols — excludeSymbols also applies to this feature
2. Added @ symbol exclusion option
3. Fixed bug where the ban list was not being applied to generated passwords
4. Fixed capital letters not being accounted for when replacing letters with numbers
5. Fixed the API using stale word lists when no options were provided
September 11th 2024
1. Fixed browser freeze when minimum and maximum length were set to the same value
2. Removed "white", "yellow", "black", "brown" from the colour set
3. Removed "pig", "monkey", "cow", "ape" from the animals set
4. Added ban list for numbers: 69, 420, 666
5. Added excludeSymbols to the API