Introduction
Cute Avatar Sketch API is an open-source API for generating the cute sketch-style avatars as you want or randomly.
Single Specific Avatar
# Endpoint 1 - Providing Option Names
You can use the following endpoint to get a single specific avatar. Note that you must provide all the required options as query string parameters. You can learn how to get the full list of options here or try out our avatar maker. By default, a png image will be returned. You can choose to return json by passing it as the format query string parameter.
Query String Parameter(s):
facial-expression(required) - Name of the facial expression option, e.g.happyhairstyle(required) - Name of the hairstyle option, e.g.generic-short-hairfacial-feature(required) - Name of the facial feature option, e.g.mole-on-left-chinaccessory(required) - Name of the accessory option, e.g.crownformat(optional) - Format of the response,png(default) orjson
Example(s):
{
"options-id": "8906",
"image-url": "https://cute-avatar-sketch.yukilun.com/avatar/avatar_8906.png",
"facial-expression": "wink",
"hairstyle": "bald",
"facial-feature": "none",
"accessory": "beanie"
}# Endpoint 2 - Providing Options ID
You can also use the following endpoint to get a single specific avatar by providing <options-id> as the path parameter. The <options-id> is simply the concatenation of facial expression option index, hairstyle option index, facial feature option index and accessory option index. Similar to the previous endpoint, you can choose to return json by specifying it in the query string.
Query String Parameter(s):
format(optional) - Format of the response,png(default) orjson
Example(s):
{
"options-id": "2753",
"image-url": "https://cute-avatar-sketch.yukilun.com/avatar/avatar_2753.png",
"facial-expression": "laughter",
"hairstyle": "wavy-long-hair",
"facial-feature": "mole-at-forehead",
"accessory": "snap-hair-clip"
}Single Random Avatar
You can use the following endpoint to get a single random avatar. By default, a png image will be returned. You can choose to return json by passing it as the format query string parameters.
Query String Parameter(s):
format(optional) - Format of the response,png(default) orjson
Example(s):
Try to click on the button in the following examples to fetch a new avatar!
Fetching...
Multiple Random Avatars
The following endpoint allows you to get a list of random avatars. You must pass the number of random avatars (max. 50) you want as the count query string parameter.
All the responses from this endpoint are in json format. By default, only options-id and image-url for each random avatar would be returned. If you want to have the options detail for each avatar, you can pass true to the detail query string parameter.
Query String Parameter(s):
count(required) - Number of random avatar, between1and50detail(optional) - , Boolean for including options detail or not,trueorfalse(default)
Example(s):
Try to click on the button in the following examples to fetch a new avatar!
Options List
To get the list of all avaliable options, you can fetch the following endpoint. Json data would be responded. YOu may also check out the Demo below to know more about the data structure for options list.
Demo:
{
"options": {
"facial-expression": [
"content",
"happy",
"laughter",
"embarrassed",
"unhappy",
"sad",
"surprised",
"proud",
"wink",
"angry"
],
"hairstyle": [
"generic-short-hair",
"blunt-bangs-short-hair",
"curly-short-hair",
"spiky-short-hair",
"generic-medium-hair",
"double-ponytails-medium-hair",
"curtain-bangs-medium-hair",
"wavy-long-hair",
"ponytail-long-hair",
"bald"
],
"facial-feature": [
"none",
"mole-on-left-chin",
"mole-on-right-chin",
"mole-on-left-cheek",
"mole-on-right-cheek",
"mole-at-forehead",
"scar-on-left-chin",
"scar-on-right-chin",
"bandage-on-left-chin",
"bandage-on-right-chin"
],
"accessory": [
"none",
"beret",
"crown",
"snap-hair-clip",
"cap-forwards",
"cap-backwards",
"beanie",
"top-hat",
"car-ears-headband",
"bow-headband"
]
}
}