How do you script image generation?
Call a template API from Python, Node, or curl. Layerre renders a Canva design from a JSON payload and returns an image URL. You write the loop. You do not draw the layout in code.
Scripting images usually gets confused with drawing images. If the poster, card, or certificate already exists in Canva, you do not want a loop that places pixels. You want a loop that sends the name, the price, or the photo URL and gets a finished file back.
Pillow, ImageMagick, and HTML canvas are the right tools when the layout itself lives in code and a designer is not going to open Canva. They are the wrong tools when the brand file already exists and the only thing that changes is the data.
| Tool | You write | Template lives in |
|---|---|---|
| Pillow, ImageMagick, canvas | Pixels and layout | Code |
| Bannerbear or Placid | API calls | Their editor |
| Layerre | API calls | Canva |
What the script actually does
- Create a template in Layerre from the Canva share link. That is a one-time step. The script does not re-import the design on every row.
- For each row or each event, POST overrides for the text and image layers you named. Python, Node, and curl all make the same HTTP call.
- Read the image URL from the response and store it. The next system (email, CMS, ad account) fetches that URL. It does not need Canva open.
Request shapes are in the API docs. Render the first payload by hand and look at the image before you loop a thousand rows.
A small example
A nightly job reads new products from a table: title, price, photo. For each row it calls the same template and writes the returned URL back to image_url. The storefront already knows how to show an image URL. You did not teach it how to draw.
Free is 50 credits. Starter is $15 a month for 500. One call that returns an image is one credit. A failed typo that you regenerate is another.
If you are deciding whether to own the renderer at all, see build vs buy an image generation API.
Ready to generate images from your Canva designs?
Import your Canva templates and start generating via API in minutes. Free tier included; no credit card required.
Related Questions
- What is an image generation API?
- How do you generate images from an API?
- Should you build or buy an image generation API?



