# Simon-Lab Pipeline Label Generator > REST API and web UI for creating ISO 20560-compliant pipeline identification labels. Labels auto-size based on pipe diameter. Base URL: https://label.simon-lab.org/ ## REST API POST to `/api/generate` with JSON body. Returns `downloadUrl` to fetch the generated label. ### Decision Order (Important!) 1. **Choose pipe size first** - determines label dimensions and max text length 2. **Set substance text** - if chemical formula like H2SO4, set `isChemicalFormula: true` 3. **Add hazards** - if `hazardous: true`, MUST include `ghs` array with pictogram IDs 4. **Check response warnings** - API returns warnings array if issues detected ### Required Fields - `mediumType`: WATER, GAS, ACIDS, ALKALIS, LIQUID_SOLID, COMPRESSED_AIR, FIRE_SUPPRESSION - `substance`: Main text (max ~20 chars for DN50, ~40 chars for DN150) ### Optional Fields - `info`: Second line of text (reduces max text height by 40%) - `hazardous`: boolean - REQUIRES `ghs` array if true, otherwise yellow band is empty - `ghs`: array of IDs: GHS01_Explosive, GHS02_Flame, GHS03_Oxidizer, GHS04_GasCylinder, GHS05_Corrosion, GHS06_SkullAndCrossbones, GHS07_Exclamation, GHS08_HealthHazard, GHS09_Environment - `isChemicalFormula`: true - renders H2O as H₂O with subscripts - `flowDirection`: left, right, bidirectional, none - `pipeSize`: "50" (default), "100", "150", "200", etc. (DN standard) - `format`: "pdf" (default), "png", "json" ### Common Mistakes to Avoid - Setting `hazardous: true` without `ghs` array → empty yellow band with no symbols - Long text on small pipes → text truncation (check warnings in response) - Chemical formulas without `isChemicalFormula: true` → numbers not rendered as subscripts ### Example Request ```json { "mediumType": "ACIDS", "substance": "H2SO4", "isChemicalFormula": true, "hazardous": true, "ghs": ["GHS05_Corrosion"], "pipeSize": "100", "format": "png" } ``` ### Example Response ```json { "success": true, "warnings": [], "downloadUrl": "/api/download/label_xxx.png", "meta": { "width": 85, "height": 42 } } ``` ## Docs - [API Schema](https://label.simon-lab.org/api/schema): Full endpoint documentation with all options - [Health Check](https://label.simon-lab.org/api/health): Server status and rate limits ## Web Interface - [Label Designer](https://label.simon-lab.org/): Interactive web UI for manual label creation