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. The response body IS the content; metadata is returned in X-Fetch-* headers.
Omit format for raw passthrough. Use format=markdown or format=html for conversion.
Parameters
url_query (str)format_ (Union[Unset, GetFetchFormat])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, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]
sync(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Optional[Union[Error, str]]
await asyncio_detailed(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[Union[Error, str]]
await asyncio(client=client, url_query=url_query, format_=format_, 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]]