# tools.fetch

Canonical URL: https://developers.iagenify.com/es/sdk/workflows/steps/tools-fetch/
Language: es

`type: "tools.fetch"`

Opens a web page in a real browser and returns its readable content. You can also capture an image, set its viewport and wait for visual rendering.

Status: 1 credit · url required · cached for an hour

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `url` | string | required | The page. Private addresses are refused. |
| `timeout` | integer | 20 000 | Milliseconds, between 5 000 and 60 000. |
| `type` | string | page | Use `screenshot` for image-only capture; use `page` for readable content. |
| `screenshot` | boolean | false | Also attach a full-page image to a page result, in the same credit. |
| `viewport` | { width, height } | 1280 × 720 | For an image-only `type: "screenshot"` step, an explicit viewport returns viewport-only pixels; 320–2560 wide and 480–1600 high. |
| `deviceScaleFactor` | 1 | 2 | 3 | 1 | Raster scale; 1× keeps output pixels equal to the viewport. |
| `wait` | integer | 1000 | Extra visual settling time, 0–10000 ms. |

```javascript
{ id: "read", type: "tools.fetch", config: { url: "{{steps.find.output.results.0.url}}" } }
```

## Output {#output}

```javascript
{{steps.read.output.markdown}}      // the readable content — the field you usually want
{{steps.read.output.title}}
{{steps.read.output.timedOut}}
```

`markdown` is what a model should read. `elements.body` is the HTML, several times larger for the same meaning.

## The address is checked {#guard}

Scheme, and that the host resolves to a public address; a redirect does not escape it. On an inbound trigger, where the URL may come from outside, that check is the thing standing between a workflow and whatever somebody typed.

## timedOut is not a failure {#timedout}

What had loaded is returned, with the flag set. A chain that needs the whole page should test it rather than assume.

- [tools.search](/es/sdk/workflows/steps/tools-search): Finding the page.
- [api.tools.fetch()](/es/sdk/ref/tools/fetch): Every field.
- [Workflow steps](/es/sdk/workflows/steps): The 23 types.

```python
{"id": "read", "type": "tools.fetch", "config": {"url": "{{steps.find.output.results.0.url}}"}}
```

```python
"{{steps.read.output.markdown}}"   # the readable content — the field you usually want
"{{steps.read.output.title}}"
"{{steps.read.output.timedOut}}"
```
