The Logo Workshop API allows you to generate custom logo SVGs with OpenMoji emoji integration.
GET /api
firstPart- Text for the top line (or full text in single line mode)lastPart- Text for the bottom line (ignored in single line mode)
fontFamily- Font family to use (default: "Arial, sans-serif")textColor- Hex color code for the top line text (default: "#000000")accentColor- Hex color code for the bottom line text and border (default: "#ea5a47")secondaryColor- Hex color code for the bottom accent strip (default: "#781e32")bgColor- Hex color code for the background (default: "#ffffff")boldTop- Whether top line should be bold (default: true, set to "false" to disable)italicTop- Whether top line should be italic (default: false, set to "true" to enable)boldBottom- Whether bottom line should be bold (default: true, set to "false" to disable)italicBottom- Whether bottom line should be italic (default: false, set to "true" to enable)
singleLine- Set to "true" to use single line mode, which splits text at the first space and colors the parts differently (default: false)Note: Fixed values are now used for optimal positioningyOffset- Vertical offset to apply to text (positive moves down, negative moves up).Note: Fixed values are now used for optimal sizingmaxWidth- Maximum width for text in pixels.emojiX- X position for emoji (default: 140)emojiY- Y position for emoji (default: 13.5)emojiScale- Scale factor for emoji (default: 0.71)
emoji- Emoji character to include in the logo (uses OpenMoji SVG)debug- Set to "true" to show guide lines for layout debugging (default: false)format- Set to "json" to get a JSON response with SVG and metadata (default: direct SVG)
The API uses an algorithm based on the logoAPI implementation to position the text lines with these key characteristics:
- The text is always centered at a fixed X position of 112px
- Different positioning logic for single-line and two-line modes:
- Two-Line Mode: Fixed y-offset of 20px and maxWidth of 153px for optimal spacing. Font sizes are automatically calculated to give both lines equal visual width.
- Single-Line Mode: Fixed y-offset of 17px and maxWidth of 175px for optimal positioning. Both parts of text are displayed with the same font size.
- In single-line mode, the text is split at the first space, with the first word in the primary text color and the rest in the accent color, all displayed on a single visual line
Returns an SVG image directly.
Returns a JSON object with the following structure:
{ "success": true, "svg": "<svg>...</svg>", "meta": { "topFontSize": 40, "bottomFontSize": 30, "topY": 42, "bottomY": 80, "textXPosition": 112, "maxWidth": 153, "actualWidth": 220, "singleLineMode": false, "isBoldTop": true, "isItalicTop": false, "isBoldBottom": true, "isItalicBottom": false, "emoji": "π", "emojiCodepoint": "1f680", "emojiX": 140, "emojiY": 13.5, "emojiScale": 0.71, "yOffset": 20 } }
/api?firstPart=AWESOME&lastPart=LOGO
/api?firstPart=COOL&lastPart=PROJECT&fontFamily=Arial&textColor=%23ffffff&accentColor=%23ff0000&bgColor=%23000000
/api?firstPart=PROJECT%20NAME&singleLine=true
/api?firstPart=ROCKET&lastPart=LAUNCH&emoji=π
/api?firstPart=META&lastPart=DATA&format=json
The text positioning algorithm is shared between both the web interface and API for consistent results. Key aspects:
-
Fixed X Position: Text is always centered at X=112px, as specified in project requirements.
-
Mode-Specific Settings:
- Two-line mode uses fixed positioning parameters (y-offset: 20px, maxWidth: 153px) for optimal alignment
- Single-line mode uses fixed positioning parameters (y-offset: 17px, maxWidth: 175px) for optimal appearance
-
Improved Single-Line Mode:
- Properly splits text at the first space
- First word appears in primary text color
- Words after the space appear in accent color
- Both parts of text have the same font size
- All text appears on a single line (using SVG tspans)
-
Vertical Spacing: For two-line mode, the spacing between lines is proportional to font sizes, ensuring proper visual balance.
-
DOM vs Estimation: The web interface uses DOM measurements for precise text sizing, while the API uses a character-based estimation method that produces consistent results.
To embed the logo in a webpage:
<img src="https://dcm31--b0fe0371a0674b288e60ec112f756087.web.val.run/api?firstPart=AWESOME&lastPart=LOGO" alt="Logo" />
For dynamic logo generation in JavaScript:
async function getLogo(firstPart, lastPart, emoji) {
const url = `https://dcm31--b0fe0371a0674b288e60ec112f756087.web.val.run/api?firstPart=${encodeURIComponent(firstPart)}&lastPart=${encodeURIComponent(lastPart)}&emoji=${encodeURIComponent(emoji)}&format=json`;
const response = await fetch(url);
const data = await response.json();
// Use data.svg for the SVG content
document.getElementById('logo-container').innerHTML = data.svg;
}
For single-line mode with words in different colors:
async function getSingleLineLogo(text, emoji) {
// Make sure text has at least one space to trigger the color split
const url = `https://dcm31--b0fe0371a0674b288e60ec112f756087.web.val.run/api?firstPart=${encodeURIComponent(text)}&singleLine=true&emoji=${encodeURIComponent(emoji)}&format=json`;
const response = await fetch(url);
const data = await response.json();
return data.svg;
}
- The API does not support custom sizing of the overall logo (fixed at 301x113.266)
- All text is automatically converted to uppercase
- Only OpenMoji emoji set is supported
- Text X position is fixed at 112px and cannot be changed
- Text positioning parameters are fixed for optimal appearance in both modes
- Single-line mode requires at least one space in the text to trigger the color split effect