The block maxima approach is one of the main methodologies in extreme value theory to obtain a suitable distribution to estimate the probability of large values. In this approach, the block size is usually selected in order to reflect the possible intrinsic periodicity of the studied phenomenon. The generalization of this approach to data from non-seasonal phenomena is not straightforward. To address this problem, we propose an automatic data-driven method to identify the block size to use in the generalized extreme value (GEV) distribution for extrapolation. This methodology includes the validation of sufficient theoretical conditions ensuring that the maximum term converges to the GEV distribution. The selected GEV model can be different from the GEV model fitted on a sample of block maxima from arbitrary large block size. This selected GEV model has the special property to associate high values of the underlining variable with the corresponding smallest return periods. Such a model is useful in practice as it allows, for example, a better sizing of certain structures of protection against natural disasters. To illustrate the developed method, we consider two real datasets. The first dataset contains daily observations over several years from some meteorological variables while the second dataset contains data observed at millisecond time scale over several minutes from sensors in the field of vehicle engineering.