This API allows you to generate SVG logos with one or two lines of text, identical to those created by the interactive logo generator. The API returns either the SVG content directly or as a data URL.
https://dcm31--d648296f8b5d46e482fd1d0b768f2a7f.web.val.run
| Parameter | Description | Default |
|---|---|---|
topWord | Top text (or single line text) | "LOGO" |
bottomWord | Bottom text (only used in two-line mode) | "TESTER" |
fontFamily | Font name (must match a name from FontData.tsx) | "Arial" |
backgroundColor | Background color in hex (#RRGGBB) | "#3B82F6" |
textColor | Text color for top text in hex (#RRGGBB) | "#FFFFFF" |
accentColor | Color for bottom text in hex (#RRGGBB) | "#EA5A47" |
secondaryColor | Color for bottom strip in hex (#RRGGBB) | "#781E32" |
singleLine | Set to "true" for single line mode | false |
format | Set to "dataurl" to get a data URL | SVG content |
The API supports the following font options:
- Arial
- Helvetica
- Verdana
- Tahoma
- Trebuchet MS
- Georgia
- Garamond
- Times New Roman
- Courier New
- Segoe UI
- Calibri
- Geneva
- Optima
- Cambria
- Candara
- Avenir
- System UI
Generate a two-line logo with default settings:
https://dcm31--d648296f8b5d46e482fd1d0b768f2a7f.web.val.run?topWord=HELLO&bottomWord=WORLD
Generate a single-line logo:
https://dcm31--d648296f8b5d46e482fd1d0b768f2a7f.web.val.run?topWord=MYLOGO&singleLine=true
Generate a logo with custom colors and font:
https://dcm31--d648296f8b5d46e482fd1d0b768f2a7f.web.val.run?topWord=AWESOME&bottomWord=LOGO&fontFamily=Georgia&backgroundColor=%23FF5733&textColor=%23FFFFFF&accentColor=%23FFD700&secondaryColor=%23900C3F
Get the logo as a data URL (returns JSON):
https://dcm31--d648296f8b5d46e482fd1d0b768f2a7f.web.val.run?topWord=DATA&bottomWord=URL&format=dataurl
Returns the raw SVG content with MIME type image/svg+xml.
Returns a JSON object with the following structure:
{ "success": true, "dataUrl": "data:image/svg+xml;base64,...", "metadata": { "topFontSize": 60, "bottomFontSize": 40, "topY": 45, "bottomY": 90, "singleLine": false } }
- Text is automatically converted to uppercase
- Font sizes are automatically calculated based on text length
- The API uses the same font sizing algorithm as the web generator, ensuring consistent results
- The corner radius is fixed at 15px (same as the OpenMoji design)
- The container size is fixed at 400x150px
- The API uses CORS headers to allow cross-origin requests
This API implementation uses the exact same text sizing and positioning algorithms as the web generator, ensuring consistent output between both. Previously, there were minor visual differences between API-generated logos and those created with the web interface. This has been fixed by:
- Enhancing the server-side text measurement algorithm
- Adding font-specific compensation factors
- Matching vertical positioning calculations
- Using identical SVG generation code
Now logos generated via the API will look identical to those created using the web interface.