Update a text in figma design and export image

Hey Figma community,

I’m working on a project where I need to update text in my Figma designs programmatically and export images using APIs. Could someone guide me on how to achieve this?

Here’s what I’m aiming to do:

  1. Update Text: Modify text elements within a Figma design using api or something else.
  2. Export Image: And export the updated design as an image file using api or something else.

Example:
Lets say there is a business card design in Figma and i want to update the name of customer in the card and export it as png using api call or something else.

There is no REST API for editing the document but you can export using it. If you need this as an API it’s best to use some other tools for image editing that provide direct editing and export. If you have to use Figma, you can build a plugin, but it won’t be an API.

Thanks Gleb,
But i think i need a API to automate things in the backend.

But there has to be some way to do it else i am in a quite bad position. I tried few Figma to html code plugins but they are not accurate and final design created by them is always messed up

How are Figma to html plugins relevant? I think you are using the wrong terminology to explain what you need or misunderstanding what Figma is because Figma to html plugins are completely unrelated to creating a modify & export API. Can you explain the whole picture?

1 Like

Lets say i have a Business card design on Figma. In this design just the name of the user changes and rest of the design remains same for all users.
Now i can do two things

  • export the design as html and change name of the user from the backend code
  • Or what if Figma allows me to change the name on the design using some api and then i can export the design with updated name using API.

So both the things works for me but right now i am not able to find out any proper solution.

Makes sense. So you don’t really need an API then? You can write a plugin yourself to give you the exact result you need. Or you can use SVG format to export the design and then change it. This way you could do it without the plugin, either using REST API or by having the user export SVG and then upload it to your backend, just like your idea with HTML converters.