Skip to main content
This page documents an earlier version of the API client. For the latest version, see Request options.
Because network connections can be unstable and slow, the Algolia API clients have pre-configured timeouts.
Not all timeouts are configurable in every API client.

Examples

var configuration = new SearchConfig("YourApplicationID", "YourWriteAPIKey")
{
  ConnectTimeout = 15, // (Default) connection timeout in seconds
  ReadTimeout = 5, // (Default) read timeout in seconds
  WriteTimeout = 30, // (Default) write timeout in seconds
  HostDownDelay = 300 // 
};

Parameters

connectTimeout
integer
Timeout for the TCP session to connect.Available in all clients except Swift, C#, Go, and Kotlin,Default values:
dnsTimeout
integer
Timeout for the DNS resolution.Only available for Scala. This timeout exists as connectTimeout in the other API clients. If both connectTimeout and dnsTimeout are set, the smaller value of the two is used.Default values:
  • Scala: 200 milliseconds
hostDownDelay
integer
The expected time for an unavailable host to become available. Affects the time between API client retries.Only available for C#, Java, Go, and Scala.Default values:
  • C#, Java, Go, and Scala: 5 minutes
readTimeout
integer
Timeout for the read on the TCP socket.Default values:
  • PHP, Ruby: 30 seconds
  • JavaScript, Python, Swift, C#, Java, and Go: 5 seconds
  • Scala: 2 seconds
  • Kotlin: 50 seconds
requestTimeout
integer
HTTP timeout for the request.Only available for Scala.Default values:This timeout allows you to configure a global timeout that supersedes all other timeouts. Since it affects all different timeouts, there’s no default value.
searchReadTimeout
integer
Same as #, but applies only to search operations.Only available for Swift.Default values:
  • Swift: 5 seconds
writeTimeout
integer
default:"30 s"
Same as requestTimeout, but applies only to write operations.Available in all clients except Scala.Default values:
  • PHP, Ruby, JavaScript, Python, Swift, C#, Java, Go, and Kotlin: 30 seconds
I