# HttpClientOptions<!-- -->

Configuration shared by every [HttpClient](https://docs.apify.com/api/client/js/reference/class/HttpClient.md).

### Hierarchy

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

## Index[](#Index)

### Properties

* [compression](#compression)
* [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)optionalcompression

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)

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.

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

headers?

<!-- -->

: Record\<string, string>

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)optionallogger

logger?

<!-- -->

: Log

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)optionalmaxRetries

maxRetries?

<!-- -->

: number = 8

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)optionalminDelayBetweenRetriesMillis

minDelayBetweenRetriesMillis?

<!-- -->

: number = 500

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)optionalstats

stats?

<!-- -->

: Statistics

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)optionaltimeoutLongSecs

timeoutLongSecs?

<!-- -->

: number = 360

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

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

timeoutMaxSecs?

<!-- -->

: number = 360

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)optionaltimeoutMediumSecs

timeoutMediumSecs?

<!-- -->

: number = 30

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

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

timeoutShortSecs?

<!-- -->

: number = 5

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

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

token?

<!-- -->

: string

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)optionalworkflowKey

workflowKey?

<!-- -->

: string

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