Text to Image

This endpoint allows you to generate a customizable image with text, background, and text appearance. It supports features such as text size, location, and background images.

Endpoint

  • URL: https://api.erensko.xyz/v1/text-to-image

  • Method: POST

  • Description: This endpoint allows you to generate an image with a provided text, options to change the image vary.

URL Parameters

Key
Value

textSize (optional)

Defines the size of the text. Acceptable values are small, medium, large. Defaults to small.

textLocation (optional)

Determines where the text is placed. Acceptable values are tl (top-left), tr (top-right), m (middle), bl (bottom-left), br (bottom-right). Defaults to m.

Body

Key
Value

text (required)

The text to display in the image.

backgroundHex (optional)

The hex color code for the background. Defaults to #FFFFFF.

backgroundURL (optional)

A URL for an image to be used as the background. If this is provided, the backround hex will be overrided and the the image will be the backround.

textHex (optional)

The hex color code for the text. Defaults to #000000.

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

POST https://api.erensko.xyz/v1/text-to-image?textSize=large&textLocation=bl
{
  "text": "Happy Birthday, Alex!",
  "backgroundURL": "https://cdn.discordapp.com/example-image.png",
  "textHex": "#FFFFFF"
}

Response

{
  "url": "https://api.erensko.xyz/temp/1699374678592-nh3vgjlo8.png"
}

Last updated