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 treats the first word offirstPartas the top line and the rest as the bottom line (default: false)Note: y-offset is now fixed at 20pxyOffset- Vertical offset to apply to text (positive moves down, negative moves up, default: 0)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 two text lines with these key characteristics:
- The text is always centered at a fixed X position of 112px (per requirement)
- Font sizes are automatically calculated to give both lines equal visual width
- A fixed y-offset of 20px is applied to all text positions for optimal spacing
- The vertical spacing between lines is proportional to the font sizes with a factor of -0.25
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=ROCKET&lastPart=LAUNCH&emoji=π
/api?firstPart=PROJECT%20NAME&singleLine=true
/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.
-
Equal Visual Width: The algorithm calculates optimal font sizes to make both lines appear to have equal width.
-
Fixed Y Offset: A y-offset of 20px is always applied for optimal vertical positioning.
-
Vertical Spacing: 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.
-
Single Line Mode: Splits the text at the first space, treating the first word as the top line and the rest as the bottom line with different colors.
To embed the logo in a webpage:
<img src="https://dcm31--fd40123818b311f09f78569c3dd06744.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--fd40123818b311f09f78569c3dd06744.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;
}
- 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 Y offset is fixed at 20px and cannot be changed