Optical metrology techniques allow for contactless surface measurement of three-dimensional objects at micro and nanoscale resolutions. Nevertheless, they often require acquiring multiple images from several focal planes, which is a slow process that severely limits topographic imaging speed. Here we introduce Encoded Search Focal Scan (ESFS), a technique capable of generating height maps of the sample from a significantly reduced number of images, down to single digits. Such a reduction enables commensurate speed improvements, allowing quasi-real-time topographic reconstructions. We implement ESFS using different system prototypes, including an imaging confocal microscopeused for reference -, a system based on an interferometric microscope objective, and a combination of an imaging confocal system with polarized detection. For each case, we analyze performance in terms of lateral resolution and acquisition speed. As our results demonstrate, ESFS opens the door to accurate topographic reconstructions of dynamic and rapidly moving systems.