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.