SDK ReferenceTypeScript SDK
Fetch
Low-latency raw HTTP fetch with optional conversion.
Fetch
Low-latency raw HTTP fetch with optional conversion. Accessed via client.fetch.
create
client.fetch.create(opts: FetchOpts): Promise<unknown>POST /v1/fetch — fetch URL content via POST body.
Returns content directly (not ID-based).
get
client.fetch.get(opts: FetchOpts): Promise<unknown>GET /v1/fetch — fetch URL content via query params.
Returns content directly (not ID-based).
Options (FetchOpts)
url(required) —stringformat—stringcountry—stringtimeout_ms—numbercache_ttl—string | 0— How long a freshly fetched URL may be served from cache. Matches the OpenAPIFetchRequest.cache_ttlschema: a duration string ("48h","2d", up to168h/7d) or the integer0to disable caching. Defaults to"48h"server-side when omitted.custom—Record<string, unknown>— User-supplied JSON payload, base64-encoded into theX-Fetch-Customresponse header so callers can correlate the response to caller-side state. Capped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect cache-key inputs.