Is having a concurrent.futures.ThreadPoolExecutor call dangerous in a FastAPI endpoint?

You should rather use the HTTPX library, which provides an async API. As described in this answer , you spawn a Client and reuse it every time you need it. To make asynchronous requests with HTTPX, you’ll need an AsyncClient. You could control the connection pool size as well, using the limits keyword argument on … Read more