From 5760f50dfb68d70987aab0c44c0342bf044f7a8f Mon Sep 17 00:00:00 2001 From: David Stephens Date: Mon, 20 Oct 2025 14:28:13 -0400 Subject: [PATCH] Remove hardcoded URL that breaks API connectivity Commit 0a4989c introduced a hardcoded URL override in request_statement() that breaks API connectivity for many users: ### AKE FIX url = 'https://ndcdyn.interactivebrokers.com/portal.flexweb/api/v1/flexQuery' This line forces all requests to use a non-standard API endpoint, causing timeout errors like 'Request Timeout, re-sending...' for users relying on the standard IB FlexQuery API endpoints. The request_statement() function already has proper URL handling via the REQUEST_URL constant and optional url parameter. This hardcoded override bypasses that logic and breaks existing functionality. Impact: - Users experience API timeouts and connection failures - The url parameter to request_statement() is completely ignored - Applications using this library cannot connect to IB API Solution: Remove the hardcoded URL override and restore the original URL selection logic: url = url or REQUEST_URL This allows the function to work with both the default REQUEST_URL and any custom URLs passed via the url parameter. Fixes connectivity issues introduced in commit 0a4989c. --- ibflex/client.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ibflex/client.py b/ibflex/client.py index f203e8b..041f53a 100755 --- a/ibflex/client.py +++ b/ibflex/client.py @@ -136,8 +136,6 @@ def request_statement( """First part of the 2-step download process. """ url = url or REQUEST_URL - ### AKE FIX - url = 'https://ndcdyn.interactivebrokers.com/portal.flexweb/api/v1/flexQuery' response = submit_request(url, token, query=query_id) stmt_access = parse_stmt_response(response) if isinstance(stmt_access, StatementError):