There isn't a great solution for this in general as it would heavily depend on the resolution and frequency at which the water data is updated and level of accuracy you want. Most map platforms for example render streams and small rivers as lines that have no widths and the shoreline borders aren't the highest resolution. The shoreline of all bodies of water have the potential of changing over time (big changes can happen over the course of a year.
That said, if using Azure Maps, it uses vector tiles under the hood for the base maps, and it is possible to query what entities in the map exist at any point in the rendered map. There is a code sample for this here: https://samples.azuremaps.com/?search=inspect&sample=inspect-features-under-the-mouse If you click on the map, then scroll down past the geometry information in the side panel, you will see the source layer information that usually classifies the data, like "river", "lake", "bay", "canal"...
On a similar topic I personally had a project where I needed to roughly know if a map tile was over a large body of water or not. In that case I was able to take a set of high-resolution country land boundaries that I found only, load them into a spatial database like PostgreSQL or Azure SQL, and then did a spatial intersection test. If there was an intersection, I would say it was over land, otherwise it was water. In my scenario I wanted a few extra map tiles near the shorelines, so I buffered the land boundaries by a few hundred meters in the spatial database.
I ended up exporting this into a unique tile indexing system down to zoom level 14 that is a few MB in size.