Advanced LIGO and Advanced Virgo are actively monitoring the sky and collecting gravitational-wave strain data with sufficient sensitivity to detect signals routinely. In this paper we describe the data recorded by these instruments during their first and second observing runs. The main data products are the gravitational-wave strain arrays, released as time series sampled at 16384 Hz. The datasets that include this strain measurement can be freely accessed through the Gravitational Wave Open Science Center at http://gw-openscience.org, together with data-quality information essential for the analysis of LIGO and Virgo data, documentation, tutorials, and supporting software.