API docs

Pick a template, set two colors, receive the finished emoji file. All requests go to https://tgemoji.app.

Quick start

1. Get an API key: open tgemoji.app/cabinet and log in with Telegram (the site gives you a code, and you confirm it in @TGemoji_app). Then press the button to create your key. The key is shown once, so save it.

2. Send your first request. This renders template 1 and saves it as a Telegram animated emoji file:

curl -X POST https://tgemoji.app/v1/render \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template_id":1,"format":"tgs"}' \
  -o emoji_001.tgs

3. Upload the file to Telegram as a custom emoji. See Use in a Telegram bot.

Authentication

Send your API key in one of two headers. Keep the key private.

X-Api-Key: YOUR_API_KEY

# or

Authorization: Bearer YOUR_API_KEY

Requests without a valid key get 401. Limits per key are listed in Limits.

Templates

Browse the catalog, read one template, or fetch a preview. Browsing does not cost credits.

GET/v1/templates
ParameterDescription
pagePage number. Default 1
per_pageTemplates per page. Default 50
categoryOnly templates from one category. Use a category slug, see below
Response (shortened)
{
  "total": 293,
  "page": 1,
  "per_page": 1,
  "items": [
    {
      "id": "001",
      "width": 512,
      "height": 512,
      "fps": 60,
      "frames": 157,
      "colors": {"main": "#FFFFFF", "secondary": "#B87003"},
      "category": "blue"
    }
  ]
}

The id is written with leading zeros. Use the number (1) as template_id when you render. colors shows the template's current main and second color. The response can contain more fields than shown here.

GET/v1/categories

Lists the categories you can pass as category. Current categories:

SlugName
blueBLUE EMOJI
blackBLACK EMOJI
dark-blueDARK BLUE EMOJI
frameFRAME EMOJI
duckDUCK EMOJI
symbolsSYMBOLS
blast-glowBLAST GLOW
Response (shortened)
{
  "items": [
    {"slug": "blue", "name": "BLUE EMOJI", "count": 61},
    {"slug": "black", "name": "BLACK EMOJI", "count": 102}
  ]
}

count is the number of templates in the category.

GET/v1/templates/{id}

Returns one template with its editable colors.

GET/v1/templates/{id}/preview

Returns the animation as Lottie JSON, so you can show a preview on your site. Optional query parameters: color_main, color_secondary. Files for your customers always come from /v1/render.

The template id is its number, from 1 to 297. A few numbers are hidden, so the catalog lists 293 templates.

Render

Returns the finished emoji as a file. Each successful render costs 1 credit. Rendering the same request again costs another credit.

POST/v1/render
FieldDescription
template_idRequired. Template number, 1 to 297
color_mainOptional. Replaces the template's main color
color_secondaryOptional. Replaces the second color
formatjson (default) or tgs
Request body
{
  "template_id": 1,
  "color_main": "#F0C38E",
  "color_secondary": "#312C51",
  "format": "tgs"
}

Colors

A color is a 6-digit HEX value, with or without the #, in upper or lower case: #F0C38E, f0c38e. Short forms like #FFF and names like red are not accepted and return bad_color. If you leave a color out, the template keeps its original color.

Formats

FormatUse it for
tgsTelegram. This is the animated sticker and custom emoji format (gzipped Lottie)
jsonWebsites and apps. Plain Lottie JSON that any Lottie player can show

Response

The response is the file itself (emoji_001.tgs or emoji_001.json). The header X-Credits-Left shows your remaining credits. If a request fails, no credit is taken.

Five templates have only one editable color. Gradients keep their original colors. The text inside templates cannot be changed.

Balance

Check your account name, credits, number of renders, your plan, and how many renders are left in the last 24 hours.

GET/v1/me
Response
{
  "name": "My Shop",
  "balance": 250,
  "renders": 12,
  "plan": "free",
  "daily_limit": 100,
  "daily_used": 12,
  "daily_left": 88
}

Errors

Errors come back as JSON with an error code and a message. Check the code in your program, not the message: message texts are written in Uzbek and may change.

Example
{
  "error": "insufficient_balance",
  "message": "Balans yetarli emas"
}
StatusCodeMeaning
400bad_colorA color is not a 6-digit HEX value
400bad_formatformat is not json or tgs
401invalid_keyThe API key is wrong or disabled
402insufficient_balanceNo credits left. Nothing was rendered
404template_not_foundThe template does not exist
422(no code)The request body is invalid, for example template_id is missing. The body looks like {"detail": [...]}
429rate_limitedMore than 60 requests in a minute. Wait a moment
429daily_limitThe daily render limit is used up

Limits

LimitValue
Requests60 per minute per key
Renders, free plan100 per rolling 24 hours per key
Renders, pro plan350 per rolling 24 hours per key. To switch to pro, message @TGemoji_app
Colors2 per template (1 for five templates). Gradients stay as they are
TextText inside templates cannot be edited

Rendered files are for your own customers. Reselling or republishing the files as a collection is not allowed, see Terms.

Use in a Telegram bot

A .tgs file becomes a Telegram custom emoji once you add it to a custom emoji set. The Bot API does this with createNewStickerSet for the first emoji and addStickerToSet for the next ones.

Python: render, then create a set
import json
import requests

TGEMOJI_KEY = "YOUR_API_KEY"
BOT_TOKEN = "YOUR_BOT_TOKEN"
BOT_USERNAME = "your_bot"   # without @
USER_ID = 123456789         # Telegram user who owns the set
SET_NAME = "my_emoji_by_" + BOT_USERNAME

# 1) Render the emoji as TGS
r = requests.post(
    "https://tgemoji.app/v1/render",
    headers={"X-Api-Key": TGEMOJI_KEY},
    json={"template_id": 1, "color_main": "#F0C38E", "format": "tgs"},
)
r.raise_for_status()

# 2) Create a custom emoji set with that file
res = requests.post(
    f"https://api.telegram.org/bot{BOT_TOKEN}/createNewStickerSet",
    data={
        "user_id": USER_ID,
        "name": SET_NAME,
        "title": "My emoji",
        "sticker_type": "custom_emoji",
        "stickers": json.dumps([{
            "sticker": "attach://emoji",
            "format": "animated",
            "emoji_list": ["\U0001F600"],
        }]),
    },
    files={"emoji": ("emoji.tgs", r.content, "application/x-tgsticker")},
)
print(res.json())
# The set opens at https://t.me/addemoji/ + SET_NAME
  • The set name must end with _by_ and your bot's username.
  • Telegram has its own limits for TGS files (file size, length, canvas). If Telegram rejects a file, read its error text.
  • Telegram applies its own limits per bot, so create sets at a steady pace.

Code examples

Render template 1 as a TGS file and save it.

curl -X POST https://tgemoji.app/v1/render \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template_id":1,"color_main":"#F0C38E","color_secondary":"#312C51","format":"tgs"}' \
  -o emoji_001.tgs

Questions or a bug? Message @TGemoji_app on Telegram.
© TGemoji.app