---
title: "Fetch web page text"
method: POST
path: "/api/v2/agent/fetchWebPage"
tags: ["Agent"]
---

# Fetch web page text

`POST /api/v2/agent/fetchWebPage`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/agent/fetchWebPage`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Fetch readable text from an HTTP or HTTPS URL for the assistant. Use this for documentation, advisories, release notes, or other web content allowed by the deployment network policy. Private hosts are supported on self-hosted deployments. The fetcher validates redirects, blocks protected destinations and embedded credentials, caps response size, and only returns supported text responses.

## Request body

- AgentFetchWebPageRequest
  - `organizationId` string: Organization ID (injected by MCP server)
  - `url` string, uri, required: Absolute HTTP or HTTPS URL to fetch. Private hosts are allowed on self-hosted deployments. Loopback, cloud metadata, protected deployment infrastructure, and embedded credentials are blocked.
  - `maxBytes` integer: Maximum response bytes to read before truncating. Defaults to 100000 and is capped at 200000.
  - `timeoutMs` integer: Request timeout in milliseconds. Defaults to 10000 and is capped at 15000.

## Response `200`

Fetched web page text

- AgentFetchWebPageResponse
  - `finalUrl` string, required: Final URL after following safe redirects.
  - `status` integer, required: HTTP status code returned by the final URL.
  - `contentType` string, required: Response Content-Type header, or empty when the server did not send one.
  - `content` string, required: Fetched textual content. HTML responses are converted to readable text before being returned.
  - `truncated` boolean, required: Whether the response was truncated at maxBytes.
  - `bytesRead` integer, required: Number of response bytes included in content before text normalization.

## Other responses

- `400`: Error Response
- `401`: Error Response
- `415`: Error Response
- `504`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
