Skip to main content
GET
Avatars API
Using this service is straightforward: simply provide your api_key along with a name, and the system will create an avatar image that corresponds to the initials of the provided name.

Getting started

REST

The Avatars API follows the same architectural pattern as all Cleariflow services, built around REST principles. It employs predictable, resource-focused URLs and utilizes HTTP status codes for error communication.

HTTPS

The Avatars API mandates that all data transmission be protected using TLS 1.2 or higher encryption protocols.

API Versions

Every Cleariflow service includes versioning. The Avatars API presently operates on Version 1.

Your API Key

Your API key serves as your exclusive authentication credential for accessing the Cleariflow Avatars API. Keep in mind that every Cleariflow service possesses its own distinct API key, meaning you’ll require separate keys for different services like Avatars and Email Validation APIs. To verify your requests, you must include your API key in the base URL.

Base URL

Validation endpoint

The Cleariflow Avatars API only needs your exclusive API key and the user’s name for avatar generation:
This request was processed successfully, and the resulting avatar for the specified name appears below: Avatar for Alexander Rodriguez

Request parameters

String
required
Your exclusive API key. Remember that each user possesses unique API keys for every Cleariflow service, so your Avatars API key won’t function with your IP Geolocation API, for instance.
String
required
The name for which you wish to generate an avatar. You can input multiple names (including first, middle, and last), and the service will automatically show two letters in the avatar. You can modify the letter count using the char_limit parameter below.
Integer
The dimensions of the square avatar image in pixels. It automatically defaults to 64 pixels, with available sizes ranging from 6 to 512 pixels.
String
The preferred format for the generated image. It automatically defaults to “png”, but you can also choose “svg”.
Float
The font size expressed as a percentage of the image_size. It automatically defaults to 0.7, with acceptable values between 0.1 and 1.0.
Integer
The maximum character count to display in the avatar. It automatically defaults to 2. The actual character count shown may be fewer than this limit, but never more. Character selection prioritizes distinct words first, then the second letter of distinct words.
String
The hexadecimal color code for the background. It automatically defaults to #335eea. When specifying a hex color, omit the ”#” symbol. For example, &background_color=e4704a is valid while &background_color=#e4704a is invalid.
String
The hexadecimal color code for the text. It automatically defaults to white (ffffff). When specifying a hex color, omit the ”#” symbol. For example, &font_color=e4704a is valid while &font_color=#e4704a is invalid.
Boolean
Generates a circular avatar image instead of a square one. It automatically defaults to false.
Boolean
Converts all initials in the avatar to capital letters. It automatically defaults to true.
Boolean
Applies italic styling to all initials in the avatar. It automatically defaults to false.
Boolean
Applies bold styling to all initials in the avatar. It automatically defaults to false.