In recent years, advancements in machine learning based interpolation methods have enabled the production of high-resolution maps of sea surface partial pressure of CO2 (pCO2) derived from observations extracted from databases such as the Surface Ocean CO2 Atlas (SOCAT). These pCO2-products now allow quantifying the oceanic air–sea CO2 exchange based on observations. However, most of them do not yet explicitly include the coastal ocean. Instead, they simply extend the open ocean values onto the nearshore shallow waters, or their spatial resolution is simply so coarse that they do not accurately capture the highly heterogeneous spatiotemporal pCO2 dynamics of coastal zones. Until today, only one global pCO2-product has been specifically designed for the coastal ocean (Laruelle et al., 2017). This product, however, has shortcomings because it only provides a climatology covering a relatively short period (1998–2015), thus hindering its application to the evaluation of the interannual variability, decadal changes and the long-term trends of the coastal air–sea CO2 exchange, a temporal evolution that is still poorly understood and highly debated. Here we aim at closing this knowledge gap and update the coastal product of Laruelle et al. (2017) to investigate the longest global monthly time series available for the coastal ocean from 1982 to 2020. The method remains based on a two-step Self-Organizing Maps and Feed-Forward Network method adapted for coastal regions, but we include additional environmental predictors and use a larger pool of training and validation data with ∼18 million direct observations extracted from the latest release of the SOCAT database. Our study reveals that the coastal ocean has been acting as an atmospheric CO2 sink of −0.40 Pg C yr−1 (−0.18 Pg C yr−1 with a narrower coastal domain) on average since 1982, and the intensity of this sink has increased at a rate of 0.06 Pg C yr−1 decade−1 (0.02 Pg C yr−1 decade−1 with a narrower coastal domain) over time. Our results also show that the temporal changes in the air–sea pCO2 gradient plays a significant role in the long-term evolution of the coastal CO2 sink, along with wind speed and sea-ice coverage changes that can also play an important role in some regions, particularly at high latitudes. This new reconstructed coastal pCO2-product (https://doi.org/10.25921/4sde-p068; Roobaert et al., 2023) allows us to establish regional carbon budgets requiring high-resolution coastal flux estimates and provides new constraints for closing the global carbon cycle. |