Topology, with its abstract mathematical constructs, often manifests itself in physics and has a pivotal role in our understanding of natural phenomena. Notably, the discovery of topological phases in condensed-matter systems has changed the modern conception of phases of matter. The global nature of topological ordering, however, makes direct experimental probing an outstanding challenge. Present experimental tools are mainly indirect and, as a result, are inadequate for studying the topology of physical systems at a fundamental level. Here we employ the exquisite control afforded by state-of-the-art superconducting quantum circuits to investigate topological properties of various quantum systems. The essence of our approach is to infer geometric curvature by measuring the deflection of quantum trajectories in the curved space of the Hamiltonian. Topological properties are then revealed by integrating the curvature over closed surfaces, a quantum analogue of the Gauss-Bonnet theorem. We benchmark our technique by investigating basic topological concepts of the historically important Haldane model after mapping the momentum space of this condensed-matter model to the parameter space of a single-qubit Hamiltonian. In addition to constructing the topological phase diagram, we are able to visualize the microscopic spin texture of the associated states and their evolution across a topological phase transition. Going beyond non-interacting systems, we demonstrate the power of our method by studying topology in an interacting quantum system. This required a new qubit architecture that allows for simultaneous control over every term in a two-qubit Hamiltonian. By exploring the parameter space of this Hamiltonian, we discover the emergence of an interaction-induced topological phase. Our work establishes a powerful, generalizable experimental platform to study topological phenomena in quantum systems.