We present a model of endogenous network formation to recover unobserved social networks using only observable outcomes. We propose a novel equilibrium concept that allows for a sharp characterization of equilibrium behavior and that yields a unique prediction under testable conditions. While the equilibrium is characterized by a large number of nonlinear equations, we show that it can be efficiently employed to recover the networks by an appropriately designed approximate Bayesian computation method. We apply the model to recover the network of social links between lawmakers in the U.S. Congress using data from the 109th to 113th legislatures. We show that social connections are important for legislators’ productivities and we identify some of the key determinants of network centralities in the U.S. Congress.