I'm not aware of any API in iOS that exposes the list of nearby WiFi networks to an app.
To be honest, there is a private API for it. It is the one the AirPort Utility app uses for its built-in Wi-Fi Scan feature.
In iOS 13 you can only know the name of the current Wi-Fi network, and you require location permission for it.