To generate a custom avatar just embed the following URL https://source.boringavatars.com/ and append a variant, size and a username to generate a custom avatar.
You can use one of the variants marble, beam, pixel, sunset, ring or bauhaus.
https://source.boringavatars.com/beam
https://source.boringavatars.com/marble/40
https://source.boringavatars.com/marble/160
You can pass an array of colors using the parameter color
https://source.boringavatars.com/marble/120/Maria%20Mitchell?colors=264653,2a9d8f,e9c46a,f4a261,e76f51
You can use a username, email or any random text to generate a unique avatar.
https://source.boringavatars.com/marble/120/Maria%20Mitchell
If you just want to use random avatars without providing usernames, you can use the root endpoint. You will receive an svg image with a 80*80px size using the marble variant.
https://source.boringavatars.com/