omghost — Instant SVG Icons via API

1 min read Original article ↗

// 1. Generate an icon

const res = await fetch('https://omghost.xyz/api/generate',

{

method: 'POST',

  

headers:

{

'Content-Type': 'application/json'

}

,

  

body: JSON.stringify(

{

styleName: "neon-glow",

brandName: "My Startup",

brandVoice: "modern, bold",

  

}

)

}

);

const

{

jobId

}

= await res.json();

// 2. Poll for completion

const status = await fetch(

`https://omghost.xyz/api/generate/${jobId}/status`

);

const

{

svg, token

}

= await status.json();

// → svg: "<svg viewBox=..."