The User Avatar 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.
All communications with the User Avatar API must be secured TLS 1.2 or greater.
All of Abstract's API are versioned. The User Avatar API is currently on Version 1.
Your API key is your unique authentication key to be used to access Abstract's User Avatar API. Note that each of Abstract's API has a unique API key, so you will need different keys to access the User Avatar and IP Geolocation APIs, for example. To authenticate your requests, you will need to append your API key to the base URL.
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.
Your unique API key. Note that each user has unique API keys for each of Abstract's APIs, so your IP Geolocation API key will not work for as your User Avatar key, for example.
The size of the square avatar image in pixels. It defaults to 32 pixels, and is available in sizes from 6 to 512 pixels.
The desired format of the returned image. It defaults to "svg", but can also be specified as "png".
The size of the font as a percent of the image_size. It defaults to 0.5, but it can be set between 0.1 and 1.0.
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. For example, with a char_limit of 2, the string "John" will return "JO", "John Smith" will return "JS", and "John Patrick Smith" will return "JS".
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.
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.
Sets the initials in the avatar to all capitals. It defaults to true.
Sets the initials in the avatar to all italics. It defaults to false.
Sets the initials in the avatar to bold. It defaults to false.
To create a user avatar via the API, the absolute minimum required is your unique API key and at least 1 character in the name.
? apikey = YOUR_UNIQUE_API_KEY
& name = John Smith
This simple request would return the following image:
Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.
Everything worked as expected.
The request was unacceptable. Typically due to the API key missing or incorrect.
Internal Server Error
The request could not be completed due to an error on the server side.
The server was unavailable.
When users sign up for an app or website, it's common to allow them to upload an image of themselves. However, in many cases users don't do that right away (or ever!), and you and they are stuck with a bunch of bland and empty spaces where an image should be. You can automatically spice up the interface by adding a custom avatar for that user that's created from their name or initials.
Gravtar describes their service as providing "an image that follows you from site to site appearing beside your name when you do things like comment or post on a blog. Avatars help identify your posts on blogs and web forums, so why not on any site?". This is a very popular option for getting a user's image, but it's not always available. Users of Abstract's User Avatar API will often use our service as a fall back when a gravtar cannot be found.
We support most characters (including emoji!). We're also rolling out support for additional languages and characters like Arabic, Bengali, Hebrew, Chinese, Japanese, and Thai.
August 11, 2020
Added new text formatting and color options
July 1, 2020
Improved support for Hebrew, Arabic, and other right-to-left scripts
July 6, 2020
Added additional avatar color options
Each of our API's has a free plan as well as several paid options, which offer a greater number of requests, a higher level of data quality, and greater speed for higher prices. Please see the page above or sign into your account to view pricing for each API.
Absolutely! We want you to try before you buy. Each of our API's has a free tier with a generous usage allowance for you to try the product out and verify that the speed and data quality work for you.
We use Stripe to accept payment via major debit and credit cards (Visa, Mastercard, American Express). If you cannot use those payment methods, then contact us at team at abstractapi.com to arrange for an alternative payment method.
Yes, you can upgrade or downgrade your subscription at any time by visiting your dashboard. If you upgrade in the middle of a billing cycle, you will be charged a pro-rated amount for your new plan through the end of the billing cycle.
Yes, all of our subscriptions are month to month. You can cancel at any time, and you will not be charged again at the end of your billing cycle.
You can cancel your subscription at any time from your dashboard. Once canceled, your subscription will be active until the end your current billing cycle, and then it will be automatically moved to the free plan.
If your API usage exceeds the monthly limit set by your plan, then you will be charged a fee for each call over your limit. At the end of your billing period, your usage will reset again.
We do offer enterprise plans with custom features and pricing in limited circumstances. If our public pricing plans don't work for you, then contact us (team at abstractapi.com) and we'll work something out.
While we don't normally offer discounts, we do make exceptions for certain types of users and use cases. If you are a student or are engaged in academic work, or are working on a non-profit or open source project, we're happy to offer you discounts for our API's. Just email us at team at abstractapi.com.
All of our plans are currently paid month to month. We will be launching annual plans at a discount soon. If you're interested in an annual plan in the meantime, just contact us and we'll set you up.
We will typically attempt to charge your payment method up to three times after it fails. If we're still unable to collect payment, then your subscription will be automatically canceled and you'll be moved to the free plan.
Yes, a paid tier of our API may be used in conjunction with a commercial project. The free tiers of our API's may not be used in commercial projects.