An electrochemical cell for in situ grazing incidence x-ray diffraction is described, along with its implementation for characterization of corrosion in a model sweet oilfield environment. In order to mimic reservoir fluids, the cell has been designed to facilitate measurements from substrates immersed in solutions with low concentrations of dissolved oxygen. In addition, the temperature of the solution can be varied from room temperature up to ~ 800C. Diffraction patterns acquired with synchrotron radiation from X65 pipeline steel immersed in CO2-saturated aqueous NaCl solution (pH = 6.8, T = 800C) are presented. These data demonstrate the formation and temporal evolution of a multicomponent corrosion scale, which includes siderite (FeCO3) and chukanovite (Fe2 (OH) 2CO3).