Usage

All requests from the API respond with either an PNG image or an SVG image. The URL can be directly used in an image tag.

Default Settings

Generate an avatar using the default settings, by simply passing the name.

        
        https://smart-avatars.com/avatar?name=Smart Avatars
    

Custom Image Size size

Send any value between 64 and 256. Default: 64

        
        https://smart-avatars.com/avatar?name=Smart Avatars&size=128
    

Custom Initials Length length

Send any value between 1 and 4. Default: 2

        
        https://smart-avatars.com/avatar?name=JFK&length=3
    

Custom Background & Color bgcolor

Send a hex code without the # to generate an avatar with your chosen background color. `color` and `bg` must be used together.

        
        https://smart-avatars.com/avatar?name=Smart Avatars&color=ffffff&bg=D00A00
    

Gradient Backgrounds bg[] Requires API Key. Get yours now.

Send an array of hex codes without the # to generate an avatar with your chosen background color. `color` and `bg` must be used together.

        
        https://smart-avatars.com/avatar?name=Smart Avatars&color=ffffff&bg[]=D62828&bg[]=F77F00
    

Gradient Rotation bg-gradient-rotation Requires API Key. Get yours now.

Send either 0 or 45 or 90 to rotate the background gradient.

        
        https://smart-avatars.com/avatar?name=Smart Avatars&color=ffffff&bg-gradient-rotation=45&bg[]=D62828&bg[]=F77F00
    

Custom Font Size font-size

Send any value between 0.1 and 1. Default: 0.5

        
        https://smart-avatars.com/avatar?name=Smart Avatars&font-size=0.7
    

Custom Font Family font-family Requires API Key. Get yours now.

Smart Avatars supports Google Fonts. See the list of supported google fonts here

        
        https://smart-avatars.com/avatar?name=Smart Avatars&font-family=Karla-BoldItalic
    

SVG Format format=svg

Smart Avatars supports Google Fonts.

        
        https://smart-avatars.com/avatar?name=Smart Avatars&format=svg
    

PNG Format format=png

Rasterized PNG format.

        
        https://smart-avatars.com/avatar?name=Smart Avatars&format=png
    

© 2024 Raju Mandapati. Site inspired from Blade UI Kit.