πŸ› οΈ How to integrate Snap Assets in seconds

Choose your favorite language and start generating dynamic assets in minutes. No complicated SDKs, just HTTP.

const generateAsset = async () => {
  const response = await fetch("https://assets.qbacode.com/api/v1/generate-asset", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      template: "promotional", // or "event", "certificate", "basic"
      productName: "Limited Edition 2026",
      salePrice: "$49.99",
      discount: "20% OFF",
      primaryColor: "#7c3aed",
      imageUrl: "https://yoursite.com/product-photo.jpg"
    }),
  });

  if (response.ok) {
    const blob = await response.blob();
    const url = URL.createObjectURL(blob);
    // Now you can display it in an <img> or download it
    console.log("Image generated:", url);
    
    // Display in an <img>
    document.getElementById("preview").src = url;
    
    // Or download directly
    const a = document.createElement("a");
    a.href = url;
    a.download = "asset.png";
    a.click();
  } else {
    const error = await response.json();
    console.error("Error:", error);
  }
};

generateAsset();
⚑

Instant Response

The API returns a ready-to-use PNG image. P95 latency < 300ms.

🎨

Full Customization

Change colors, texts, images, and fonts. Each asset is unique to your brand.

πŸ”’

No Authentication (Free)

The free plan doesn't require API keys. Perfect for prototypes and personal projects.

⚠️Common Error Handling

400Bad Request: Verify that you sent all required template fields.
429Rate Limit: You've reached your free plan limit (50 requests/day). Upgrade for more.
500Server Error: Internal error. Retry in a few seconds or contact us.

πŸ’‘ Popular Use Cases

πŸ€– Telegram/WhatsApp Bots

Generate certificates, tickets, or personalized coupons for each user automatically.

bot.send_photo(chat_id, asset_bytes)

πŸ“§ Dynamic Email Marketing

Create unique images for each recipient with their name, exclusive discount, or recommended product.

<img src="generated-promo.png" />

🎫 Event Systems

Generate tickets with QR codes, attendee names, ticket types, and event design in real-time.

template: "event"

πŸ† Automatic Certificates

Issue certificates for courses, webinars, or competitions with participant data instantly.

template: "certificate"