UI Avatars has a simple-to-use API with no limiting or login. No usage tracking and no information is stored. The final images are cached, but nothing else. Just write name or surname, or both.
NEW! Bold font weight option
NEW! There is now a official Laravel Wrapper
All requests returns a image stream to be used directly in a <img/>
tag.
https://ui-avatars.com/api/?name=John+Doe
https://ui-avatars.com/api/?background=0D8ABC&color=fff
size
)Avatar image size in pixels. Between: 16 and 512. Default: 64
https://ui-avatars.com/api/?size=128
font-size
)Font size in percentage of size
. Between 0.1 and 1. Default: 0.5
https://ui-avatars.com/api/?font-size=0.33
length
)Length of the generated initials. Default: 2
https://ui-avatars.com/api/?length=1
name
)The name used to generate initials. You can specify the initials yourself as well. Default: John Doe
https://ui-avatars.com/api/?name=Elon+Musk
rounded
)Boolean specifying if the returned image should be a circle. Default: false
https://ui-avatars.com/api/?rounded=true
bold
)Boolean specifying if the returned letters should use a bold font. Default: false
https://ui-avatars.com/api/?bold=true
background
)Hex color for the image background, without the hash (#). Default: ddd
https://ui-avatars.com/api/?background=a0a0a0
color
)Hex color for the font, without the hash (#). Default: 222
https://ui-avatars.com/api/?color=ff0000
uppercase
)Decide if the API should uppercase the name/initials. Default: true
https://ui-avatars.com/api/?uppercase=false&name=different+Case
All settings above can be mixed together as you desire.
A good use-case would be using it as a fallback for Gravatar. Example:
https://www.gravatar.com/avatar/EMAIL_MD5?d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/Lasse+Rafn/128
Because of limitations in Gravatar, we must pass in the parameters as sub-directories, instead of query-parameters. You should also consider urlencoding the name, in case it contains special characters. It's a limitation by Gravatar, not UI Avatars.
The order is as follows:I recommend using 1.5x or 2x sizes for your avatars, but keeping the img tag the original size, to ensure crisp avatars on high DPI screens.
I have added support for some unicode scripts/languages that are not supported by the typical fonts. Current support:
It has Wordpress plugin! If you have a Wordpress site, you can use the Wordpress plugin, which is also free.
Servers are setup in the following countries/cities:
Now that the servers are being monitored, I want to clear up what is monitored and stored. But don't worry, the sentence above "No usage tracking and no information is stored" will always be honored.
To aggregate statistics such as avg. response time, number of requests and similar - NGINX access logs has been enabled, with a config that won't store request data. The format is as follows:
log_format aggregate '[$time_local] $status $body_bytes_sent $request_time $upstream_response_time';
These log files are parsed to aggregate the data, and the output (count, avg. response time) is sent to another service which will store it. The log file is then truncated. The actual requests are never stored.