Get an API key
api.tools

fetch · type design

api.tools.fetch({ url, type: "design", viewport?, wait? }) → Promise<{ design, title, url, creditsUsed, cached }>

Turns a live page into editable layers — frames, text, images and vectors, with auto layout where the page uses flexbox. 1 credit, like a capture. SDK 0.4.9+.

1 creditcached one hour6,000 layers at most
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const { design } = await api.tools.fetch({
  url: "https://example.com/",
  type: "design",
  viewport: { width: 1440, height: 900 },
});
// design: { width, height, document: { type: "frame", children: [...] }, assets, fonts, nodeCount, truncated }
result = api.tools.fetch({
    "url": "https://example.com/",
    "type": "design",
    "viewport": {"width": 1440, "height": 900},
})
design = result["design"]
# {"width", "height", "document": {"type": "frame", "children": [...]}, "assets", "fonts", "nodeCount", "truncated"}

A layer

{ type, id, name, x, y, width, height, opacity, rotation, visible, clip, fills, strokes, strokeWeight, radii, effects, layout, text, svg, children }, where type is frame, text, rectangle or vector, and x and y are relative to the parent.

What is kept, and what becomes what

  • A flex container becomes an auto layout: direction, gap, padding, alignment and wrap.
  • A box that only holds a text is that text, with its style.
  • An SVG stays an SVG, shown as an image — never executed.
  • Hidden elements, scripts and styles are left out.
  • Past 6,000 layers the import stops and says so with truncated: true.

The same rules as a capture

Same address filter — a private address is refused before anything is charged —, same one-hour cache, so the same import costs nothing the second time, and the same viewport and wait.