twoLineLogoGenerator
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v16View latest version
This API allows you to generate SVG logos with one or two lines of text, similar to the interactive logo generator. The API returns either the SVG content directly or as a data URL.
https://dcm31--052cd264181011f0abe4569c3dd06744.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--052cd264181011f0abe4569c3dd06744.web.val.run?topWord=HELLO&bottomWord=WORLD
Generate a single-line logo:
https://dcm31--052cd264181011f0abe4569c3dd06744.web.val.run?topWord=MYLOGO&singleLine=true
Generate a logo with custom colors and font:
https://dcm31--052cd264181011f0abe4569c3dd06744.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--052cd264181011f0abe4569c3dd06744.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,..." }
- Text is automatically converted to uppercase
- Font sizes are automatically calculated based on text length
- The corner radius is fixed at 15px (same as the OpenMoji design)
- The API uses CORS headers to allow cross-origin requests