We propose an inverse optimization based methodology to determine market structure from the locational pricing of a commodity. The methodology requires that the market optically allocates goods and that locational prices correspond to shadow prices of this optimization problem. As a case-in-point, we study locational marginal price based electricity markets where prices are determined using the results of a centralized optimization for clearing the market. We apply the inverse optimization methodology to outcome data from the Midcontinent ISO electricity market and uncover transmission constraints explaining the price variation. We also discuss analytical applications such as identifying missing data and the residual demand derivative. To broaden the scope of applications, assumptions sufficient to justify the methodology for competitive markets are described.