Forecasting country-wide energy demand is an important activity for determining and progressing towards an energy secure future. In this paper, one-year-ahead energy use for the country of Spain has been modeled using metaheuristics with socio-economic indicators as the input variables. A total of 14 input variables were selected (including gross domestic product, the population of the country, import and export quantities, etc.). The data for energy use as well as the 14 input variables have been collected from the public websites for 45 years (for the period of 1970–2014). The approach here is to bifurcate the data into training and testing datasets with equal number of data points. The training dataset is used to train the algorithm while the testing dataset is used to evaluate the performance of the algorithm on the independent data. The metaheuristics applied has two components: A highly recursive Grammatical Evolution (GE) and Differential Evolution (DE). GE identifies the model structure while the DE optimizes the coefficients of the models. The performance of the algorithm was evaluated in terms of various statistical errors (RMSE 0.0393, Avg. Error −0.0091, R2 0.9503, Absolute Error 0.0312, and Relative Error 0.0427). The results so obtained confirm that the proposed GE+DE method is highly accurate and can be successfully used to model the country’s future energy demand precisely.