It seems OSM doesnt have pagination so querying programmatically on a large bounding box or a big city (as London) can cause some time out of the request.
A suggestion as per Is there a way to get results for an overpass query paginated? is to split the bounding box but nothing about in the Overpass documentation : https://dev.overpass-api.de/overpass-doc/en/full_data/area.html#full
How to programmatically split the bounding box in smaller part or a named area for Overpass API?
area[name="Paris"]->.searchArea;
nwr[shop=supermarket](area.searchArea);
out center;