PWGEN API · V1

Passwords for
applications and scripts.

Three public JSON endpoints using cryptographically secure random generation. Up to 60 requests per minute and IP address.

Security model

API passwords are generated on the server and transmitted over HTTPS. They are not stored or cached and should never be sent as URL parameters. For sensitive personal passwords, the local web generator is the better choice.

Endpoints

POST

/api/pwgen/characters

Random character passwords, 1–128 characters.

POST

/api/pwgen/words

One to ten Swedish or English words.

POST

/api/pwgen/sentence

An adjective, noun, verb, and adverb.

Parameters by endpoint

JSON property names are case-insensitive. String values must be supplied exactly as shown.

/characters

ParameterType/allowed valuesDefaultDescription
lengthInteger, 1–12820Total password length.
lowercasetrue or falsetrueIncludes lowercase a–z.
uppercasetrue or falsetrueIncludes uppercase A–Z.
numberstrue or falsetrueIncludes digits 0–9.
specialCharacterstrue or falsetrueIncludes the generator's special characters.
swedishCharacterstrue or falsefalseAdds å, ä, ö, Å, Ä, and Ö.
specialCharacterPercentageInteger, 0–1000Requested percentage. Zero uses a random distribution.

/words

ParameterType/allowed valuesDefaultDescription
languagesv, ensvSelects the Swedish or English word list.
wordCountInteger, 1–104Number of random words.
casinglower, upper, first, titletitleLowercase, uppercase, first word capitalised, or every word capitalised.
numberPositionbefore, after, between, allbeforeDigit sequences before, after, between, or in all positions. between and all cannot be used when wordCount equals 1.
numberLengthInteger, 0–122Digits in each sequence. Zero means no digits and makes the position irrelevant.
replaceSwedishCharacterstrue or falsefalseReplaces å/ä with a and ö with o, including uppercase.
replaceWithSpecialCharacterstrue or falsefalseReplaces a, i, s, and h with @, !, $, and #.

/sentence

ParameterType/allowed valuesDefaultDescription
languagesv, ensvSelects word lists. The result always contains an adjective, noun, verb, and adverb.
casinglower, upper, first, titletitleLowercase, uppercase, first word capitalised, or every word capitalised.
numberPositionbefore, after, between, allbeforeDigit sequences before, after, between, or in all positions.
numberLengthInteger, 0–122Digits in each sequence. Zero means no digits and makes the position irrelevant.
replaceSwedishCharacterstrue or falsefalseReplaces Swedish characters with ASCII equivalents.
replaceWithSpecialCharacterstrue or falsefalseReplaces a, i, s, and h with special characters.

Example: characters

curl -X POST https://www.dadda.se/api/pwgen/characters \
  -H "Content-Type: application/json" \
  -d '{ "length": 24, "lowercase": true, "uppercase": true,
        "numbers": true, "specialCharacters": true,
        "swedishCharacters": false, "specialCharacterPercentage": 0 }'

Example: words

curl -X POST https://www.dadda.se/api/pwgen/words \
  -H "Content-Type: application/json" \
  -d '{ "language": "en", "wordCount": 4, "casing": "title",
        "numberPosition": "between", "numberLength": 2,
        "replaceSwedishCharacters": false,
        "replaceWithSpecialCharacters": false }'

Example: sentence

curl -X POST https://www.dadda.se/api/pwgen/sentence \
  -H "Content-Type: application/json" \
  -d '{ "language": "en", "casing": "first",
        "numberPosition": "after", "numberLength": 3,
        "replaceSwedishCharacters": false,
        "replaceWithSpecialCharacters": true }'

Response

{
  "password": "Example42Password",
  "length": 17,
  "type": "words"
}

Validation errors return HTTP 400. Exceeding the rate limit returns HTTP 429 with Retry-After: 60.

Open the machine-readable OpenAPI specification →