  In this paper we consider the enumeration of orientable and non-orientable
chord diagrams. We show that this enumeration is encoded in appropriate
expectation values of the $\beta$-deformed Gaussian and RNA matrix models. We
evaluate these expectation values by means of the $\beta$-deformed topological
recursion, and - independently - using properties of quantum curves. We show
that both these methods provide efficient and systematic algorithms for
counting of chord diagrams with a given genus, number of backbones and number
of chords.
