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) — string
  • formatstring
  • countrystring
  • timeout_msnumber
  • cache_ttlstring | 0 — How long a freshly fetched URL may be served from cache. Matches the OpenAPI FetchRequest.cache_ttl schema: a duration string ("48h", "2d", up to 168h / 7d) or the integer 0 to disable caching. Defaults to "48h" server-side when omitted.
  • customRecord<string, unknown> — User-supplied JSON payload, base64-encoded into 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. Does NOT affect cache-key inputs.