In this paper, a noniterative reconstruction method for solving the inverse potential problem is proposed. The forward problem is governed by a modified Helmholtz equation. The inverse problem consists in the reconstruction of a set of anomalies embedded into a geometrical domain from partial or total boundary measurements of the associated potential. Since the inverse problem is written in the form of an ill‐posed boundary value problem, the idea is to rewrite it as a topology optimization problem. In particular, a shape functional measuring the misfit between the solution obtained from the model and the data taken from the boundary measurements is minimized with respect to a set of ball‐shaped anomalies by using the concept of topological derivatives. It means that the shape functional is expanded asymptotically and then truncated up to the desired order term. The resulting truncated expansion is trivially minimized with respect to the parameters under consideration that leads to a noniterative second order reconstruction algorithm. As a result, the reconstruction process becomes very robust with respect to the noisy data and independent of any initial guess. Finally, some numerical experiments are presented showing the capability of the proposed method in reconstructing multiple anomalies of different sizes and shapes by taking into account complete or partial boundary measurements.