Generate petnames programmatically via a simple HTTP API
Returns a randomly generated petname as plain text.
| Parameter | Type | Default | Description |
|---|---|---|---|
words |
integer | 2 |
Number of words in the petname (1, 2, or 3). Values outside this range are clamped. |
separator |
string | - |
String used to separate words in the petname. |
The response is plain text (text/plain) containing a single petname followed by a newline.
Request:
curl https://petname.moles.dev/api
Response:
brave-falcon
Request:
curl "https://petname.moles.dev/api?words=1"
Response:
penguin
Request:
curl "https://petname.moles.dev/api?words=3"
Response:
deeply-brave-falcon
Request:
curl "https://petname.moles.dev/api?words=3&separator=_"
Response:
gladly_noble_tiger
Assign to a variable:
NAME=$(curl -s https://petname.moles.dev/api) echo "New server name: $NAME"
Use petname as a Slack slash command to generate names directly in Slack. The result is shown only to you (ephemeral), so you can copy and use it without posting to the channel.
To add /petname to your Slack workspace:
/petnamehttps://petname.moles.dev/api/slackDefault (2-word petname):
/petname
Response (only visible to you):
brave-falcon
Specify word count:
/petname 3
Response:
deeply-brave-falcon
Custom separator:
/petname 2 _
Response:
noble_tiger
The API uses the same word lists as the web generator: 261 adverbs, 449 adjectives, and 452 animal names, providing over 53 million possible 3-word combinations.