Advanced LIGO and Advanced Virgo are 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 gravitational-wave strain 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.