Robohash API
Generate unique robot/monster avatars from any text — free, no key.
What it does
RoboHash turns any text into a unique, deterministic cartoon image — robots by default, or monsters, robot heads, cats or ‘kittens’/humans depending on the set. The same input always produces the same image, which makes it a nice identicon-style avatar.
Base URL
Authentication
None. /{any-text}.png plus options: ?set=set1..set5, ?bgset=bg1|bg2, ?size=200x200, ?format=png|jpg|webp|bmp, ?ignoreext=true (hash the whole path).
Code examples
<img src="https://robohash.org/user-9f8a7b.png?set=set1&bgset=bg2&size=150x150" alt="avatar">
const url = `https://robohash.org/${encodeURIComponent(user.id)}.png?set=set4`; // cats
img.src = url;Rate limits & quotas
No key or documented rate limit; images are deterministic and cache-friendly (the URL is the cache key). Generate once per user and store the URL. Note the input is case- and whitespace-sensitive — normalise it before hashing.
Key response fields
| (image) | The generated PNG/JPEG/WebP |
| set | set1 robots, set2 monsters, set3 robot heads, set4 cats, set5 humans |
| bgset | bg1 (places) or bg2 (patterns); omit for transparent |
| size | WxH, e.g. 256x256 |
Common errors
| (different image than expected) | Trailing slashes, case and extension all affect the hash — be consistent, or use ?ignoreext=true. |
| 404 | Malformed path. |
| (slow first load) | Large sizes render on demand — cache the result. |
When to use it (and alternatives)
Fun, distinctive avatars keyed to a user id or IP — forums, demo accounts, leaderboards. For a broader range of avatar styles use DiceBear; for plain initials, UI Avatars.
FAQ
How do I pick the cat set instead of robots?
?set=set4. set2 is monsters, set5 is humans. set1 (robots) is the default.
Why does the same user get two different robots?
The hash includes the exact path, including case, trailing slash and file extension. Normalise your seed (e.g. lowercase, no slashes) or add ?ignoreext=true.
Can I make the background transparent?
Yes — just omit bgset. Add it (bg1/bg2) only when you want a scene behind the robot.
New to APIs?
Short guides for working with this API — and any other.