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. Response body IS the content; metadata in X-Fetch-* headers. Omit format for raw passthrough. Use format=markdown or format=html for conversion.

Parameters

  • url_query (str)
  • format_ (GetFetchFormat | Unset)
  • country (str | Unset): Default: 'US'.
  • timeout_ms (int | Unset): Default: 60000.
  • cache_ttl (GetFetchCacheTtlType1 | str | Unset): Default: '48h'.

Call styles

sync_detailed(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[str]
sync(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> str | None
await asyncio_detailed(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> Response[str]
await asyncio(client=client, url_query=url_query, format_=format_, country=country, timeout_ms=timeout_ms, cache_ttl=cache_ttl) -> str | None

Post Fetch

Fetch a URL (POST)

Same as GET /v1/fetch but with a JSON request body.

Parameters

  • body (FetchRequest)

Call styles

sync_detailed(client=client, body=body) -> Response[str]
sync(client=client, body=body) -> str | None
await asyncio_detailed(client=client, body=body) -> Response[str]
await asyncio(client=client, body=body) -> str | None