Dicebear Avatars

Dicebear Avatars

Development

Generate random pixel-art avatars. Avatars is an avatar placeholder library for designers and developers. You can choose between simple identicons and lovely designed characters. And best of all: We provide a simple and free HTTP API that you can use right away!

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with Dicebear Avatars

πŸš€ Quick Start Examples

Dicebear Avatars Javascript Examplejavascript
// Dicebear Avatars API Example
const response = await fetch('https://avatars.dicebear.com/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

An Introduction to the DiceBear API

If you're looking for a way to generate unique and customizable avatar images, you might want to check out the DiceBear API!

The DiceBear API is a free and open source solution that lets you generate unique avatar images using a simple HTTP request. The images are vector-based, meaning they can be scaled and customized without losing quality.

How to Use the DiceBear API

To use the DiceBear API, you'll need to make an HTTP request to the following URL: https://avatars.dicebear.com/api/:sprites/:seed.svg

  • :sprites: The type of avatar you want to generate. There are currently six different sprites available: male, female, identicon, avataaars, jdenticon, and gridy.
  • :seed: The seed value used to generate the avatar. This can be any string value, such as a username or email address.

For example, to generate a male avatar for the seed value "john@example.com", you would use the following URL: https://avatars.dicebear.com/api/male/john@example.com.svg

To customize the avatar, you can add additional URL parameters to the end of the URL:

  • options[background][]: The background color(s) of the avatar. Multiple values can be specified by repeating this parameter with different values. For example, options[background][]=ff0000&options[background][]=00ff00 would create a striped background with red and green.
  • options[width]: The width of the avatar image in pixels.
  • options[height]: The height of the avatar image in pixels.
  • options[radius]: The border radius of the avatar image in pixels.
  • options[grayscale]: Whether or not to use a grayscale color scheme for the avatar. Set to true or false.

Here's an example of how you can generate a customized avatar using JavaScript:

const seed = "jane@example.com";
const options = {
  width: 200,
  height: 200,
  background: ["#000000", "#ffffff"],
  radius: 100,
  grayscale: true,
};

const url = `https://avatars.dicebear.com/api/avataaars/${seed}.svg?${new URLSearchParams(options)}`;

const img = document.createElement("img");
img.src = url;

document.body.appendChild(img);

This would create a 200x200 avataaars avatar for the seed "jane@example.com", with a black and white striped background, rounded corners, and a grayscale color scheme.

Conclusion

The DiceBear API is a powerful and easy-to-use solution for generating unique and customizable avatar images. By using different sprites and URL parameters, you can create a wide variety of avatars to suit your needs. So go ahead and give it a try!

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

May 31Jun 2Jun 4Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 2904008001440Minutes
Online
Offline

Related APIs in Development