GET
/
v1
curl --request GET \
  --url https://avatars.abstractapi.com/v1

It’s very simple to use: you only need to submit your api_key and a name, and the API will generate an avatar image matching the initials of the given name.

Getting started

REST

The Avatars API, like all of Abstract’s APIs, is organized around REST. It is designed to use predictable, resource-oriented URL’s and to use HTTP status codes to indicate errors.

HTTPS

The Avatars API requires all communications to be secured TLS 1.2 or greater.

API Versions

All of Abstract’s API are versioned. The Avatars API is currently on Version 1.

Your API Key

Your API key is your unique authentication key to be used to access Abstract’s Avatars API. Note that each of Abstract’s API has a unique API key, so you will need different keys to access the Avatars and Email Validation APIs, for example. To authenticate your requests, you will need to append your API key to the base URL.

Base URL

https://avatars.abstractapi.com/v1/

Validation endpoint

Abstract’s Avatars API simply requires your unique API key and the name of the user you’d like to generate an avatar to:

https://avatars.abstractapi.com/v1/
? api_key = YOUR_UNIQUE_API_KEY
& name = Claire Florentz

This was a successful request, so the avatar for the provided name is returned below:

Avatar for Claire Florentz

Request parameters

api_key
String
required

Your unique API key. Note that each user has unique API keys for each of Abstract’s APIs, so your Avatars API key will not work for your IP Geolocation API, for example.

name
String
required

The name you want to create an avatar for. You can submit multiple names (such as first, middle, and last), and the API will default to displaying two letters in the avatar. You can change the number of letters displayed with the char_limit parameter below.

image_size
Integer

The size of the square avatar image in pixels. It defaults to 128 pixels, and is available in sizes from 6 to 512 pixels.

image_format
String

The desired format of the returned image. It defaults to “png”, but can also be specified as “svg”.

font_size
Float

The size of the font as a percent of the image_size. It defaults to 0.7, but it can be set between 0.1 and 1.0.

char_limit
Integer

The maximum number of characters displayed in the avatar. It defaults to 2. The actual number of characters displayed can be less than this number, but it cannot be more. The characters will first be chosen from distinct words, then from the second letter of distinct words.

background_color
String

The hex color for the background. It defaults to #335eea. When including a hex color, you do not need to include the ”#“. So &background_color=e4704a would be valid and &background_color=#e4704a would be invalid.

font_color
String

The hex color for the font. It defaults to white, i.e.,ffffff. When including a hex color, you do not need to include the ”#“. So &font_color=e4704a would be valid and &font_color=#e4704a would be invalid.

is_rounded
Boolean

Returns a rounded avatar picture instead of squared one. It defaults to false.

is_uppercase
Boolean

Sets the initials in the avatar to all capitals. It defaults to true.

is_italic
Boolean

Sets the initials in the avatar to all italics. It defaults to false.

is_bold
Boolean

Sets the initials in the avatar to bold. It defaults to false.