Method for obtaining local geomagnetic disturbance at middle latitudes, comprising the steps of: a) obtaining the measurement of the local horizontal geomagnetic field, by treating the original data provided by the magnetic sensors in the magnetometer located at the Earth's surface; b) determining a daily variation curve, representing the ionospheric origin contribution of the geomagnetic field horizontal component measured on the Earth's surface; c) determining a base line curve, representing the magnetic field contribution associated to the Earth's core, crust and mantle of the geomagnetic field horizontal component measured on the Earth's surface; d) obtaining the local geomagnetic disturbance as a result of removing from the horizontal component of the measured local geomagnetic field, the ionospheric contribution values and the contribution values of the Earth's core; characterized in that for obtaining the daily variation curve, an analysis is performed, even in real time, to determine if there is a quiet day or a disturbed day, with the following method: 1) an auxiliary tendency curve of the night values is determined; 2) the tendency curve of the night values is subtracted from the horizontal component of the measured magnetic field; 3) a quiet day model is fit to the data obtained in step 2), the geomagnetic quiet day model being defined by means of a cubic spline curve with four variable intensity control points which work as free parameters, and which are located with a fixed separation between them, encompassing all the local day hours, and with four control points having a zero-value intensity for all the local night hours; 4) classifying the data, from values of the goodness of fit performed in step 3) and with the thresholds being established according to each case, as those of a geomagnetic quiet day or those of a disturbed day; 5) the fit data from the quiet day model are established, for those days classified as quiet day, as the daily variation curve. a) obtaining the measurement of the local horizontal geomagnetic field, by treating the original data provided by the magnetic sensors in the magnetometer located at the Earth's surface; b) determining a daily variation curve, representing the ionospheric origin contribution of the geomagnetic field horizontal component measured on the Earth's surface; c) determining a base line curve, representing the magnetic field contribution associated to the Earth's core, crust and mantle of the geomagnetic field horizontal component measured on the Earth's surface; d) obtaining the local geomagnetic disturbance as a result of removing from the horizontal component of the measured local geomagnetic field, the ionospheric contribution values and the contribution values of the Earth's core; 1) an auxiliary tendency curve of the night values is determined; 2) the tendency curve of the night values is subtracted from the horizontal component of the measured magnetic field; 3) a quiet day model is fit to the data obtained in step 2), the geomagnetic quiet day model being defined by means of a cubic spline curve with four variable intensity control points which work as free parameters, and which are located with a fixed separation between them, encompassing all the local day hours, and with four control points having a zero-value intensity for all the local night hours; 4) classifying the data, from values of the goodness of fit performed in step 3) and with the thresholds being established according to each case, as those of a geomagnetic quiet day or those of a disturbed day; 5) the fit data from the quiet day model are established, for those days classified as quiet day, as the daily variation curve.