Configuration¶
All configuration is done through garth.configure(). Options can be combined
in a single call.
Domain Settings¶
China region¶
For users in China, configure the domain to use garmin.cn:
Proxy Settings¶
Proxy through Charles¶
For debugging or monitoring HTTP traffic:
SSL verification
Disabling SSL verification (ssl_verify=False) should only be used for
debugging purposes. Do not use in production.
Custom proxy¶
garth.configure(proxies={
"http": "http://proxy.example.com:8080",
"https": "http://proxy.example.com:8080"
})
Request Settings¶
Timeout¶
Set the request timeout in seconds (default: 10):
Retries¶
Configure automatic retry behavior for failed requests:
garth.configure(
retries=5, # Max retry attempts (default: 3)
status_forcelist=(408, 500, 502, 503, 504), # HTTP codes to retry
backoff_factor=1.0, # Delay multiplier between retries
)
429 not retried by default
HTTP 429 (Too Many Requests) is not in the default retry list because
retrying can make rate limiting worse. Add it explicitly if needed:
status_forcelist=(408, 429, 500, 502, 503, 504)
Connection Pool Settings¶
For high-throughput applications: