code.to.design logo
code.to.design API

Endpoint:https://api.to.design

/html

POST
https://api.to.design
/html

Converts HTML to Figma.

/htmlHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

/html Request Body

  • htmlstring · required

    HTML string to convert to Figma.

  • clipboolean

    true to use Clipboard mode, false to use Plugin mode

  • topLayerNamestring

    Name of the top layer in Figma

  • noAutoLayoutboolean

    true to create layers in Figma without Auto Layout. Default value: false

  • fullsizeImagesboolean

    Only 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 set fullsizeImages to true in 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

  • widthnumber

    Width of the viewport. If width is used then height is required. Default value: 1280

  • heightnumber

    Height of the viewport. If height is used then width is required. Default value: 720

  • themestring · enum

    Affects CSS prefers-color-scheme settings for the import. Default value: light

    Enum values:
    light
    dark

/html Responses

Rate Limiting Response

  • typestring · required

    A URI reference that identifies the problem.

  • titlestring · required

    A short, human-readable summary of the problem.

  • statusnumber · required

    The HTTP status code.

  • instancestring

/balance

GET
https://api.to.design
/balance

Get the number of calls that are still available for your account.

/balanceHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

/balance Responses

Rate Limiting Response

  • typestring · required

    A URI reference that identifies the problem.

  • titlestring · required

    A short, human-readable summary of the problem.

  • statusnumber · required

    The HTTP status code.

  • instancestring