# FetchHttpClientOptions<!-- -->

Configuration of [FetchHttpClient](https://docs.apify.com/api/client/js/reference/class/FetchHttpClient.md).

### Hierarchy

* [HttpClientOptions](https://docs.apify.com/api/client/js/reference/interface/HttpClientOptions.md)
  * *FetchHttpClientOptions*

Added in 3.0.0

## Index[](#Index)

### Properties

* [compression](#compression)
* [fetch](#fetch)
* [headers](#headers)
* [logger](#logger)
* [maxRetries](#maxRetries)
* [minDelayBetweenRetriesMillis](#minDelayBetweenRetriesMillis)
* [stats](#stats)
* [timeoutLongSecs](#timeoutLongSecs)
* [timeoutMaxSecs](#timeoutMaxSecs)
* [timeoutMediumSecs](#timeoutMediumSecs)
* [timeoutShortSecs](#timeoutShortSecs)
* [token](#token)
* [workflowKey](#workflowKey)

## Properties<!-- -->[](#Properties)

### [](#compression)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L287)optionalinheritedcompression

compression?

<!-- -->

: [HttpCompressionAlgorithm](https://docs.apify.com/api/client/js/reference.md#HttpCompressionAlgorithm) | [HttpCompressor](https://docs.apify.com/api/client/js/reference/interface/HttpCompressor.md) = [HttpCompressionAlgorithm](https://docs.apify.com/api/client/js/reference.md#HttpCompressionAlgorithm) | [HttpCompressor](https://docs.apify.com/api/client/js/reference/interface/HttpCompressor.md)

Inherited from HttpClientOptions.compression

Compression of request bodies: the name of a built-in algorithm, or an [HttpCompressor](https://docs.apify.com/api/client/js/reference/interface/HttpCompressor.md) for a custom quality or algorithm.

### [](#fetch)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/fetch.ts#L25)optionalfetch

fetch?

<!-- -->

: { (input, init): Promise\<Response>; (input, init): Promise\<Response> } = { (input, init): Promise\<Response>; (input, init): Promise\<Response> }

The `fetch` implementation the requests go through. Pass a wrapper around the global `fetch` to adjust every request, or the `fetch` of another library, such as `undici` with a dispatcher of your own, to control the connections. A stream body reaches it as an async iterable of byte chunks, or as the stream itself in Bun. In a browser or an edge runtime, a web `ReadableStream` body reaches it as a web stream.

***

#### Type declaration

* * (input, init): Promise\<Response>
  * (input, init): Promise\<Response>

  - [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)

    ***

    #### Parameters

    * ##### input: URL | RequestInfo
    * ##### optionalinit: RequestInit

    #### Returns Promise\<Response>

  - #### Parameters

    * ##### input: string | URL | Request
    * ##### optionalinit: RequestInit

    #### Returns Promise\<Response>

### [](#headers)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L289)optionalinheritedheaders

headers?

<!-- -->

: Record\<string, string>

Inherited from HttpClientOptions.headers

Additional headers sent with every request. They win over the built-in defaults.

### [](#logger)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L293)optionalinheritedlogger

logger?

<!-- -->

: Log

Inherited from HttpClientOptions.logger

Logger for the retry warnings. Defaults to a child of the `@apify/log` default with an `ApifyClient` prefix.

### [](#maxRetries)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L268)optionalinheritedmaxRetries

maxRetries?

<!-- -->

: number = 8

Inherited from HttpClientOptions.maxRetries

How many times a failed request is retried at most.

### [](#minDelayBetweenRetriesMillis)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L273)optionalinheritedminDelayBetweenRetriesMillis

minDelayBetweenRetriesMillis?

<!-- -->

: number = 500

Inherited from HttpClientOptions.minDelayBetweenRetriesMillis

Lower bound for the delay before the first retry in milliseconds. It doubles with every further retry.

### [](#stats)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L291)optionalinheritedstats

stats?

<!-- -->

: Statistics

Inherited from HttpClientOptions.stats

Statistics the client records its calls into. Created when omitted.

### [](#timeoutLongSecs)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L279)optionalinheritedtimeoutLongSecs

timeoutLongSecs?

<!-- -->

: number = 360

Inherited from HttpClientOptions.timeoutLongSecs

Duration of the `long` timeout tier, in seconds.

### [](#timeoutMaxSecs)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L281)optionalinheritedtimeoutMaxSecs

timeoutMaxSecs?

<!-- -->

: number = 360

Inherited from HttpClientOptions.timeoutMaxSecs

Upper bound for the timeout of a single attempt, in seconds.

### [](#timeoutMediumSecs)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L277)optionalinheritedtimeoutMediumSecs

timeoutMediumSecs?

<!-- -->

: number = 30

Inherited from HttpClientOptions.timeoutMediumSecs

Duration of the `medium` timeout tier, in seconds.

### [](#timeoutShortSecs)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L275)optionalinheritedtimeoutShortSecs

timeoutShortSecs?

<!-- -->

: number = 5

Inherited from HttpClientOptions.timeoutShortSecs

Duration of the `short` timeout tier, in seconds.

### [](#token)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L266)optionalinheritedtoken

token?

<!-- -->

: string

Inherited from HttpClientOptions.token

Apify API token, sent as a `Bearer` token in the `Authorization` header.

### [](#workflowKey)[](https://github.com/apify/apify-client-js/blob/af7590882995a0bde27cc341c79f21d08bec1e56/src/http_clients/base.ts#L295)optionalinheritedworkflowKey

workflowKey?

<!-- -->

: string

Inherited from HttpClientOptions.workflowKey

Value of the `X-Apify-Workflow-Key` header. Defaults to the `APIFY_WORKFLOW_KEY` environment variable.
