---
title: "Fetch a page of a site or app, live"
method: GET
path: "/sites/{id}/fetch"
tags: ["Sites"]
---

# Fetch a page of a site or app, live

`GET /sites/{id}/fetch`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/sites/{id}/fetch`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `sites:read`)

Fetches one path of a site or app of this project from the public internet, through Hypamoon's server, and returns the status, the main headers (never set-cookie), the final URL after redirects and the start of the body as text. The way to prove that a deployed site or app endpoint works live, for a client that cannot open the address itself. Only addresses of this project: the site's own address (also the secret link of an unlisted site) and its connected domains; give path (on the site's address) or a full url on one of them. Redirects are followed up to 3 times, and only to addresses of this project; otherwise redirect_blocked says why and the redirect itself is returned. GET or HEAD only, without cookies or keys, a 10 second timeout per hop, the body cut at 20 KB (truncated), private addresses refused. At most 30 requests per minute per project (429 rate_limited). A site that does not answer gives 502 upstream_error.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `path` string
- `url` string, uri
- `method` 'GET' | 'HEAD'

## Response `200`

What the site answered.

- SitePage
  - `url` string, required: The address that was asked for.
  - `final_url` string, required: The address that answered, after the redirects that were followed.
  - `method` 'GET' | 'HEAD', required
  - `status` integer, required: The HTTP status of the final answer.
  - `ok` boolean, required: true for a 2xx status.
  - `headers` object, required: content-type, cache-control, location, etag, x-* and a few more. Never set-cookie.
  - `redirects` object[], required: The redirects that were followed, in order.
    - `status` integer, required
    - `url` string, required
    - `location` string, required
  - `redirect_blocked` string: Set when a redirect was not followed (another host, not https, or too many); status and headers are then of that redirect.
  - `content_type` string, nullable, required
  - `body` string, nullable, required: The body as text, at most 20 KB; null for HEAD, an empty body or a body that is not text.
  - `body_bytes` integer, required: Bytes received (reading stops after 256 KB).
  - `truncated` boolean, required: true when the body is longer than what is returned.
  - `body_note` string: Why the body is not shown, when it is not.
  - `elapsed_ms` integer, required

## Other responses

- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `502`: Bad Gateway: upstream_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
