create_currency_api_session

Documentation for eth_defi.currency_api.session.create_currency_api_session function.

create_currency_api_session(retries=5, backoff_factor=0.5, pool_maxsize=16)

Create a requests.Session configured for the Exchange API.

Installs an LoggingRetry policy with exponential backoff that retries on 429 and 5xx responses, and a connection pool sized for the threaded scanner. Host fallback (jsDelivr → pages.dev) is handled by the client, not here.

Parameters
  • retries (int) – Maximum number of transport-level retries per request.

  • backoff_factor (float) – Exponential backoff factor passed to the retry policy.

  • pool_maxsize (int) – Connection pool size; should be >= the scanner max_workers.

Returns

A configured session. Safe to share across threads.

Return type

requests.sessions.Session