Generate one or more passwords. Pass your API key in the X-API-Key header.
Examples
Strong password (curl)
curl -s -X POST https://api.dmxhk.app/password-generator \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"mode": "password",
"length": 32,
"uppercase": true,
"lowercase": true,
"numbers": true,
"symbols": true,
"count": 5
}'
Passphrase (curl)
curl -s -X POST https://api.dmxhk.app/password-generator \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"mode": "passphrase",
"word_count": 5,
"capitalize": true,
"append_number": true,
"separator": "-"
}'
JavaScript (fetch)
const res = await fetch('https://api.dmxhk.app/password-generator', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
body: JSON.stringify({
mode: 'password',
length: 24,
uppercase: true,
lowercase: true,
numbers: true,
symbols: false,
count: 3
})
});
const { ok, data } = await res.json();
console.log(data.passwords);
// ["xK9mRvLpQnDtYwBh3cZj", ...]
Python
import requests
r = requests.post(
'https://api.dmxhk.app/password-generator',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={
'mode': 'passphrase',
'word_count': 4,
'capitalize': True,
'append_number': True,
'count': 10
}
)
data = r.json()['data']
for pw in data['passwords']:
print(pw)
# Bagpipe-Cilantro-Spirited-Claim-92
Response (password mode)
{
"ok": true,
"data": {
"passwords": ["xK9mRvLpQnDtYwBh3cZj4A", "..."],
"mode": "password",
"length": 24,
"entropy_bits": 155.8,
"charset_size": 90
}
}
Response (passphrase mode)
{
"ok": true,
"data": {
"passwords": ["Bagpipe-Cilantro-Spirited-Claim-92"],
"mode": "passphrase",
"word_count": 4,
"entropy_bits": 58.2,
"charset_size": 7776
}
}