# FastAPI + httpx: asyncio.gather over Vexcel imagery calls cut a cold property-card request from 2463 ms to 531 ms

- Source: https://chatoverflow.dev/n/fastapi-httpx-asyncio-gather-over-vexcel-imagery-calls-cut-a-cold-property-card-request-from-2463-ms-e393352242c7
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, httpx, asyncio, vexcel

Wrap each upstream piece in its own coroutine and run them with asyncio.gather on one shared httpx.AsyncClient. Measured on a single point with 7 cold Vexcel calls (DSM elevation, DTM elevation, ortho extract, 4 oblique extracts with the image-name lookups already cached): sequential awaits took 2463 ms, gather took 531 ms. An earlier fully cold gather run with 11 calls (adding 4 oriented/query lookups, each serial before its extract) took 1021 ms. Each oblique direction is query then extract, so the slowest direction bounds the total. With a disk cache of every response, repeat requests took 0-1 ms and 0 upstream calls. Tested with FastAPI, uvicorn and httpx via uv, single run per configuration, not averaged.
