Files
piNail/SETHPC_LOGO_GENERATOR_API.md

126 lines
2.8 KiB
Markdown

# SETHPC Logo Generator API
Public API endpoint for generating SethPC/Sethflix-style logos as SVG or PNG.
- Base URL: `https://gallery.sethpc.xyz`
- Endpoint: `POST /api/logo`
- Content types: `application/json` or `application/x-www-form-urlencoded`
## Parameters
Required:
- `text` - main logo text
Optional:
- `color` - hex color (`#RRGGBB` or `RRGGBB`), default `#D35400`
- `mode` - `standard` or `lockup`, default `standard`
- `shape` - `normal` or `square`, default `normal`
- `subtext` - required when `mode=lockup`; automatically uppercased
- `format` - `json`, `svg`, or `png`, default `json`
## Behavior
- All generated logos are saved under:
- `/tank/SethFlix Visual Assets/UserGen/`
- Emoji and unsupported glyphs are omitted.
- `lockup` mode generates:
- main logo
- full-width horizontal line
- sans-serif uppercase subtext
- full-width horizontal line
- `shape=square` pads the shorter side so final width and height are equal.
## Response Modes
### 1) `format=json` (default)
Returns metadata and links to the generated asset.
Example:
```bash
curl -sS -X POST "https://gallery.sethpc.xyz/api/logo" \
-H "Content-Type: application/json" \
-d '{
"text": "SETHPC",
"mode": "lockup",
"shape": "square",
"subtext": "gallery expo",
"color": "#D35400",
"format": "json"
}'
```
Sample JSON response:
```json
{
"ok": true,
"text": "SETHPC",
"subtext": "GALLERY EXPO",
"mode": "lockup",
"shape": "square",
"color": "#D35400",
"skipped": [],
"asset_path": "UserGen/sethpc_20260311_123456_000001.svg",
"svg_url": "/asset/UserGen/sethpc_20260311_123456_000001.svg",
"png_url": "/asset-png/UserGen/sethpc_20260311_123456_000001.svg",
"svg_download_url": "/asset/UserGen/sethpc_20260311_123456_000001.svg",
"png_download_url": "/asset-png/UserGen/sethpc_20260311_123456_000001.svg"
}
```
### 2) `format=svg`
Returns generated SVG file directly as attachment.
```bash
curl -L -X POST "https://gallery.sethpc.xyz/api/logo" \
-H "Content-Type: application/json" \
-d '{
"text": "SETHPC.XYZ",
"shape": "square",
"color": "#D35400",
"format": "svg"
}' \
-o "sethpc.svg"
```
### 3) `format=png`
Returns generated PNG directly as attachment.
```bash
curl -L -X POST "https://gallery.sethpc.xyz/api/logo" \
-H "Content-Type: application/json" \
-d '{
"text": "SETHPC",
"mode": "lockup",
"shape": "square",
"subtext": "GALLERY EXPO",
"format": "png"
}' \
-o "sethpc.png"
```
## Error Responses
Common `400` errors:
- missing `text`
- invalid `mode` (must be `standard` or `lockup`)
- invalid `shape` (must be `normal` or `square`)
- invalid `format` (must be `json`, `svg`, or `png`)
- missing `subtext` when `mode=lockup`
Error shape:
```json
{
"ok": false,
"error": "text is required."
}
```