SDK ReferencePython SDK
Fetch
API functions for the Fetch resource.
Fetch
Functions for interacting with the fetch API resource. Each operation ships in four forms — sync / sync_detailed and their async counterparts.
Get Fetch
Fetch a URL (GET)
Direct HTTP fetch. Successful responses return the upstream response bytes verbatim;
metadata is returned in X-Fetch-* headers. Non-2xx upstream responses use the
upstream_error JSON envelope with the upstream HTTP status.
Parameters
url_query (str)country (Union[Unset, str])timeout_ms (Union[Unset, int])cache_ttl (Union[GetFetchCacheTtlType1, Unset, str])
Call styles
sync_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]
sync(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]
await asyncio_detailed(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]
await asyncio(client=client, url_query=url_query, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]Post Fetch
Fetch a URL (POST)
Same as GET /v1/fetch but with a JSON request body.
Limits: request bodies are capped at 512 KB. An oversized body
returns a 400 with error code request_too_large.
Parameters
body (FetchRequest)
Call styles
sync_detailed(client=client, body=body) -> Response[Union[Error, str]]
sync(client=client, body=body) -> Optional[Union[Error, str]]
await asyncio_detailed(client=client, body=body) -> Response[Union[Error, str]]
await asyncio(client=client, body=body) -> Optional[Union[Error, str]]