# fetch · type design

Canonical URL: https://developers.iagenify.com/sdk/ref/tools/fetch-design/
Language: en

`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+.

Status: 1 credit · cached one hour · 6,000 layers at most

```javascript
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 }
```

## A layer {#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 {#rules}

- 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 {#billing}

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`.

- [fetch()](/sdk/ref/tools/fetch): The page as text.
- [screenshot](/sdk/ref/tools/screenshot): The page as an image.

```python
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"}
```
