/balance
Get the number of credits that are still available for your account.
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Responses
Rate Limiting Response
typestring · requiredA URI reference that identifies the problem.
titlestring · requiredA short, human-readable summary of the problem.
statusnumber · requiredThe HTTP status code.
instancestring
/html
Converts a single HTML to Figma.
Cost: 1 credit per call
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Request Body
htmlstring · requiredHTML string to convert to Figma.
clipbooleantrueto use Clipboard mode,falseto use Plugin modetopLayerNamestringName of the top layer in Figma
noAutoLayoutbooleantrueto create layers in Figma without Auto Layout. Default value:falsefullsizeImagesbooleanOnly relevant when
clip=true. By default, images are resized to match the rendering size of this image in the HTML code (Taking into account HiDPI). You can setfullsizeImagestotruein order to keep maximum image resolution as available in the HTML code but it will increase the size of the clipboard data. Default value:falsewidthnumberWidth of the viewport. If
widthis used thenheightis required. Default value:1280heightnumberHeight of the viewport. If
heightis used thenwidthis required. Default value:720themestring · enumAffects CSS
prefers-color-schemesettings for the import. Default value:lightEnum values:lightdark
Responses
Successful conversion - payload is smaller than 30MB. Result data is included in body of the response.
/html-multi
Converts multiple HTMLs to a single Figma result. This is particularly useful to combine multiple HTML codes into a single Figma clipboard result.
Each screens are presented side-by-side from left to right when applied in Figma.
Cost: 1 credit per 4 screen/variations
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Request Body
screensobject[] · requiredList of HTML code and viewport sizes to import
clipbooleantrueto use Clipboard mode,falseto use Plugin modenoAutoLayoutbooleantrueto create layers in Figma without Auto Layout. Default value:falsefullsizeImagesbooleanOnly relevant when
clip=true. By default, images are resized to match the rendering size of this image in the HTML code (Taking into account HiDPI). You can setfullsizeImagestotruein order to keep maximum image resolution as available in the HTML code but it will increase the size of the clipboard data. Default value:false
Responses
Successful conversion - payload is smaller than 30MB. Result data is included in body of the response.
/html-component
Creates a Figma Component from an HTML page containing all variants.
Each variant in the HTML code must have the following data-* attributes:
- data-c2d-cmp-name="name of the component"
- data-c2d-cmp-variants="list of variant properties"
And optionaly link property is some sub-nodes:
- data-c2d-cmp-text-property="name of the property"
- data-c2d-cmp-slot-property="name of the property"
Example for a "Button" component:
Code
Cost: 1 credit
⚠️ Only works for clipboard output.
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Request Body
htmlstring · requiredHTML code containing all the component variants.
clipboolean · requiredtrueto use Clipboard mode,falseto use Plugin mode - Plugin mode is unsupported for components
noAutoLayoutbooleantrueto create layers in Figma without Auto Layout. Default value:falsefullsizeImagesbooleanOnly relevant when
clip=true. By default, images are resized to match the rendering size of this image in the HTML code (Taking into account HiDPI). You can setfullsizeImagestotruein order to keep maximum image resolution as available in the HTML code but it will increase the size of the clipboard data. Default value:falsethemestring · enumAffects CSS
prefers-color-schemesettings for the import. Default value:lightEnum values:lightdark
Responses
Successful conversion - payload is smaller than 30MB. Result data is included in body of the response.
/html-multi-components
Creates multiple Figma Component together in one output payload.
See endpoint /html-component for more details.
Cost: 1 credit per 4 components
⚠️ Only works for clipboard output.
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Request Body
screensobject[] · requiredList of HTML code for each component
clipboolean · requiredtrueto use Clipboard mode,falseto use Plugin mode - Plugin mode is not supported here
noAutoLayoutbooleantrueto create layers in Figma without Auto Layout. Default value:falsefullsizeImagesbooleanOnly relevant when
clip=true. By default, images are resized to match the rendering size of this image in the HTML code (Taking into account HiDPI). You can setfullsizeImagestotruein order to keep maximum image resolution as available in the HTML code but it will increase the size of the clipboard data. Default value:false
Responses
Successful conversion - payload is smaller than 30MB. Result data is included in body of the response.
/clip
[BETA - EARLY ACCESS] Convert clipboard data from Figma to HTML.
Returns a zip file with an index.html for each top frames in the clipboard data.
With this API, users can copy/paste Figma frames into your application and you get clean pixel-perfect HTML.
Cost: 1 credit per index.html created in the zip file returned.
Headers
Authorizationstring · requiredThe
Authorizationheader is used to authenticate with the API using your API key. Value is of the formatBearer YOUR_KEY_HERE.
Request Body
clipboardstring · requiredRaw Figma paste-string (the
text/htmlpayload Figma writes to the clipboard on Cmd+C).
outputstring · enumOutput format of the HTML.
html-inlinestyles= CSS is inlined instyleattributes on each HTML node.html-tailwindcss= CSS is applied with TailwindCSS classes on each HTML node. Default value:html-inlinestyles.Enum values:html-inlinestyleshtml-tailwindcss
Responses
Successful conversion - payload is smaller than 30MB. Result data is included in body of the response.