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.

https://cute-avatar-sketch.yukilun.com/api/avatar

Query String Parameter(s):

  • facial-expression (required) - Name of the facial expression option, e.g. happy
  • hairstyle (required) - Name of the hairstyle option, e.g. generic-short-hair
  • facial-feature (required) - Name of the facial feature option, e.g. mole-on-left-chin
  • accessory (required) - Name of the accessory option, e.g. crown
  • format (optional) - Format of the response, png (default) or json

Example(s):


# 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.

https://cute-avatar-sketch.yukilun.com/api/avatar/<options-id>

Query String Parameter(s):

  • format (optional) - Format of the response, png (default) or json

Example(s):


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.

https://cute-avatar-sketch.yukilun.com/api/random

Query String Parameter(s):

  • format (optional) - Format of the response, png (default) or json

Example(s):

Try to click on the button in the following examples to fetch a new avatar!


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.

https://cute-avatar-sketch.yukilun.com/api/random/list

Query String Parameter(s):

  • count (required) - Number of random avatar, between 1 and 50
  • detail (optional) - , Boolean for including options detail or not, true or false (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.

https://cute-avatar-sketch.yukilun.com/api/options

Demo:

© 2023 Cute Avatar Sketch! Created by Yuki Lun