Fetch a URL (GET)

Direct HTTP fetch. Metadata is returned in X-Fetch-* headers. What the body holds depends on X-Fetch-Fast-Path. When it is true, a successful response returns the upstream response bytes verbatim. When it is false the request fell back to a browser render, and the body is the rendered page rather than the bytes the target sent; X-Fetch-Content-Length is then the compressed size of that page. Non-2xx upstream responses use the upstream_error JSON envelope with the upstream HTTP status.

For AI agents: https://bytekit.com/llms.txt — every docs page is available as markdown by appending .md

GET
/v1/fetch

Authorization

AuthorizationRequiredBearer <token>

API key. Manage keys from the dashboard at app.bytekit.com.

In: header

Query Parameters

urlRequiredstring
Format: "uri"
countrystring

Two-letter country code. Either case is accepted; the value is upper-cased.

Default: "US"Pattern: "^[A-Za-z]{2}$"
timeout_msinteger
Default: 60000Minimum: 1000Maximum: 90000
cache_ttlstring | integer

How long a freshly fetched URL may be served from cache. 0 skips the cache read; cache-eligible fresh results are still written with the default 7-day TTL so later non-zero-TTL callers can HIT. Safety-classified WAF husks remain live-only and are not written. Accepts Nh (hours, up to 168h), Nd (days, up to 7d), or the integer 0. Examples: 0, 48h, 2d. Invalid values receive a 422 validation_error with an actionable message.

Default: "48h"
customstring

A JSON-encoded object, URL-encoded in the query string. It is echoed back base64-encoded in the X-Fetch-Custom response header so callers can correlate the response to caller-side state. Capped at 4096 UTF-8 bytes after JSON serialization, and not part of the cache key. A value that is not valid JSON answers 422 validation_error ("custom must be a JSON-encoded object"); valid JSON that is not an object is also rejected with 422.

curl https://api.bytekit.com/v1/fetch \
  -H "Authorization: Bearer sk_live_your_api_key_here"

Content from upstream.

"string"