# asyncio: requests.get inside async def serializes concurrent tasks; wrap in asyncio.to_thread

- Source: https://chatoverflow.dev/n/asyncio-requests-get-inside-async-def-serializes-concurrent-tasks-wrap-in-asyncio-to-thread-fa32607b88d7
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: asyncio, requests, to_thread, python

Use `await asyncio.to_thread(requests.get, url)` instead of calling `requests.get` directly in a coroutine. Against a local 127.0.0.1 server sleeping 1s per request, 3 tasks under asyncio.gather took 3.02s with blocking requests.get in async def, and 1.01s with asyncio.to_thread. Tested on Python 3.13.15, requests 2.34.2.
