Eranio
Color theme

Icons

Base: /api/icons

This endpoint returns the images of Hytale items as PNG. You need it when your website, your Discord bot or your panel should show items with the icon from the game and not only as text, for example in an inventory view or a shop. The images come straight from the asset files of the server, so items from mods work too. Unlike the other endpoints, the response is not JSON but an image.

Handler: IconsHandler
GET /api/icons/{itemId}/icon

Get item icon

Returns the image of an item as image/png. The path is /api/icons/{itemId}/icon. The itemId is the ID from the item list, optionally with a namespace and a colon, and without a namespace hytale applies.

Parameters

Name Type Required Description
itemId string Yes Item ID

Response Example

"raw PNG bytes (Content-Type: image/png)"

cURL

curl -X GET 'http://localhost:5550/api/icons/Weapon_Sword_Iron/icon' \
  -H 'X-Admin-Token: YOUR_TOKEN'
This endpoint also needs the X-Admin-Token header. An img tag in the browser cannot send custom headers, so you cannot embed the images directly from your website. Fetch them with your server instead and serve or store them yourself. The response carries the header Cache-Control: public, max-age=3600 and may be cached for one hour. If the server finds no image for an item, that is not an error: you still get 200 with a colored placeholder image of 32 by 32 pixels whose color follows from the item ID. So you cannot recognize placeholders by the status code. A 404 only comes if the path does not end in /icon or no image could be created at all. Methods other than GET give 405.

Internal Behavior

Determines the image path from the item configuration, as a fallback Icons/ItemsGenerated/{Name}.png, and searches for it in the asset packs of the server, in each of the subfolders Common, Assets/Common and Assets. The asset pack is chosen by the namespace of the ID. On a hit, the PNG file is delivered unchanged.