密码生成 API
免费 RESTful API,可在你的应用中集成随机密码生成。
Endpoint
GET /api/password FREE 也支持 POST 方法,参数通过 JSON body 发送。
参数
| 参数 | Type | 默认 | 说明 |
|---|---|---|---|
length | number | 16 | 密码长度(4~128) |
upper | boolean | true | 大写字母 |
lower | boolean | true | 小写字母 |
digits | boolean | true | 数字 |
symbols | boolean | false | 特殊字符 |
excludeAmbiguous | boolean | true | 排除易混淆字符(1 l I 0 O) |
count | number | 1 | 生成数量(1~100) |
示例
GET
curl https://ckpsw.com/api/password?length=20&symbols=true&count=5
POST
curl -X POST https://ckpsw.com/api/password \
-H "Content-Type: application/json" \
-d '{"length":24,"symbols":true,"count":3}' 响应(单个)
{ "password": "aB3xK9mP2vR7wL5nQ8jF", "length": 20, "count": 1, "options": { "upper": true, "lower": true, "digits": true, "symbols": true, "excludeAmbiguous": true } } 响应(多个)
{ "passwords": ["aB3xK9mP2v", "L5nQ8jF1wR"], "count": 5, "length": 10, "options": { ... } }